mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-13 08:19:50 -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;
|
m_dialogActive = true;
|
||||||
|
bool wasAppActive = qApp->activeWindow() == getMainWindow()->window();
|
||||||
BrowserAccessControlDialog accessControlDialog;
|
BrowserAccessControlDialog accessControlDialog;
|
||||||
|
|
||||||
connect(m_currentDatabaseWidget, SIGNAL(databaseLocked()), &accessControlDialog, SLOT(reject()));
|
connect(m_currentDatabaseWidget, SIGNAL(databaseLocked()), &accessControlDialog, SLOT(reject()));
|
||||||
|
connect(this, SIGNAL(activeDatabaseChanged()), &accessControlDialog, SLOT(reject()));
|
||||||
|
|
||||||
connect(&accessControlDialog, &BrowserAccessControlDialog::disableAccess, [&](QTableWidgetItem* item) {
|
connect(&accessControlDialog, &BrowserAccessControlDialog::disableAccess, [&](QTableWidgetItem* item) {
|
||||||
auto entry = pwEntriesToConfirm[item->row()];
|
auto entry = pwEntriesToConfirm[item->row()];
|
||||||
BrowserEntryConfig config;
|
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;
|
m_dialogActive = false;
|
||||||
hideWindow();
|
|
||||||
return allowedEntries;
|
return allowedEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1238,14 +1251,16 @@ void BrowserService::databaseUnlocked(DatabaseWidget* dbWidget)
|
|||||||
|
|
||||||
void BrowserService::activeDatabaseChanged(DatabaseWidget* dbWidget)
|
void BrowserService::activeDatabaseChanged(DatabaseWidget* dbWidget)
|
||||||
{
|
{
|
||||||
m_currentDatabaseWidget = dbWidget;
|
// Only emit these signals when we are not searching in all databases
|
||||||
if (dbWidget) {
|
if (dbWidget && !browserSettings()->searchInAllDatabases()) {
|
||||||
if (dbWidget->isLocked()) {
|
if (dbWidget->isLocked()) {
|
||||||
databaseLocked(dbWidget);
|
databaseLocked(dbWidget);
|
||||||
} else {
|
} else {
|
||||||
databaseUnlocked(dbWidget);
|
databaseUnlocked(dbWidget);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_currentDatabaseWidget = dbWidget;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserService::processClientMessage(const QJsonObject& message)
|
void BrowserService::processClientMessage(const QJsonObject& message)
|
||||||
|
@ -34,7 +34,6 @@ enum
|
|||||||
max_length = 16 * 1024
|
max_length = 16 * 1024
|
||||||
};
|
};
|
||||||
|
|
||||||
class DatabaseTabWidget;
|
|
||||||
class DatabaseWidget;
|
class DatabaseWidget;
|
||||||
class BrowserHost;
|
class BrowserHost;
|
||||||
class BrowserAction;
|
class BrowserAction;
|
||||||
|
Loading…
Reference in New Issue
Block a user