mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-12 13:13:27 +00:00
Added some useful error messages when things go wrong with Ogre
This commit is contained in:
parent
ccfd011df6
commit
b60bb408fd
@ -189,24 +189,6 @@ void GraphicsPage::setupOgre()
|
|||||||
"openmw", "ogre.cfg"));
|
"openmw", "ogre.cfg"));
|
||||||
file.setFileName(ogreCfg);
|
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
|
try
|
||||||
{
|
{
|
||||||
mOgre = new Ogre::Root(pluginCfg.toStdString(), file.fileName().toStdString(), "./launcherOgre.log");
|
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->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("<br><b>A problem occured while validating the graphics options</b><br><br> \
|
||||||
|
The graphics options could not be saved.<br><br> \
|
||||||
|
Press \"Show Details...\" for more information.<br>"));
|
||||||
|
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
|
// Write the settings to the config file
|
||||||
mOgre->saveConfig();
|
mOgre->saveConfig();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user