mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branch 'pr699'
This commit is contained in:
commit
ad394c7bd9
|
@ -121,7 +121,7 @@ void Settings::load()
|
|||
autoAwayTime = s.value("autoAwayTime", 10).toInt();
|
||||
checkUpdates = s.value("checkUpdates", false).toBool();
|
||||
showInFront = s.value("showInFront", false).toBool();
|
||||
fauxOfflineMessaging = s.value("fauxOfflineMessaging", false).toBool();
|
||||
fauxOfflineMessaging = s.value("fauxOfflineMessaging", true).toBool();
|
||||
s.endGroup();
|
||||
|
||||
s.beginGroup("Widgets");
|
||||
|
|
|
@ -46,6 +46,10 @@ IdentityForm::IdentityForm() :
|
|||
|
||||
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()));
|
||||
connect(core, &Core::idSet, this, &IdentityForm::setToxId);
|
||||
|
@ -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()
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <QTextEdit>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QTimer>
|
||||
|
||||
class CroppingLabel;
|
||||
class Core;
|
||||
|
@ -72,6 +73,7 @@ private slots:
|
|||
private:
|
||||
Ui::IdentitySettings* bodyUI;
|
||||
Core* core;
|
||||
QTimer timer;
|
||||
|
||||
ClickableTE* toxId;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user