mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 07:19:42 -05:00
Prevent user from leaving unlock window by hitting ESC (#11199)
This commit is contained in:
parent
48d0f2b159
commit
69fad1e3da
@ -85,7 +85,7 @@ DatabaseOpenWidget::DatabaseOpenWidget(QWidget* parent)
|
||||
okBtn->setText(tr("Unlock"));
|
||||
okBtn->setDefault(true);
|
||||
connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(openDatabase()));
|
||||
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||
connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(cancelDatabaseUnlock()));
|
||||
|
||||
connect(m_ui->addKeyFileLinkLabel, &QLabel::linkActivated, this, &DatabaseOpenWidget::browseKeyFile);
|
||||
connect(m_ui->keyFileLineEdit, &PasswordWidget::textChanged, this, [&](const QString& text) {
|
||||
@ -448,6 +448,18 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::buildDatabaseKey()
|
||||
return databaseKey;
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::cancelDatabaseUnlock()
|
||||
{
|
||||
auto result = MessageBox::question(this,
|
||||
tr("Cancel Database Unlock"),
|
||||
tr("Would you like to cancel unlocking this database?"),
|
||||
MessageBox::Cancel | MessageBox::Ok,
|
||||
MessageBox::Cancel);
|
||||
if (result == MessageBox::Ok) {
|
||||
reject();
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::reject()
|
||||
{
|
||||
emit dialogFinished(false);
|
||||
|
@ -74,10 +74,11 @@ protected:
|
||||
|
||||
protected slots:
|
||||
virtual void openDatabase();
|
||||
void reject();
|
||||
|
||||
private slots:
|
||||
bool browseKeyFile();
|
||||
void cancelDatabaseUnlock();
|
||||
void reject();
|
||||
void toggleHardwareKeyComponent(bool state);
|
||||
void pollHardwareKey(bool manualTrigger = false);
|
||||
void hardwareKeyResponse(bool found);
|
||||
|
Loading…
Reference in New Issue
Block a user