mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-12 15:59:58 -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->setText(tr("Unlock"));
|
||||||
okBtn->setDefault(true);
|
okBtn->setDefault(true);
|
||||||
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(cancelDatabaseUnlock()));
|
||||||
|
|
||||||
connect(m_ui->addKeyFileLinkLabel, &QLabel::linkActivated, this, &DatabaseOpenWidget::browseKeyFile);
|
connect(m_ui->addKeyFileLinkLabel, &QLabel::linkActivated, this, &DatabaseOpenWidget::browseKeyFile);
|
||||||
connect(m_ui->keyFileLineEdit, &PasswordWidget::textChanged, this, [&](const QString& text) {
|
connect(m_ui->keyFileLineEdit, &PasswordWidget::textChanged, this, [&](const QString& text) {
|
||||||
@ -448,6 +448,18 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::buildDatabaseKey()
|
|||||||
return databaseKey;
|
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()
|
void DatabaseOpenWidget::reject()
|
||||||
{
|
{
|
||||||
emit dialogFinished(false);
|
emit dialogFinished(false);
|
||||||
|
@ -74,10 +74,11 @@ protected:
|
|||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
virtual void openDatabase();
|
virtual void openDatabase();
|
||||||
void reject();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
bool browseKeyFile();
|
bool browseKeyFile();
|
||||||
|
void cancelDatabaseUnlock();
|
||||||
|
void reject();
|
||||||
void toggleHardwareKeyComponent(bool state);
|
void toggleHardwareKeyComponent(bool state);
|
||||||
void pollHardwareKey(bool manualTrigger = false);
|
void pollHardwareKey(bool manualTrigger = false);
|
||||||
void hardwareKeyResponse(bool found);
|
void hardwareKeyResponse(bool found);
|
||||||
|
Loading…
Reference in New Issue
Block a user