tageditor/gui/initiate.cpp

49 lines
1.3 KiB
C++
Raw Normal View History

2015-09-06 20:20:00 +02:00
#include "./initiate.h"
#include "./mainwindow.h"
#include "./renamefilesdialog.h"
2015-09-01 20:20:15 +02:00
2015-09-06 20:20:00 +02:00
#include "../application/settings.h"
2015-04-22 19:33:53 +02:00
#include "resources/config.h"
2015-12-05 22:55:05 +01:00
2018-03-07 01:18:01 +01:00
#include <qtutilities/resources/importplugin.h>
2015-09-01 20:20:15 +02:00
#include <qtutilities/resources/qtconfigarguments.h>
2015-04-22 19:33:53 +02:00
#include <qtutilities/resources/resources.h>
2016-08-14 22:49:47 +02:00
#include <qtutilities/settingsdialog/qtsettings.h>
2015-04-22 19:33:53 +02:00
#include <QApplication>
ENABLE_QT_RESOURCES_OF_STATIC_DEPENDENCIES
2015-09-01 20:20:15 +02:00
using namespace ApplicationUtilities;
2015-04-22 19:33:53 +02:00
namespace QtGui {
int runWidgetsGui(int argc, char *argv[], const QtConfigArguments &qtConfigArgs, const QString &path, bool launchRenamingUtility)
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);
2016-08-14 22:49:47 +02:00
Settings::restore();
// apply settings specified via command line args after the settings chosen in the GUI to give the CLI options precedence
2016-10-24 20:15:10 +02:00
Settings::values().qt.apply();
qtConfigArgs.applySettings(Settings::values().qt.hasCustomFont());
2015-09-01 20:20:15 +02:00
LOAD_QT_TRANSLATIONS;
int res;
2018-03-07 01:18:01 +01:00
if (launchRenamingUtility) {
RenameFilesDialog w;
w.show();
res = a.exec();
} else {
MainWindow w;
w.show();
2018-03-07 01:18:01 +01:00
if (!path.isEmpty()) {
w.startParsing(path);
}
res = a.exec();
2015-07-27 23:26:51 +02:00
}
2015-04-22 19:33:53 +02:00
Settings::save();
return res;
}
2018-03-07 01:18:01 +01:00
} // namespace QtGui