2015-04-22 19:30:09 +02:00
|
|
|
#include "initiate.h"
|
|
|
|
|
|
|
|
# include "gui/mainwindow.h"
|
|
|
|
|
|
|
|
#include <qtutilities/resources/resources.h>
|
|
|
|
|
|
|
|
#include <QTextCodec>
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QFile>
|
|
|
|
|
|
|
|
namespace QtGui {
|
|
|
|
|
|
|
|
int runWidgetsGui(int argc, char *argv[], const QString &file)
|
|
|
|
{
|
2015-07-27 23:33:54 +02:00
|
|
|
SET_APPLICATION_INFO;
|
2015-04-22 19:30:09 +02:00
|
|
|
// init application
|
|
|
|
QApplication a(argc, argv);
|
2015-07-27 23:33:54 +02:00
|
|
|
LOAD_TRANSLATIONS;
|
2015-04-22 19:30:09 +02:00
|
|
|
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
|
|
|
|
// load the other resources
|
|
|
|
QtUtilitiesResources::init();
|
|
|
|
Theme::setup();
|
|
|
|
// init widgets GUI
|
|
|
|
QtGui::MainWindow w;
|
|
|
|
w.show();
|
|
|
|
if(!file.isEmpty()) {
|
|
|
|
w.openFile(file);
|
|
|
|
}
|
|
|
|
// start event loop
|
|
|
|
int res = a.exec();
|
|
|
|
// cleanup resources
|
|
|
|
QtUtilitiesResources::cleanup();
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|