diff --git a/src/widget/form/settings/identityform.cpp b/src/widget/form/settings/identityform.cpp index de10f90aa..b6bf1439e 100644 --- a/src/widget/form/settings/identityform.cpp +++ b/src/widget/form/settings/identityform.cpp @@ -45,6 +45,10 @@ IdentityForm::IdentityForm() : toxId->setFont(Style::getFont(Style::Small)); bodyUI->toxGroup->layout()->addWidget(toxId); + + timer.setInterval(1000); + timer.setSingleShot(true); + connect(&timer, &QTimer::timeout, this, [=]() {bodyUI->toxIdLabel->setText(bodyUI->toxIdLabel->text().replace(" ✔", ""));}); connect(bodyUI->toxIdLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked())); connect(toxId, SIGNAL(clicked()), this, SLOT(copyIdClicked())); @@ -68,8 +72,8 @@ IdentityForm::IdentityForm() : connect(core, &Core::avPeerTimeout, this, &IdentityForm::enableSwitching); connect(core, &Core::avRequestTimeout, this, &IdentityForm::enableSwitching); - connect(Core::getInstance(), &Core::usernameSet, this, [=](const QString& val) { bodyUI->userName->setText(val); }); - connect(Core::getInstance(), &Core::statusMessageSet, this, [=](const QString& val) { bodyUI->statusMessage->setText(val); }); + connect(core, &Core::usernameSet, this, [=](const QString& val) { bodyUI->userName->setText(val); }); + connect(core, &Core::statusMessageSet, this, [=](const QString& val) { bodyUI->statusMessage->setText(val); }); } IdentityForm::~IdentityForm() @@ -84,6 +88,9 @@ void IdentityForm::copyIdClicked() txt.replace('\n',""); QApplication::clipboard()->setText(txt); toxId->setCursorPosition(0); + + bodyUI->toxIdLabel->setText(bodyUI->toxIdLabel->text() + " ✔"); + timer.start(); } void IdentityForm::onUserNameEdited() diff --git a/src/widget/form/settings/identityform.h b/src/widget/form/settings/identityform.h index f602cc852..b30ec8070 100644 --- a/src/widget/form/settings/identityform.h +++ b/src/widget/form/settings/identityform.h @@ -22,6 +22,7 @@ #include #include #include +#include class CroppingLabel; class Core; @@ -72,6 +73,7 @@ private slots: private: Ui::IdentitySettings* bodyUI; Core* core; + QTimer timer; ClickableTE* toxId; };