1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
This commit is contained in:
Dubslow 2015-01-20 02:07:56 -06:00
parent 2d2522626c
commit 96fd1e514d
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA
2 changed files with 8 additions and 3 deletions

View File

@ -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()
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();
}

View File

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