Browse Source

Prevent the new update box from blocking input on other dialogues

PR #16678.
adaptive-webui-19844
summer 3 years ago committed by GitHub
parent
commit
56667e717b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/gui/mainwindow.cpp

6
src/gui/mainwindow.cpp

@ -1953,6 +1953,7 @@ void MainWindow::handleUpdateCheckFinished(ProgramUpdater *updater, const bool i
msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setAttribute(Qt::WA_DeleteOnClose);
msgBox->setAttribute(Qt::WA_ShowWithoutActivating); msgBox->setAttribute(Qt::WA_ShowWithoutActivating);
msgBox->setDefaultButton(QMessageBox::Yes); msgBox->setDefaultButton(QMessageBox::Yes);
msgBox->setWindowModality(Qt::NonModal);
connect(msgBox, &QMessageBox::buttonClicked, this, [msgBox, updater](QAbstractButton *button) connect(msgBox, &QMessageBox::buttonClicked, this, [msgBox, updater](QAbstractButton *button)
{ {
if (msgBox->buttonRole(button) == QMessageBox::YesRole) if (msgBox->buttonRole(button) == QMessageBox::YesRole)
@ -1961,7 +1962,7 @@ void MainWindow::handleUpdateCheckFinished(ProgramUpdater *updater, const bool i
} }
}); });
connect(msgBox, &QDialog::finished, this, cleanup); connect(msgBox, &QDialog::finished, this, cleanup);
msgBox->open(); msgBox->show();
} }
else else
{ {
@ -1971,8 +1972,9 @@ void MainWindow::handleUpdateCheckFinished(ProgramUpdater *updater, const bool i
, tr("No updates available.\nYou are already using the latest version.") , tr("No updates available.\nYou are already using the latest version.")
, QMessageBox::Ok, this}; , QMessageBox::Ok, this};
msgBox->setAttribute(Qt::WA_DeleteOnClose); msgBox->setAttribute(Qt::WA_DeleteOnClose);
msgBox->setWindowModality(Qt::NonModal);
connect(msgBox, &QDialog::finished, this, cleanup); connect(msgBox, &QDialog::finished, this, cleanup);
msgBox->open(); msgBox->show();
} }
else else
{ {

Loading…
Cancel
Save