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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user