diff options
author | Josquin Frei <josquin@genevastage.ch> | 2022-01-07 14:35:11 +0000 |
---|---|---|
committer | psi29a <psi29a@gmail.com> | 2022-01-07 14:35:11 +0000 |
commit | 63a8bc5f9b3fa2280e539abe6c8ebd1a7982f875 (patch) | |
tree | ebf475a6f87a8ea152e7ffee613fc68000c63a38 | |
parent | 23e279c23eb752c311db28a019fc4030b8f5e80a (diff) |
Fix wizard dialogs
-rw-r--r-- | apps/wizard/mainwizard.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/apps/wizard/mainwizard.cpp b/apps/wizard/mainwizard.cpp index d92f5b029c..064f0813d8 100644 --- a/apps/wizard/mainwizard.cpp +++ b/apps/wizard/mainwizard.cpp @@ -88,8 +88,9 @@ void Wizard::MainWizard::setupLog() msgBox.setIcon(QMessageBox::Critical); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setText(mLogError.arg(file.fileName())); + connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection); msgBox.exec(); - return qApp->quit(); + return; } addLogText(QString("Started OpenMW Wizard on %1").arg(QDateTime::currentDateTime().toString())); @@ -110,8 +111,9 @@ void Wizard::MainWizard::addLogText(const QString &text) msgBox.setIcon(QMessageBox::Critical); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setText(mLogError.arg(file.fileName())); + connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection); msgBox.exec(); - return qApp->quit(); + return; } if (!file.isSequential()) @@ -148,8 +150,9 @@ void Wizard::MainWizard::setupGameSettings() msgBox.setIcon(QMessageBox::Critical); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setText(message.arg(file.fileName())); + connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection); msgBox.exec(); - return qApp->quit(); + return; } QTextStream stream(&file); stream.setCodec(QTextCodec::codecForName("UTF-8")); @@ -177,8 +180,9 @@ void Wizard::MainWizard::setupGameSettings() msgBox.setIcon(QMessageBox::Critical); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setText(message.arg(file.fileName())); - - return qApp->quit(); + connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection); + msgBox.exec(); + return; } QTextStream stream(&file); stream.setCodec(QTextCodec::codecForName("UTF-8")); @@ -210,8 +214,9 @@ void Wizard::MainWizard::setupLauncherSettings() msgBox.setIcon(QMessageBox::Critical); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setText(message.arg(file.fileName())); + connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection); msgBox.exec(); - return qApp->quit(); + return; } QTextStream stream(&file); stream.setCodec(QTextCodec::codecForName("UTF-8")); @@ -394,8 +399,9 @@ void Wizard::MainWizard::writeSettings() msgBox.setText(tr("<html><head/><body><p><b>Could not create %1</b></p> \ <p>Please make sure you have the right permissions \ and try again.</p></body></html>").arg(userPath)); + connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection); msgBox.exec(); - return qApp->quit(); + return; } } @@ -411,8 +417,9 @@ void Wizard::MainWizard::writeSettings() msgBox.setText(tr("<html><head/><body><p><b>Could not open %1 for writing</b></p> \ <p>Please make sure you have the right permissions \ and try again.</p></body></html>").arg(file.fileName())); + connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection); msgBox.exec(); - return qApp->quit(); + return; } QTextStream stream(&file); @@ -433,8 +440,9 @@ void Wizard::MainWizard::writeSettings() msgBox.setText(tr("<html><head/><body><p><b>Could not open %1 for writing</b></p> \ <p>Please make sure you have the right permissions \ and try again.</p></body></html>").arg(file.fileName())); + connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection); msgBox.exec(); - return qApp->quit(); + return; } stream.setDevice(&file); |