From 635d6fe82c8fc292c0253b23183d41e876de303f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20V=C3=A4nttinen?= Date: Fri, 4 May 2018 23:56:19 +0300 Subject: [PATCH] Bring browser credentials messagebox to the front (#1830) --- src/browser/BrowserService.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/browser/BrowserService.cpp b/src/browser/BrowserService.cpp index 1a1f9f9e..2f9985d2 100644 --- a/src/browser/BrowserService.cpp +++ b/src/browser/BrowserService.cpp @@ -341,12 +341,18 @@ void BrowserService::updateEntry(const QString& id, const QString& uuid, const Q } if (username.compare(login, Qt::CaseSensitive) != 0 || entry->password().compare(password, Qt::CaseSensitive) != 0) { - QMessageBox::StandardButton dialogResult = QMessageBox::No; + int dialogResult = QMessageBox::No; if (!BrowserSettings::alwaysAllowUpdate()) { - dialogResult = QMessageBox::warning(0, tr("KeePassXC: Update Entry"), - tr("Do you want to update the information in %1 - %2?") - .arg(QUrl(url).host()).arg(username), - QMessageBox::Yes|QMessageBox::No); + QMessageBox msgBox; + msgBox.setWindowTitle(tr("KeePassXC: Update Entry")); + msgBox.setText(tr("Do you want to update the information in %1 - %2?").arg(QUrl(url).host()).arg(username)); + msgBox.setStandardButtons(QMessageBox::Yes); + msgBox.addButton(QMessageBox::No); + msgBox.setDefaultButton(QMessageBox::No); + msgBox.setWindowFlags(Qt::WindowStaysOnTopHint); + msgBox.activateWindow(); + msgBox.raise(); + dialogResult = msgBox.exec(); } if (BrowserSettings::alwaysAllowUpdate() || dialogResult == QMessageBox::Yes) {