mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
parent
eb56bd8973
commit
7a017041bf
@ -49,10 +49,6 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
|
|||||||
connect(m_ui->editPassword, SIGNAL(textChanged(QString)), SLOT(activatePassword()));
|
connect(m_ui->editPassword, SIGNAL(textChanged(QString)), SLOT(activatePassword()));
|
||||||
connect(m_ui->comboKeyFile, SIGNAL(editTextChanged(QString)), SLOT(activateKeyFile()));
|
connect(m_ui->comboKeyFile, SIGNAL(editTextChanged(QString)), SLOT(activateKeyFile()));
|
||||||
|
|
||||||
connect(m_ui->checkPassword, SIGNAL(toggled(bool)), SLOT(setOkButtonEnabled()));
|
|
||||||
connect(m_ui->checkKeyFile, SIGNAL(toggled(bool)), SLOT(setOkButtonEnabled()));
|
|
||||||
connect(m_ui->comboKeyFile, SIGNAL(editTextChanged(QString)), SLOT(setOkButtonEnabled()));
|
|
||||||
|
|
||||||
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(openDatabase()));
|
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(openDatabase()));
|
||||||
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||||
}
|
}
|
||||||
@ -75,6 +71,7 @@ void DatabaseOpenWidget::load(const QString& filename)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||||
m_ui->editPassword->setFocus();
|
m_ui->editPassword->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,9 +96,6 @@ void DatabaseOpenWidget::openDatabase()
|
|||||||
{
|
{
|
||||||
KeePass2Reader reader;
|
KeePass2Reader reader;
|
||||||
CompositeKey masterKey = databaseKey();
|
CompositeKey masterKey = databaseKey();
|
||||||
if (masterKey.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QFile file(m_filename);
|
QFile file(m_filename);
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
@ -172,14 +166,6 @@ void DatabaseOpenWidget::activateKeyFile()
|
|||||||
m_ui->checkKeyFile->setChecked(true);
|
m_ui->checkKeyFile->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DatabaseOpenWidget::setOkButtonEnabled()
|
|
||||||
{
|
|
||||||
bool enable = m_ui->checkPassword->isChecked()
|
|
||||||
|| (m_ui->checkKeyFile->isChecked() && !m_ui->comboKeyFile->currentText().isEmpty());
|
|
||||||
|
|
||||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DatabaseOpenWidget::browseKeyFile()
|
void DatabaseOpenWidget::browseKeyFile()
|
||||||
{
|
{
|
||||||
QString filters = QString("%1 (*);;%2 (*.key)").arg(tr("All files"), tr("Key files"));
|
QString filters = QString("%1 (*);;%2 (*.key)").arg(tr("All files"), tr("Key files"));
|
||||||
|
@ -54,7 +54,6 @@ protected Q_SLOTS:
|
|||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void activatePassword();
|
void activatePassword();
|
||||||
void activateKeyFile();
|
void activateKeyFile();
|
||||||
void setOkButtonEnabled();
|
|
||||||
void browseKeyFile();
|
void browseKeyFile();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
Reference in New Issue
Block a user