Make toggle password button in ChangeMasterKey widget work.

This commit is contained in:
Florian Geyer 2012-04-19 19:32:01 +02:00 committed by Felix Geyer
parent 26c4dedd01
commit e06937287c
3 changed files with 16 additions and 1 deletions

View File

@ -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
}

View File

@ -45,6 +45,7 @@ Q_SIGNALS:
private Q_SLOTS:
void generateKey();
void reject();
void togglePassword(bool checked);
private:
QScopedPointer<Ui::ChangeMasterKeyWidget> m_ui;

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>438</width>
<height>237</height>
<height>242</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@ -63,6 +63,12 @@
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>