Bring browser credentials messagebox to the front (#1830)

This commit is contained in:
Sami Vänttinen 2018-05-04 23:56:19 +03:00 committed by Jonathan White
parent 658298bc31
commit 635d6fe82c

View File

@ -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) { 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()) { if (!BrowserSettings::alwaysAllowUpdate()) {
dialogResult = QMessageBox::warning(0, tr("KeePassXC: Update Entry"), QMessageBox msgBox;
tr("Do you want to update the information in %1 - %2?") msgBox.setWindowTitle(tr("KeePassXC: Update Entry"));
.arg(QUrl(url).host()).arg(username), msgBox.setText(tr("Do you want to update the information in %1 - %2?").arg(QUrl(url).host()).arg(username));
QMessageBox::Yes|QMessageBox::No); 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) { if (BrowserSettings::alwaysAllowUpdate() || dialogResult == QMessageBox::Yes) {