Fix minor UX issues with DB Open Widget

* Only clear password field when switching tabs or minimizing. This prevents the setting "Remember Key Files and Hardware Keys" from being useless with multiple databases.
* Convert key file field to Line Edit, simplifies usage. Fix clear field button as well.
* Removed need for clearForms to check if the database is being opened (was a solution to tab switching while unlocking, no longer a problem).
This commit is contained in:
Jonathan White 2020-06-06 09:54:57 -04:00
parent 6c9125402a
commit 1ad0184473
4 changed files with 51 additions and 68 deletions

View file

@ -37,16 +37,12 @@ void KeePass1OpenWidget::openDatabase()
KeePass1Reader reader;
QString password;
QString keyFileName;
QString keyFileName = m_ui->keyFileLineEdit->text();
if (!m_ui->editPassword->text().isEmpty() || m_retryUnlockWithEmptyPassword) {
password = m_ui->editPassword->text();
}
if (!m_ui->comboKeyFile->currentText().isEmpty() && m_ui->comboKeyFile->currentData() != -1) {
keyFileName = m_ui->comboKeyFile->currentText();
}
QFile file(m_filename);
if (!file.open(QIODevice::ReadOnly)) {
m_ui->messageWidget->showMessage(tr("Unable to open the database.").append("\n").append(file.errorString()),