tageditor/gui/initiate.cpp

33 lines
680 B
C++
Raw Normal View History

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-07-27 23:26:51 +02:00
SET_APPLICATION_INFO;
2015-04-22 19:33:53 +02:00
QApplication a(argc, argv);
2015-07-27 23:26:51 +02:00
LOAD_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;
}
}