2015-04-22 19:33:53 +02:00
|
|
|
#include "initiate.h"
|
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "application/settings.h"
|
|
|
|
|
|
|
|
#include <qtutilities/resources/resources.h>
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
namespace QtGui {
|
|
|
|
|
2015-07-27 23:26:51 +02:00
|
|
|
int runWidgetsGui(int argc, char *argv[], const QString &path)
|
2015-04-22 19:33:53 +02:00
|
|
|
{
|
2015-08-25 19:09:26 +02:00
|
|
|
SET_QT_APPLICATION_INFO;
|
2015-04-22 19:33:53 +02:00
|
|
|
QApplication a(argc, argv);
|
2015-08-25 19:09:26 +02:00
|
|
|
LOAD_QT_TRANSLATIONS;
|
2015-04-22 19:33:53 +02:00
|
|
|
// load resources needed by classes of qtutilities
|
|
|
|
QtUtilitiesResources::init();
|
|
|
|
Theme::setup();
|
|
|
|
Settings::restore();
|
|
|
|
MainWindow w;
|
|
|
|
w.show();
|
2015-07-27 23:26:51 +02:00
|
|
|
if(!path.isEmpty()) {
|
|
|
|
w.startParsing(path, true);
|
|
|
|
}
|
2015-04-22 19:33:53 +02:00
|
|
|
int res = a.exec();
|
|
|
|
Settings::save();
|
|
|
|
// cleanup resources
|
|
|
|
QtUtilitiesResources::cleanup();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|