kima2/src/gui/kima2.cpp

46 lines
1.3 KiB
C++
Raw Normal View History

2018-07-14 14:03:35 +02:00
#include "mainwindow.h"
2018-07-06 10:54:22 +02:00
2018-07-30 19:37:19 +02:00
#include "settingsdialog.h"
2018-07-14 14:03:35 +02:00
#include <QApplication>
2018-08-07 20:39:15 +02:00
#include <QDir>
#include <QLibraryInfo>
2018-07-30 13:40:58 +02:00
#include <QMessageBox>
#include <QSettings>
#include <QSharedMemory>
#include <QStyleFactory>
2022-07-07 17:16:51 +02:00
#include <QTranslator>
2019-04-10 12:04:18 +02:00
#include <singleapplication.h>
2022-07-07 17:16:51 +02:00
#include <stdexcept>
2018-07-06 10:54:22 +02:00
2022-07-07 17:16:51 +02:00
int main(int argc, char *argv[])
2018-07-06 10:54:22 +02:00
{
2019-04-10 12:04:18 +02:00
SingleApplication kimaApp(argc, argv);
2018-07-14 14:03:35 +02:00
2018-08-07 20:39:15 +02:00
// QCoreApplication::setOrganizationName("RustySoft");
2018-07-17 08:25:41 +02:00
QCoreApplication::setOrganizationDomain("rustysoft.de");
2018-08-07 20:39:15 +02:00
QCoreApplication::setApplicationName("kima2");
2018-07-17 08:25:41 +02:00
2022-09-26 20:47:23 +02:00
QTranslator qtTranslator;
if (qtTranslator.load(QLocale::system(), u"qtbase"_qs, u"_"_qs,
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
kimaApp.installTranslator(&qtTranslator);
2022-07-07 17:16:51 +02:00
}
2018-07-30 19:37:19 +02:00
2018-07-30 13:40:58 +02:00
QSettings settings{};
while (!settings.contains("global/cashPointNo")) {
QMessageBox(QMessageBox::Icon::Information, "Erster Start von KIMA2",
"Es wurden keine Einstellungen gefunden. Vermutlich starteten Sie KIMA2 zum "
"ersten Mal. Bitte legen Sie nun die Einstellungen fest.",
2018-07-30 19:37:19 +02:00
QMessageBox::StandardButton::Ok)
.exec();
2018-07-30 13:40:58 +02:00
SettingsDialog().exec();
}
2018-07-14 15:54:11 +02:00
auto mainWin = std::make_unique<MainWindow>();
mainWin->show();
2018-07-09 13:03:43 +02:00
2018-07-14 14:03:35 +02:00
return kimaApp.exec();
2018-07-06 10:54:22 +02:00
}