diff options
author | Jonathan White <support@dmapps.us> | 2020-12-12 20:08:02 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2020-12-12 20:31:43 +0300 |
commit | f0204dbb109a8fbaf739c35b9c459d247bdccd88 (patch) | |
tree | cc62b8c0a1fef9c7a8b440bbcab57a99e852493c /src/gui/DatabaseWidget.cpp | |
parent | 3b29f20d60f8fa00581c8c19a2e43e420d7a5d09 (diff) |
Fix closing modal dialogs on database lock
* Fixes #5719, Fixes #5744
Diffstat (limited to 'src/gui/DatabaseWidget.cpp')
-rw-r--r-- | src/gui/DatabaseWidget.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 505e7f0ba..3846db76b 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -216,7 +216,7 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent) #ifdef WITH_XC_SSHAGENT if (sshAgent()->isEnabled()) { - connect(this, SIGNAL(databaseLockRequested()), sshAgent(), SLOT(databaseLocked())); + connect(this, SIGNAL(databaseLocked()), sshAgent(), SLOT(databaseLocked())); connect(this, SIGNAL(databaseUnlocked()), sshAgent(), SLOT(databaseUnlocked())); } #endif @@ -437,6 +437,7 @@ void DatabaseWidget::showTotp() } auto totpDialog = new TotpDialog(this, currentEntry); + connect(this, &DatabaseWidget::databaseLockRequested, totpDialog, &TotpDialog::close); totpDialog->open(); } @@ -460,6 +461,7 @@ void DatabaseWidget::setupTotp() auto setupTotpDialog = new TotpSetupDialog(this, currentEntry); connect(setupTotpDialog, SIGNAL(totpUpdated()), SIGNAL(entrySelectionChanged())); + connect(this, &DatabaseWidget::databaseLockRequested, setupTotpDialog, &TotpSetupDialog::close); setupTotpDialog->open(); } @@ -701,6 +703,7 @@ void DatabaseWidget::showTotpKeyQrCode() auto currentEntry = currentSelectedEntry(); if (currentEntry) { auto totpDisplayDialog = new TotpExportSettingsDialog(this, currentEntry); + connect(this, &DatabaseWidget::databaseLockRequested, totpDisplayDialog, &TotpExportSettingsDialog::close); totpDisplayDialog->open(); } } @@ -1528,6 +1531,11 @@ bool DatabaseWidget::lock() emit databaseLockRequested(); + // ignore event if we are active and a modal dialog is still open (such as a message box or file dialog) + if (isVisible() && QApplication::activeModalWidget()) { + return false; + } + clipboard()->clearCopiedText(); if (isEditWidgetModified()) { |