1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Merge branch 'fix_wizard_dialogs' into 'master'

Fix wizard dialogs

See merge request OpenMW/openmw!1519
This commit is contained in:
psi29a 2022-01-07 14:35:12 +00:00
commit 011a26684a

View File

@ -88,8 +88,9 @@ void Wizard::MainWizard::setupLog()
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(mLogError.arg(file.fileName())); msgBox.setText(mLogError.arg(file.fileName()));
connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection);
msgBox.exec(); msgBox.exec();
return qApp->quit(); return;
} }
addLogText(QString("Started OpenMW Wizard on %1").arg(QDateTime::currentDateTime().toString())); 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.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(mLogError.arg(file.fileName())); msgBox.setText(mLogError.arg(file.fileName()));
connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection);
msgBox.exec(); msgBox.exec();
return qApp->quit(); return;
} }
if (!file.isSequential()) if (!file.isSequential())
@ -148,8 +150,9 @@ void Wizard::MainWizard::setupGameSettings()
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(message.arg(file.fileName())); msgBox.setText(message.arg(file.fileName()));
connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection);
msgBox.exec(); msgBox.exec();
return qApp->quit(); return;
} }
QTextStream stream(&file); QTextStream stream(&file);
stream.setCodec(QTextCodec::codecForName("UTF-8")); stream.setCodec(QTextCodec::codecForName("UTF-8"));
@ -177,8 +180,9 @@ void Wizard::MainWizard::setupGameSettings()
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(message.arg(file.fileName())); msgBox.setText(message.arg(file.fileName()));
connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection);
return qApp->quit(); msgBox.exec();
return;
} }
QTextStream stream(&file); QTextStream stream(&file);
stream.setCodec(QTextCodec::codecForName("UTF-8")); stream.setCodec(QTextCodec::codecForName("UTF-8"));
@ -210,8 +214,9 @@ void Wizard::MainWizard::setupLauncherSettings()
msgBox.setIcon(QMessageBox::Critical); msgBox.setIcon(QMessageBox::Critical);
msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setText(message.arg(file.fileName())); msgBox.setText(message.arg(file.fileName()));
connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection);
msgBox.exec(); msgBox.exec();
return qApp->quit(); return;
} }
QTextStream stream(&file); QTextStream stream(&file);
stream.setCodec(QTextCodec::codecForName("UTF-8")); 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> \ msgBox.setText(tr("<html><head/><body><p><b>Could not create %1</b></p> \
<p>Please make sure you have the right permissions \ <p>Please make sure you have the right permissions \
and try again.</p></body></html>").arg(userPath)); and try again.</p></body></html>").arg(userPath));
connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection);
msgBox.exec(); 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> \ 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 \ <p>Please make sure you have the right permissions \
and try again.</p></body></html>").arg(file.fileName())); and try again.</p></body></html>").arg(file.fileName()));
connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection);
msgBox.exec(); msgBox.exec();
return qApp->quit(); return;
} }
QTextStream stream(&file); 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> \ 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 \ <p>Please make sure you have the right permissions \
and try again.</p></body></html>").arg(file.fileName())); and try again.</p></body></html>").arg(file.fileName()));
connect(&msgBox, &QDialog::finished, qApp, &QApplication::quit, Qt::QueuedConnection);
msgBox.exec(); msgBox.exec();
return qApp->quit(); return;
} }
stream.setDevice(&file); stream.setDevice(&file);