diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp
index 87d955271..dc88b3ee8 100644
--- a/apps/launcher/graphicspage.cpp
+++ b/apps/launcher/graphicspage.cpp
@@ -189,24 +189,6 @@ void GraphicsPage::setupOgre()
"openmw", "ogre.cfg"));
file.setFileName(ogreCfg);
- /* Not yet supported by OpenMW as it only seems to look in the user directory for ogre.cfg
- QString ogreCfg = "./ogre.cfg";
- file.setFileName(ogreCfg);
-
- if (!file.exists()) {
- file.setFileName(QString::fromStdString(Files::getPath(Files::Path_ConfigUser,
- "openmw", "ogre.cfg")));
- }
-
- if (!file.exists()) {
- file.setFileName(QString::fromStdString(Files::getPath(Files::Path_ConfigGlobal,
- "openmw", "ogre.cfg")));
- }
-
- if (!file.exists()) {
- file.setFileName(ogreCfg);
- }*/
-
try
{
mOgre = new Ogre::Root(pluginCfg.toStdString(), file.fileName().toStdString(), "./launcherOgre.log");
@@ -428,7 +410,27 @@ void GraphicsPage::writeConfig()
mOpenGLRenderSystem->setConfigOption("Video Mode", mOGLResolutionComboBox->currentText().toStdString());
}
- //mOpenGLRenderSystem->validateConfigOptions();
+ // Now we validate the options
+ QString ogreError = QString::fromStdString(mSelectedRenderSystem->validateConfigOptions());
+
+ if (!ogreError.isEmpty()) {
+ QMessageBox msgBox;
+ msgBox.setWindowTitle("Error validating configuration");
+ msgBox.setIcon(QMessageBox::Critical);
+ msgBox.setStandardButtons(QMessageBox::Ok);
+ msgBox.setText(tr("
A problem occured while validating the graphics options
\
+ The graphics options could not be saved.
\
+ Press \"Show Details...\" for more information.
"));
+ msgBox.setDetailedText(ogreError);
+ msgBox.exec();
+
+ Ogre::LogManager::getSingletonPtr()->logMessage( "Caught exception in validateConfigOptions");
+
+ qCritical("Error validating configuration");
+
+ std::exit(1);
+ }
+
// Write the settings to the config file
mOgre->saveConfig();