tageditor/gui/initiate.cpp

52 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"
2019-06-16 15:55:55 +02:00
#include "resources/qtconfig.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
2019-06-10 22:49:46 +02:00
using namespace CppUtilities;
2015-09-01 20:20:15 +02:00
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;
QApplication application(argc, argv);
2016-08-14 22:49:47 +02:00
Settings::restore();
2016-08-14 22:49:47 +02:00
// 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;
QObject::connect(&application, &QCoreApplication::aboutToQuit, &Settings::save);
2018-03-07 01:18:01 +01:00
if (launchRenamingUtility) {
RenameFilesDialog window;
window.show();
return application.exec();
}
MainWindow window;
window.show();
if (!path.isEmpty()) {
window.startParsing(path);
2015-07-27 23:26:51 +02:00
}
return application.exec();
2015-04-22 19:33:53 +02:00
}
2018-03-07 01:18:01 +01:00
} // namespace QtGui