mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 16:20:21 +00:00
Changed error handling for Ogre config and made the launcher exit cleanly
This commit is contained in:
parent
283a9183d0
commit
5dbbc5bb7b
@ -183,7 +183,7 @@ void GraphicsPage::setupOgre()
|
|||||||
|
|
||||||
qCritical("Error creating Ogre::Root, the error reported was:\n %s", qPrintable(ogreError));
|
qCritical("Error creating Ogre::Root, the error reported was:\n %s", qPrintable(ogreError));
|
||||||
|
|
||||||
std::exit(1);
|
QApplication::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the available renderers and put them in the combobox
|
// Get the available renderers and put them in the combobox
|
||||||
@ -216,7 +216,7 @@ void GraphicsPage::setupOgre()
|
|||||||
Please make sure the plugins.cfg file exists and contains a valid rendering plugin.<br>"));
|
Please make sure the plugins.cfg file exists and contains a valid rendering plugin.<br>"));
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
|
|
||||||
std::exit(1);
|
QApplication::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now fill the GUI elements
|
// Now fill the GUI elements
|
||||||
@ -388,7 +388,7 @@ void GraphicsPage::writeConfig()
|
|||||||
|
|
||||||
if (!ogreError.isEmpty()) {
|
if (!ogreError.isEmpty()) {
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setWindowTitle("Error validating configuration");
|
msgBox.setWindowTitle("Error validating Ogre configuration");
|
||||||
msgBox.setIcon(QMessageBox::Critical);
|
msgBox.setIcon(QMessageBox::Critical);
|
||||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
msgBox.setText(tr("<br><b>A problem occured while validating the graphics options</b><br><br> \
|
msgBox.setText(tr("<br><b>A problem occured while validating the graphics options</b><br><br> \
|
||||||
@ -401,11 +401,33 @@ void GraphicsPage::writeConfig()
|
|||||||
|
|
||||||
qCritical("Error validating configuration");
|
qCritical("Error validating configuration");
|
||||||
|
|
||||||
std::exit(1);
|
QApplication::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the settings to the config file
|
// Write the settings to the config file
|
||||||
mOgre->saveConfig();
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mOgre->saveConfig();
|
||||||
|
}
|
||||||
|
catch(Ogre::Exception &ex)
|
||||||
|
{
|
||||||
|
QString ogreError = QString::fromStdString(ex.getFullDescription().c_str());
|
||||||
|
QMessageBox msgBox;
|
||||||
|
msgBox.setWindowTitle("Error writing Ogre configuration file");
|
||||||
|
msgBox.setIcon(QMessageBox::Critical);
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
|
msgBox.setText(tr("<br><b>Could not write the graphics configuration</b><br><br> \
|
||||||
|
Please make sure you have the right permissions and try again.<br><br> \
|
||||||
|
Press \"Show Details...\" for more information.<br>"));
|
||||||
|
msgBox.setDetailedText(ogreError);
|
||||||
|
msgBox.exec();
|
||||||
|
|
||||||
|
qCritical("Error saving Ogre configuration, the error reported was:\n %s", qPrintable(ogreError));
|
||||||
|
|
||||||
|
QApplication::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,7 +340,7 @@ void MainDialog::writeConfig()
|
|||||||
Please make sure you have the right permissions and try again.<br>").arg(file.fileName()));
|
Please make sure you have the right permissions and try again.<br>").arg(file.fileName()));
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
|
|
||||||
std::exit(1);
|
QApplication::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
@ -366,7 +366,7 @@ void MainDialog::writeConfig()
|
|||||||
Please make sure you have the right permissions and try again.<br>").arg(file.fileName()));
|
Please make sure you have the right permissions and try again.<br>").arg(file.fileName()));
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
|
|
||||||
std::exit(1);;
|
QApplication::exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
file.write(buffer);
|
file.write(buffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user