2014-06-18 23:44:46 +00:00
|
|
|
#include "mainscreen.h"
|
|
|
|
#include <QApplication>
|
2014-06-27 22:22:44 +00:00
|
|
|
#include <QTranslator>
|
2014-06-28 03:36:10 +00:00
|
|
|
#include <QDebug>
|
2014-09-08 17:07:42 +00:00
|
|
|
#include "../src/appDatabase/savedata.h"
|
2014-09-16 21:08:29 +00:00
|
|
|
#include "../src/jce_logger.h"
|
2014-09-08 17:07:42 +00:00
|
|
|
|
2014-06-18 23:44:46 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2014-09-17 13:14:05 +00:00
|
|
|
#ifdef QT_DEBUG
|
|
|
|
qDebug() << "Running a debug build";
|
|
|
|
#else
|
|
|
|
qDebug() << "Running a release build";
|
|
|
|
qInstallMessageHandler(jce_logger::customMessageHandler);
|
|
|
|
#endif
|
|
|
|
|
2014-09-16 21:08:29 +00:00
|
|
|
qDebug() << "Start : JCE Manager Launched" << Q_FUNC_INFO;
|
2014-06-18 23:44:46 +00:00
|
|
|
QApplication a(argc, argv);
|
2014-06-28 03:36:10 +00:00
|
|
|
QTranslator translator;
|
2014-09-08 17:07:42 +00:00
|
|
|
QString loco;
|
|
|
|
SaveData data;
|
|
|
|
loco = data.getLocal();
|
|
|
|
if(loco == "default")
|
|
|
|
{
|
|
|
|
QString locale = QLocale::system().name();
|
|
|
|
translator.load("jce_"+locale , a.applicationDirPath());
|
2014-09-16 21:08:29 +00:00
|
|
|
qDebug() << "Local : Default Local Loaded";
|
|
|
|
}else if(loco == "he"){
|
2014-09-08 17:07:42 +00:00
|
|
|
translator.load("jce_he" , a.applicationDirPath());
|
2014-09-16 21:08:29 +00:00
|
|
|
qDebug() << "Local : Hebrew Local Loaded";
|
|
|
|
}else{
|
2014-09-08 17:07:42 +00:00
|
|
|
translator.load("jce_en" , a.applicationDirPath());
|
2014-09-16 21:08:29 +00:00
|
|
|
qDebug() << "Local : English Local Loaded";
|
|
|
|
}
|
2014-06-27 22:22:44 +00:00
|
|
|
a.installTranslator(&translator);
|
2014-06-18 23:44:46 +00:00
|
|
|
MainScreen w;
|
|
|
|
w.show();
|
|
|
|
|
2014-09-16 21:08:29 +00:00
|
|
|
int returnCode = a.exec();
|
|
|
|
if(returnCode == 0)
|
|
|
|
qDebug() << "End : JCE Manager Ended Successfully With A Return Code: " << returnCode;
|
|
|
|
else
|
|
|
|
qCritical() << "End : JCE Manager Ended Unusccessfully With A Return Code: " << returnCode;
|
|
|
|
return returnCode;
|
2014-06-18 23:44:46 +00:00
|
|
|
}
|