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();
|
autoAwayTime = s.value("autoAwayTime", 10).toInt();
|
||||||
checkUpdates = s.value("checkUpdates", false).toBool();
|
checkUpdates = s.value("checkUpdates", false).toBool();
|
||||||
showInFront = s.value("showInFront", false).toBool();
|
showInFront = s.value("showInFront", false).toBool();
|
||||||
fauxOfflineMessaging = s.value("fauxOfflineMessaging", false).toBool();
|
fauxOfflineMessaging = s.value("fauxOfflineMessaging", true).toBool();
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup("Widgets");
|
s.beginGroup("Widgets");
|
||||||
|
|
|
@ -45,6 +45,10 @@ IdentityForm::IdentityForm() :
|
||||||
toxId->setFont(Style::getFont(Style::Small));
|
toxId->setFont(Style::getFont(Style::Small));
|
||||||
|
|
||||||
bodyUI->toxGroup->layout()->addWidget(toxId);
|
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(bodyUI->toxIdLabel, SIGNAL(clicked()), this, SLOT(copyIdClicked()));
|
||||||
connect(toxId, 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::avPeerTimeout, this, &IdentityForm::enableSwitching);
|
||||||
connect(core, &Core::avRequestTimeout, 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, &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::statusMessageSet, this, [=](const QString& val) { bodyUI->statusMessage->setText(val); });
|
||||||
}
|
}
|
||||||
|
|
||||||
IdentityForm::~IdentityForm()
|
IdentityForm::~IdentityForm()
|
||||||
|
@ -84,6 +88,9 @@ void IdentityForm::copyIdClicked()
|
||||||
txt.replace('\n',"");
|
txt.replace('\n',"");
|
||||||
QApplication::clipboard()->setText(txt);
|
QApplication::clipboard()->setText(txt);
|
||||||
toxId->setCursorPosition(0);
|
toxId->setCursorPosition(0);
|
||||||
|
|
||||||
|
bodyUI->toxIdLabel->setText(bodyUI->toxIdLabel->text() + " ✔");
|
||||||
|
timer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IdentityForm::onUserNameEdited()
|
void IdentityForm::onUserNameEdited()
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
class CroppingLabel;
|
class CroppingLabel;
|
||||||
class Core;
|
class Core;
|
||||||
|
@ -72,6 +73,7 @@ private slots:
|
||||||
private:
|
private:
|
||||||
Ui::IdentitySettings* bodyUI;
|
Ui::IdentitySettings* bodyUI;
|
||||||
Core* core;
|
Core* core;
|
||||||
|
QTimer timer;
|
||||||
|
|
||||||
ClickableTE* toxId;
|
ClickableTE* toxId;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user