diff --git a/src/gui/ChangeMasterKeyWidget.cpp b/src/gui/ChangeMasterKeyWidget.cpp index df3e3c75a..0030e60b8 100644 --- a/src/gui/ChangeMasterKeyWidget.cpp +++ b/src/gui/ChangeMasterKeyWidget.cpp @@ -31,12 +31,19 @@ ChangeMasterKeyWidget::ChangeMasterKeyWidget(QWidget* parent) connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(generateKey())); connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject())); + connect(m_ui->togglePasswordButton, SIGNAL(toggled(bool)), SLOT(togglePassword(bool))); } ChangeMasterKeyWidget::~ChangeMasterKeyWidget() { } +void ChangeMasterKeyWidget::togglePassword(bool checked) +{ + m_ui->enterPasswordEdit->setEchoMode(checked ? QLineEdit::Password : QLineEdit::Normal); + m_ui->repeatPasswordEdit->setEchoMode(checked ? QLineEdit::Password : QLineEdit::Normal); +} + void ChangeMasterKeyWidget::clearForms() { m_key.clear(); @@ -45,6 +52,7 @@ void ChangeMasterKeyWidget::clearForms() m_ui->enterPasswordEdit->setText(""); m_ui->repeatPasswordEdit->setText(""); m_ui->keyFileGroup->setChecked(false); + m_ui->togglePasswordButton->setChecked(true); // TODO clear m_ui->keyFileCombo } diff --git a/src/gui/ChangeMasterKeyWidget.h b/src/gui/ChangeMasterKeyWidget.h index 80c3ea9a0..647715737 100644 --- a/src/gui/ChangeMasterKeyWidget.h +++ b/src/gui/ChangeMasterKeyWidget.h @@ -45,6 +45,7 @@ Q_SIGNALS: private Q_SLOTS: void generateKey(); void reject(); + void togglePassword(bool checked); private: QScopedPointer m_ui; diff --git a/src/gui/ChangeMasterKeyWidget.ui b/src/gui/ChangeMasterKeyWidget.ui index 6c842110b..1ca147181 100644 --- a/src/gui/ChangeMasterKeyWidget.ui +++ b/src/gui/ChangeMasterKeyWidget.ui @@ -7,7 +7,7 @@ 0 0 438 - 237 + 242 @@ -63,6 +63,12 @@ ... + + true + + + true +