Browser: Fix cancel with database unlock dialog (#11435)

This commit is contained in:
Sami Vänttinen authored and GitHub committed 2024-11-10 17:30:38 -05:00
1 parent bff0b93f5f
commit 2fc24be331
5 files changed
+23 -1

No files matched your search

+13
View File
@@ -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();