mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 15:29:44 -05:00
Fix annoyances with access control dialog
* Don't send database locked/unlocked messages when "search in all databases" is enabled * After access control dialog closes, only hide main window on macOS, and then only if previously hidden.
This commit is contained in:
parent
45848c3f61
commit
48bf4fb85d
@ -755,9 +755,12 @@ QList<Entry*> BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
|
||||
}
|
||||
|
||||
m_dialogActive = true;
|
||||
bool wasAppActive = qApp->activeWindow() == getMainWindow()->window();
|
||||
BrowserAccessControlDialog accessControlDialog;
|
||||
|
||||
connect(m_currentDatabaseWidget, SIGNAL(databaseLocked()), &accessControlDialog, SLOT(reject()));
|
||||
connect(this, SIGNAL(activeDatabaseChanged()), &accessControlDialog, SLOT(reject()));
|
||||
|
||||
connect(&accessControlDialog, &BrowserAccessControlDialog::disableAccess, [&](QTableWidgetItem* item) {
|
||||
auto entry = pwEntriesToConfirm[item->row()];
|
||||
BrowserEntryConfig config;
|
||||
@ -795,8 +798,18 @@ QList<Entry*> BrowserService::confirmEntries(QList<Entry*>& pwEntriesToConfirm,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
// Re-hide the application if it wasn't visible before
|
||||
// only affects macOS because dialogs force the main window to show
|
||||
if (!wasAppActive) {
|
||||
hideWindow();
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(wasAppActive);
|
||||
#endif
|
||||
|
||||
m_dialogActive = false;
|
||||
hideWindow();
|
||||
|
||||
return allowedEntries;
|
||||
}
|
||||
|
||||
@ -1238,14 +1251,16 @@ void BrowserService::databaseUnlocked(DatabaseWidget* dbWidget)
|
||||
|
||||
void BrowserService::activeDatabaseChanged(DatabaseWidget* dbWidget)
|
||||
{
|
||||
m_currentDatabaseWidget = dbWidget;
|
||||
if (dbWidget) {
|
||||
// Only emit these signals when we are not searching in all databases
|
||||
if (dbWidget && !browserSettings()->searchInAllDatabases()) {
|
||||
if (dbWidget->isLocked()) {
|
||||
databaseLocked(dbWidget);
|
||||
} else {
|
||||
databaseUnlocked(dbWidget);
|
||||
}
|
||||
}
|
||||
|
||||
m_currentDatabaseWidget = dbWidget;
|
||||
}
|
||||
|
||||
void BrowserService::processClientMessage(const QJsonObject& message)
|
||||
|
@ -34,7 +34,6 @@ enum
|
||||
max_length = 16 * 1024
|
||||
};
|
||||
|
||||
class DatabaseTabWidget;
|
||||
class DatabaseWidget;
|
||||
class BrowserHost;
|
||||
class BrowserAction;
|
||||
|
Loading…
Reference in New Issue
Block a user