diff options
author | Ken Moore <ken@pcbsd.org> | 2014-10-03 14:29:52 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2014-10-03 14:29:52 -0400 |
commit | ca23572c22812c94672905eecdee5f8c3431ffaa (patch) | |
tree | d456b836e544a74bc7709edb5bc17368f13b235a /lumina-open/main.cpp | |
parent | Large update for the lumina-fm: (diff) | |
download | lumina-ca23572c22812c94672905eecdee5f8c3431ffaa.tar.gz lumina-ca23572c22812c94672905eecdee5f8c3431ffaa.tar.bz2 lumina-ca23572c22812c94672905eecdee5f8c3431ffaa.zip |
Make sure to initialize the QApplication before trying to show the error box in lumina-open (if the application that got started crashed).
Diffstat (limited to 'lumina-open/main.cpp')
-rw-r--r-- | lumina-open/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp index 354fb9d3..339446b9 100644 --- a/lumina-open/main.cpp +++ b/lumina-open/main.cpp @@ -317,6 +317,17 @@ int main(int argc, char **argv){ int retcode = p->exitCode();*/ if(retcode!=0){ qDebug() << "[lumina-open] Application Error:" << retcode; + //Setup the application + QApplication App(argc, argv); + QTranslator translator; + QLocale mylocale; + QString langCode = mylocale.name(); + + if(!QFile::exists(PREFIX + "/share/Lumina-DE/i18n/lumina-open_" + langCode + ".qm") ){ + langCode.truncate( langCode.indexOf("_") ); + } + translator.load( QString("lumina-open_") + langCode, PREFIX + "/share/Lumina-DE/i18n/" ); + App.installTranslator( &translator ); QMessageBox::critical(0,QObject::tr("Application Error"), QObject::tr("The following application experienced an error and needed to close:")+"\n\n"+cmd); } return retcode; |