X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fpasswordchangedlg.cpp;h=4335666c4ab54936579c2a0aa1f1c826d220bc92;hb=c0d6dc0dec628f2e143e37ecc95cec45e636f8a5;hp=14048feb2cc72aab73e267e0d594d7614eb8bb92;hpb=0a43227b8cd44625f4881cc1545d42c8c8a4876c;p=quassel.git
diff --git a/src/qtui/passwordchangedlg.cpp b/src/qtui/passwordchangedlg.cpp
index 14048feb..4335666c 100644
--- a/src/qtui/passwordchangedlg.cpp
+++ b/src/qtui/passwordchangedlg.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2005-2016 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -25,26 +25,26 @@
#include "client.h"
-PasswordChangeDlg::PasswordChangeDlg(QWidget *parent) : QDialog(parent)
+PasswordChangeDlg::PasswordChangeDlg(QWidget* parent)
+ : QDialog(parent)
{
ui.setupUi(this);
CoreAccount account = Client::currentCoreAccount();
ui.infoLabel->setText(tr("This changes the password for your username %1 "
"on the Quassel Core running at %2.")
- .arg(account.user(), account.hostName()));
+ .arg(account.user(), account.hostName()));
- connect(ui.oldPasswordEdit, SIGNAL(textChanged(QString)), SLOT(inputChanged()));
- connect(ui.newPasswordEdit, SIGNAL(textChanged(QString)), SLOT(inputChanged()));
- connect(ui.confirmPasswordEdit, SIGNAL(textChanged(QString)), SLOT(inputChanged()));
- connect(ui.buttonBox, SIGNAL(accepted()), SLOT(changePassword()));
+ connect(ui.oldPasswordEdit, &QLineEdit::textChanged, this, &PasswordChangeDlg::inputChanged);
+ connect(ui.newPasswordEdit, &QLineEdit::textChanged, this, &PasswordChangeDlg::inputChanged);
+ connect(ui.confirmPasswordEdit, &QLineEdit::textChanged, this, &PasswordChangeDlg::inputChanged);
+ connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &PasswordChangeDlg::changePassword);
- connect(Client::instance(), SIGNAL(passwordChanged(bool)), SLOT(passwordChanged(bool)));
+ connect(Client::instance(), &Client::passwordChanged, this, &PasswordChangeDlg::passwordChanged);
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
}
-
void PasswordChangeDlg::inputChanged()
{
bool ok = !ui.oldPasswordEdit->text().isEmpty() && !ui.newPasswordEdit->text().isEmpty()
@@ -52,21 +52,18 @@ void PasswordChangeDlg::inputChanged()
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(ok);
}
-
void PasswordChangeDlg::changePassword()
{
ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
Client::changePassword(ui.oldPasswordEdit->text(), ui.newPasswordEdit->text());
}
-
void PasswordChangeDlg::passwordChanged(bool success)
{
if (!success) {
- QMessageBox box(QMessageBox::Warning, tr("Password Not Changed"),
- tr("Password change failed"),
- QMessageBox::Ok, this);
- box.setInformativeText(tr("The core reported an error when trying to change your password. Make sure you entered your old password correctly!"));
+ QMessageBox box(QMessageBox::Warning, tr("Password Not Changed"), tr("Password change failed"), QMessageBox::Ok, this);
+ box.setInformativeText(
+ tr("The core reported an error when trying to change your password. Make sure you entered your old password correctly!"));
box.exec();
}
else {