mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-07 01:12:57 -05:00
Make browser-prompted dialogue boxes unparented so that they appear on the current monitor.
Previously, they would be opened wherever the main window is. This could easily be on a different virtual desktop (or workspace): if so, the dialogue box would not be visible on any attached monitor until that workspace was selected. (This breaks some tests involving the database-open dialogue box.)
This commit is contained in:
parent
d61959466e
commit
9bd8b40e94
6 changed files with 12 additions and 14 deletions
|
|
@ -23,9 +23,8 @@
|
|||
#include "core/Entry.h"
|
||||
#include "gui/Icons.h"
|
||||
|
||||
BrowserAccessControlDialog::BrowserAccessControlDialog(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::BrowserAccessControlDialog())
|
||||
BrowserAccessControlDialog::BrowserAccessControlDialog()
|
||||
: m_ui(new Ui::BrowserAccessControlDialog())
|
||||
{
|
||||
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class BrowserAccessControlDialog : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BrowserAccessControlDialog(QWidget* parent = nullptr);
|
||||
explicit BrowserAccessControlDialog();
|
||||
~BrowserAccessControlDialog() override;
|
||||
|
||||
void setEntries(const QList<Entry*>& entriesToConfirm, const QString& urlString, bool httpAuth);
|
||||
|
|
|
|||
|
|
@ -24,9 +24,8 @@
|
|||
|
||||
#define STEP 1000
|
||||
|
||||
BrowserPasskeysConfirmationDialog::BrowserPasskeysConfirmationDialog(QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, m_ui(new Ui::BrowserPasskeysConfirmationDialog())
|
||||
BrowserPasskeysConfirmationDialog::BrowserPasskeysConfirmationDialog()
|
||||
: m_ui(new Ui::BrowserPasskeysConfirmationDialog())
|
||||
, m_passkeyUpdated(false)
|
||||
{
|
||||
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class BrowserPasskeysConfirmationDialog : public QDialog
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BrowserPasskeysConfirmationDialog(QWidget* parent = nullptr);
|
||||
explicit BrowserPasskeysConfirmationDialog();
|
||||
~BrowserPasskeysConfirmationDialog() override;
|
||||
|
||||
void registerCredential(const QString& username,
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ QList<Entry*> BrowserService::confirmEntries(QList<Entry*>& entriesToConfirm,
|
|||
|
||||
m_dialogActive = true;
|
||||
updateWindowState();
|
||||
BrowserAccessControlDialog accessControlDialog(m_currentDatabaseWidget);
|
||||
BrowserAccessControlDialog accessControlDialog;
|
||||
|
||||
connect(m_currentDatabaseWidget, SIGNAL(databaseLockRequested()), &accessControlDialog, SLOT(reject()));
|
||||
|
||||
|
|
@ -583,7 +583,7 @@ QString BrowserService::storeKey(const QString& key)
|
|||
QString id;
|
||||
|
||||
do {
|
||||
QInputDialog keyDialog(m_currentDatabaseWidget);
|
||||
QInputDialog keyDialog;
|
||||
connect(m_currentDatabaseWidget, SIGNAL(databaseLockRequested()), &keyDialog, SLOT(reject()));
|
||||
keyDialog.setWindowTitle(tr("KeePassXC - New key association request"));
|
||||
keyDialog.setLabelText(tr("You have received an association request for the following database:\n%1\n\n"
|
||||
|
|
@ -607,7 +607,7 @@ QString BrowserService::storeKey(const QString& key)
|
|||
contains =
|
||||
db->metadata()->customData()->contains(CustomData::getKeyWithPrefix(CustomData::BrowserKeyPrefix, id));
|
||||
if (contains) {
|
||||
dialogResult = MessageBox::warning(m_currentDatabaseWidget,
|
||||
dialogResult = MessageBox::warning(nullptr,
|
||||
tr("KeePassXC - Overwrite existing key?"),
|
||||
tr("A shared encryption key with the name \"%1\" "
|
||||
"already exists.\nDo you want to overwrite it?")
|
||||
|
|
@ -668,7 +668,7 @@ QJsonObject BrowserService::showPasskeysRegisterPrompt(const QJsonObject& public
|
|||
const auto existingEntries = getPasskeyEntriesWithUserHandle(rpId, userId, keyList);
|
||||
|
||||
raiseWindow();
|
||||
BrowserPasskeysConfirmationDialog confirmDialog(m_currentDatabaseWidget);
|
||||
BrowserPasskeysConfirmationDialog confirmDialog;
|
||||
confirmDialog.registerCredential(username, rpId, existingEntries, timeout);
|
||||
|
||||
auto dialogResult = confirmDialog.exec();
|
||||
|
|
@ -761,7 +761,7 @@ QJsonObject BrowserService::showPasskeysAuthenticationPrompt(const QJsonObject&
|
|||
const auto timeout = publicKeyOptions["timeout"].toInt();
|
||||
|
||||
raiseWindow();
|
||||
BrowserPasskeysConfirmationDialog confirmDialog(m_currentDatabaseWidget);
|
||||
BrowserPasskeysConfirmationDialog confirmDialog;
|
||||
confirmDialog.authenticateCredential(entries, rpId, timeout);
|
||||
auto dialogResult = confirmDialog.exec();
|
||||
if (dialogResult == QDialog::Accepted) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ DatabaseTabWidget::DatabaseTabWidget(QWidget* parent)
|
|||
: QTabWidget(parent)
|
||||
, m_dbWidgetStateSync(new DatabaseWidgetStateSync(this))
|
||||
, m_dbWidgetPendingLock(nullptr)
|
||||
, m_databaseOpenDialog(new DatabaseOpenDialog(this))
|
||||
, m_databaseOpenDialog(new DatabaseOpenDialog())
|
||||
, m_importWizard(nullptr)
|
||||
, m_databaseOpenInProgress(false)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue