Browse Source

Fix #967

pull/1028/head
Dubslow 11 years ago
parent
commit
96fd1e514d
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA
  1. 10
      src/widget/form/settings/identityform.cpp
  2. 1
      src/widget/form/settings/identityform.h

10
src/widget/form/settings/identityform.cpp

@ -46,9 +46,9 @@ IdentityForm::IdentityForm() : @@ -46,9 +46,9 @@ IdentityForm::IdentityForm() :
bodyUI->toxGroup->layout()->addWidget(toxId);
timer.setInterval(1000);
timer.setInterval(750);
timer.setSingleShot(true);
connect(&timer, &QTimer::timeout, this, [=]() {bodyUI->toxIdLabel->setText(bodyUI->toxIdLabel->text().replace("", ""));});
connect(&timer, &QTimer::timeout, this, [=]() {bodyUI->toxIdLabel->setText(bodyUI->toxIdLabel->text().replace("", "")); hasCheck = false;});
connect(bodyUI->toxIdLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
connect(toxId, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
@ -89,7 +89,11 @@ void IdentityForm::copyIdClicked() @@ -89,7 +89,11 @@ void IdentityForm::copyIdClicked()
QApplication::clipboard()->setText(txt);
toxId->setCursorPosition(0);
bodyUI->toxIdLabel->setText(bodyUI->toxIdLabel->text() + "");
if (!hasCheck)
{
bodyUI->toxIdLabel->setText(bodyUI->toxIdLabel->text() + "");
hasCheck = true;
}
timer.start();
}

1
src/widget/form/settings/identityform.h

@ -74,6 +74,7 @@ private: @@ -74,6 +74,7 @@ private:
Ui::IdentitySettings* bodyUI;
Core* core;
QTimer timer;
bool hasCheck = false;
ClickableTE* toxId;
};

Loading…
Cancel
Save