mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Automatically check password checkbox and make toggle password button work.
This commit is contained in:
parent
c7ed5f8421
commit
0ba03920df
@ -26,6 +26,8 @@ KeyOpenDialog::KeyOpenDialog(QWidget* parent)
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
connect(m_ui->buttonTogglePassword, SIGNAL(toggled(bool)), SLOT(togglePassword(bool)));
|
||||
connect(m_ui->editPassword, SIGNAL(textChanged(QString)), SLOT(activatePassword()));
|
||||
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(createKey()));
|
||||
}
|
||||
|
||||
@ -48,3 +50,13 @@ void KeyOpenDialog::createKey()
|
||||
// TODO read key file
|
||||
}
|
||||
}
|
||||
|
||||
void KeyOpenDialog::togglePassword(bool checked)
|
||||
{
|
||||
m_ui->editPassword->setEchoMode(checked ? QLineEdit::Password : QLineEdit::Normal);
|
||||
}
|
||||
|
||||
void KeyOpenDialog::activatePassword()
|
||||
{
|
||||
m_ui->checkPassword->setChecked(true);
|
||||
}
|
||||
|
@ -38,6 +38,8 @@ public:
|
||||
|
||||
private Q_SLOTS:
|
||||
void createKey();
|
||||
void togglePassword(bool checked);
|
||||
void activatePassword();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::KeyOpenDialog> m_ui;
|
||||
|
@ -24,13 +24,23 @@
|
||||
<item row="0" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editPassword"/>
|
||||
<widget class="QLineEdit" name="editPassword">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonTogglePassword">
|
||||
<widget class="QToolButton" name="buttonTogglePassword">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user