mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-24 15:25:31 -04:00
Use an icon for the button that shows/masks passwords.
Closes #38 Additionally make use of the new PasswordEdit class where possible.
This commit is contained in:
parent
8b437821a2
commit
223c5a1651
12 changed files with 39 additions and 77 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "core/Config.h"
|
||||
#include "core/Database.h"
|
||||
#include "core/FilePath.h"
|
||||
#include "gui/FileDialog.h"
|
||||
#include "gui/MessageBox.h"
|
||||
#include "format/KeePass2Reader.h"
|
||||
|
@ -40,7 +41,9 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
|
|||
|
||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||
|
||||
connect(m_ui->buttonTogglePassword, SIGNAL(toggled(bool)), SLOT(togglePassword(bool)));
|
||||
m_ui->buttonTogglePassword->setIcon(filePath()->onOffIcon("actions", "password-show"));
|
||||
connect(m_ui->buttonTogglePassword, SIGNAL(toggled(bool)),
|
||||
m_ui->editPassword, SLOT(setShowPassword(bool)));
|
||||
connect(m_ui->buttonBrowseFile, SIGNAL(clicked()), SLOT(browseKeyFile()));
|
||||
|
||||
connect(m_ui->editPassword, SIGNAL(textChanged(QString)), SLOT(activatePassword()));
|
||||
|
@ -155,11 +158,6 @@ void DatabaseOpenWidget::reject()
|
|||
Q_EMIT editFinished(false);
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::togglePassword(bool checked)
|
||||
{
|
||||
m_ui->editPassword->setEchoMode(checked ? QLineEdit::Password : QLineEdit::Normal);
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::activatePassword()
|
||||
{
|
||||
m_ui->checkPassword->setChecked(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue