mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-24 23:09:44 -05:00
Browser: Fix cancel with database unlock dialog (#11435)
This commit is contained in:
parent
bff0b93f5f
commit
2fc24be331
@ -86,6 +86,10 @@ BrowserService::BrowserService()
|
||||
connect(getMainWindow(), &MainWindow::databaseUnlocked, this, &BrowserService::databaseUnlocked);
|
||||
connect(getMainWindow(), &MainWindow::databaseLocked, this, &BrowserService::databaseLocked);
|
||||
connect(getMainWindow(), &MainWindow::activeDatabaseChanged, this, &BrowserService::activeDatabaseChanged);
|
||||
connect(getMainWindow(),
|
||||
&MainWindow::databaseUnlockDialogFinished,
|
||||
this,
|
||||
&BrowserService::handleDatabaseUnlockDialogFinished);
|
||||
|
||||
setEnabled(browserSettings()->isEnabled());
|
||||
}
|
||||
@ -1678,6 +1682,15 @@ void BrowserService::activeDatabaseChanged(DatabaseWidget* dbWidget)
|
||||
m_currentDatabaseWidget = dbWidget;
|
||||
}
|
||||
|
||||
void BrowserService::handleDatabaseUnlockDialogFinished(bool accepted, DatabaseWidget* dbWidget)
|
||||
{
|
||||
// User canceled the database open dialog
|
||||
if (dbWidget && !accepted && m_bringToFrontRequested) {
|
||||
m_bringToFrontRequested = false;
|
||||
hideWindow();
|
||||
}
|
||||
}
|
||||
|
||||
void BrowserService::processClientMessage(QLocalSocket* socket, const QJsonObject& message)
|
||||
{
|
||||
auto clientID = message["clientID"].toString();
|
||||
|
@ -145,6 +145,7 @@ public slots:
|
||||
|
||||
private slots:
|
||||
void processClientMessage(QLocalSocket* socket, const QJsonObject& message);
|
||||
void handleDatabaseUnlockDialogFinished(bool accepted, DatabaseWidget* dbWidget);
|
||||
|
||||
private:
|
||||
enum Access
|
||||
|
@ -821,6 +821,9 @@ void DatabaseTabWidget::handleDatabaseUnlockDialogFinished(bool accepted, Databa
|
||||
m_dbWidgetPendingLock = dbWidget;
|
||||
}
|
||||
|
||||
// If browser extension requested the unlock make sure cancel is handled
|
||||
m_databaseOpenInProgress = false;
|
||||
|
||||
// signal other objects that the dialog finished
|
||||
emit databaseUnlockDialogFinished(accepted, dbWidget);
|
||||
}
|
||||
|
@ -192,6 +192,10 @@ MainWindow::MainWindow()
|
||||
connect(m_ui->tabWidget, &DatabaseTabWidget::databaseLocked, this, &MainWindow::databaseLocked);
|
||||
connect(m_ui->tabWidget, &DatabaseTabWidget::databaseUnlocked, this, &MainWindow::databaseUnlocked);
|
||||
connect(m_ui->tabWidget, &DatabaseTabWidget::activeDatabaseChanged, this, &MainWindow::activeDatabaseChanged);
|
||||
connect(m_ui->tabWidget,
|
||||
&DatabaseTabWidget::databaseUnlockDialogFinished,
|
||||
this,
|
||||
&MainWindow::databaseUnlockDialogFinished);
|
||||
|
||||
initViewMenu();
|
||||
initActionCollection();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2024 KeePassXC Team <team@keepassxc.org>
|
||||
* Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
||||
* Copyright (C) 2020 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -67,6 +67,7 @@ signals:
|
||||
void databaseUnlocked(DatabaseWidget* dbWidget);
|
||||
void databaseLocked(DatabaseWidget* dbWidget);
|
||||
void activeDatabaseChanged(DatabaseWidget* dbWidget);
|
||||
void databaseUnlockDialogFinished(bool accepted, DatabaseWidget* dbWidget);
|
||||
|
||||
public slots:
|
||||
void openDatabase(const QString& filePath, const QString& password = {}, const QString& keyfile = {});
|
||||
|
Loading…
Reference in New Issue
Block a user