mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-10-12 05:20:53 -04:00
Automatically check password checkbox and make toggle password button work.
This commit is contained in:
parent
c7ed5f8421
commit
0ba03920df
3 changed files with 26 additions and 2 deletions
|
@ -26,6 +26,8 @@ KeyOpenDialog::KeyOpenDialog(QWidget* parent)
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
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()));
|
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(createKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,3 +50,13 @@ void KeyOpenDialog::createKey()
|
||||||
// TODO read key file
|
// 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:
|
private Q_SLOTS:
|
||||||
void createKey();
|
void createKey();
|
||||||
|
void togglePassword(bool checked);
|
||||||
|
void activatePassword();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::KeyOpenDialog> m_ui;
|
QScopedPointer<Ui::KeyOpenDialog> m_ui;
|
||||||
|
|
|
@ -24,13 +24,23 @@
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="editPassword"/>
|
<widget class="QLineEdit" name="editPassword">
|
||||||
|
<property name="echoMode">
|
||||||
|
<enum>QLineEdit::Password</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="buttonTogglePassword">
|
<widget class="QToolButton" name="buttonTogglePassword">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue