mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 09:53:50 +00:00
Added messageboxes for game execution errors
This commit is contained in:
parent
2131452fac
commit
dbd37a6d58
1 changed files with 35 additions and 6 deletions
|
@ -173,17 +173,46 @@ void MainDialog::play()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QProcess process;
|
QProcess process;
|
||||||
|
QFileInfo info(file);
|
||||||
|
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
// TODO: Throw error!
|
QMessageBox msgBox;
|
||||||
qDebug() << "Could not start process";
|
msgBox.setWindowTitle("Error starting OpenMW");
|
||||||
|
msgBox.setIcon(QMessageBox::Warning);
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
|
msgBox.setText(tr("<br><b>Could not find OpenMW</b><br><br> \
|
||||||
|
The OpenMW application is not found.<br> \
|
||||||
|
Please make sure OpenMW is installed and try again.<br>"));
|
||||||
|
msgBox.exec();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!info.isExecutable()) {
|
||||||
|
QMessageBox msgBox;
|
||||||
|
msgBox.setWindowTitle("Error starting OpenMW");
|
||||||
|
msgBox.setIcon(QMessageBox::Critical);
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
|
msgBox.setText(tr("<br><b>Could not start OpenMW</b><br><br> \
|
||||||
|
The OpenMW application is not executable.<br> \
|
||||||
|
Please make sure you have the right permissions and try again.<br>"));
|
||||||
|
msgBox.exec();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!process.startDetached(game)) {
|
if (!process.startDetached(game)) {
|
||||||
// TODO: Throw error!;
|
QMessageBox msgBox;
|
||||||
qDebug() << "Could not start process";
|
msgBox.setWindowTitle("Error starting OpenMW");
|
||||||
qDebug() << "reason was:" << process.errorString();
|
msgBox.setIcon(QMessageBox::Critical);
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
|
msgBox.setText(tr("<br><b>Could not start OpenMW</b><br><br> \
|
||||||
|
An error occurred while starting OpenMW.<br><br> \
|
||||||
|
Press \"Show Details...\" for more information.<br>"));
|
||||||
|
msgBox.setDetailedText(process.errorString());
|
||||||
|
msgBox.exec();
|
||||||
|
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue