mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-03 23:56:43 +00:00 
			
		
		
		
	Merge remote branch 'pvdk/newlauncher' into newlauncher
This commit is contained in:
		
						commit
						b3ad3d0778
					
				
					 2 changed files with 14 additions and 8 deletions
				
			
		| 
						 | 
					@ -165,7 +165,6 @@ void GraphicsPage::setupConfig()
 | 
				
			||||||
void GraphicsPage::setupOgre()
 | 
					void GraphicsPage::setupOgre()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    QString pluginCfg = "./plugins.cfg";
 | 
					    QString pluginCfg = "./plugins.cfg";
 | 
				
			||||||
 | 
					 | 
				
			||||||
    QFile file(pluginCfg);
 | 
					    QFile file(pluginCfg);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!file.exists()) {
 | 
					    if (!file.exists()) {
 | 
				
			||||||
| 
						 | 
					@ -173,6 +172,19 @@ void GraphicsPage::setupOgre()
 | 
				
			||||||
                                                          "openmw", "plugins.cfg"));
 | 
					                                                          "openmw", "plugins.cfg"));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					    // Reopen the file from user directory
 | 
				
			||||||
 | 
					    file.setFileName(pluginCfg);
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    if (!file.exists()) {
 | 
				
			||||||
 | 
					        // There's no plugins.cfg in the user directory, use global directory
 | 
				
			||||||
 | 
					        pluginCfg = QString::fromStdString(Files::getPath(Files::Path_ConfigGlobal,
 | 
				
			||||||
 | 
					                                                          "openmw", "plugins.cfg"));   
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    // Create a log manager so we can surpress debug text to stdout/stderr
 | 
				
			||||||
 | 
					    Ogre::LogManager* logMgr = OGRE_NEW Ogre::LogManager;
 | 
				
			||||||
 | 
					    logMgr->createLog("launcherOgre.log", true, false, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try
 | 
					    try
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        mOgre = new Ogre::Root(pluginCfg.toStdString());
 | 
					        mOgre = new Ogre::Root(pluginCfg.toStdString());
 | 
				
			||||||
| 
						 | 
					@ -190,8 +202,7 @@ void GraphicsPage::setupOgre()
 | 
				
			||||||
        msgBox.setDetailedText(ogreError);
 | 
					        msgBox.setDetailedText(ogreError);
 | 
				
			||||||
        msgBox.exec();
 | 
					        msgBox.exec();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        QString error = QString("Error creating Ogre::Root, the error reported was: %0").arg(ogreError);
 | 
					        qCritical("Error creating Ogre::Root, the error reported was:\n %s", qPrintable(ogreError));
 | 
				
			||||||
        qCritical(error.toAscii());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        std::exit(1);
 | 
					        std::exit(1);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,6 @@
 | 
				
			||||||
#include <QApplication>
 | 
					#include <QApplication>
 | 
				
			||||||
#include <QDir>
 | 
					#include <QDir>
 | 
				
			||||||
#include <QFile>
 | 
					#include <QFile>
 | 
				
			||||||
#include <QDebug>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "maindialog.hpp"
 | 
					#include "maindialog.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,10 +24,6 @@ int main(int argc, char *argv[])
 | 
				
			||||||
    // Load the stylesheet
 | 
					    // Load the stylesheet
 | 
				
			||||||
    QFile file("./launcher.qss");
 | 
					    QFile file("./launcher.qss");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QFileInfo fi(file);
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    qDebug() << "Stylesheet path is: " << fi.absoluteFilePath();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    file.open(QFile::ReadOnly);
 | 
					    file.open(QFile::ReadOnly);
 | 
				
			||||||
    QString styleSheet = QLatin1String(file.readAll());
 | 
					    QString styleSheet = QLatin1String(file.readAll());
 | 
				
			||||||
    app.setStyleSheet(styleSheet);
 | 
					    app.setStyleSheet(styleSheet);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue