mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
75d64dc68d
commit
f9edd39bba
|
@ -122,6 +122,8 @@ ProfileForm::ProfileForm(QWidget *parent) :
|
||||||
connect(bodyUI->logoutButton, &QPushButton::clicked, this, &ProfileForm::onLogoutClicked);
|
connect(bodyUI->logoutButton, &QPushButton::clicked, this, &ProfileForm::onLogoutClicked);
|
||||||
connect(bodyUI->deletePassButton, &QPushButton::clicked, this, &ProfileForm::onDeletePassClicked);
|
connect(bodyUI->deletePassButton, &QPushButton::clicked, this, &ProfileForm::onDeletePassClicked);
|
||||||
connect(bodyUI->changePassButton, &QPushButton::clicked, this, &ProfileForm::onChangePassClicked);
|
connect(bodyUI->changePassButton, &QPushButton::clicked, this, &ProfileForm::onChangePassClicked);
|
||||||
|
connect(bodyUI->deletePassButton, &QPushButton::clicked, this, &ProfileForm::setPasswordButtonsText);
|
||||||
|
connect(bodyUI->changePassButton, &QPushButton::clicked, this, &ProfileForm::setPasswordButtonsText);
|
||||||
connect(bodyUI->saveQr, &QPushButton::clicked, this, &ProfileForm::onSaveQrClicked);
|
connect(bodyUI->saveQr, &QPushButton::clicked, this, &ProfileForm::onSaveQrClicked);
|
||||||
connect(bodyUI->copyQr, &QPushButton::clicked, this, &ProfileForm::onCopyQrClicked);
|
connect(bodyUI->copyQr, &QPushButton::clicked, this, &ProfileForm::onCopyQrClicked);
|
||||||
connect(bodyUI->toxmeRegisterButton, &QPushButton::clicked, this, &ProfileForm::onRegisterButtonClicked);
|
connect(bodyUI->toxmeRegisterButton, &QPushButton::clicked, this, &ProfileForm::onRegisterButtonClicked);
|
||||||
|
@ -389,6 +391,20 @@ void ProfileForm::onLogoutClicked()
|
||||||
nexus.showLogin();
|
nexus.showLogin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProfileForm::setPasswordButtonsText()
|
||||||
|
{
|
||||||
|
if (!Nexus::getProfile()->isEncrypted())
|
||||||
|
{
|
||||||
|
bodyUI->changePassButton->setText(tr("Set profile password", "button text"));
|
||||||
|
bodyUI->deletePassButton->setVisible(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bodyUI->changePassButton->setText(tr("Change password", "button text"));
|
||||||
|
bodyUI->deletePassButton->setVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ProfileForm::onCopyQrClicked()
|
void ProfileForm::onCopyQrClicked()
|
||||||
{
|
{
|
||||||
QApplication::clipboard()->setImage(*qr->getImage());
|
QApplication::clipboard()->setImage(*qr->getImage());
|
||||||
|
@ -444,6 +460,7 @@ void ProfileForm::retranslateUi()
|
||||||
{
|
{
|
||||||
bodyUI->retranslateUi(this);
|
bodyUI->retranslateUi(this);
|
||||||
nameLabel->setText(tr("User Profile"));
|
nameLabel->setText(tr("User Profile"));
|
||||||
|
setPasswordButtonsText();
|
||||||
// We have to add the toxId tooltip here and not in the .ui or Qt won't know how to translate it dynamically
|
// We have to add the toxId tooltip here and not in the .ui or Qt won't know how to translate it dynamically
|
||||||
toxId->setToolTip(tr("This bunch of characters tells other Tox clients how to contact you.\nShare it with your friends to communicate."));
|
toxId->setToolTip(tr("This bunch of characters tells other Tox clients how to contact you.\nShare it with your friends to communicate."));
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,7 @@ public slots:
|
||||||
void onLogoutClicked();
|
void onLogoutClicked();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void setPasswordButtonsText();
|
||||||
void setToxId(const QString& id);
|
void setToxId(const QString& id);
|
||||||
void copyIdClicked();
|
void copyIdClicked();
|
||||||
void onUserNameEdited();
|
void onUserNameEdited();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user