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>
|
2018-07-30 19:37:19 +02:00
|
|
|
#include <QTranslator>
|
2018-07-06 10:54:22 +02:00
|
|
|
|
2018-07-14 14:03:35 +02:00
|
|
|
int main(int argc, char* argv[])
|
2018-07-06 10:54:22 +02:00
|
|
|
{
|
2018-07-14 14:03:35 +02:00
|
|
|
QApplication kimaApp{argc, argv};
|
|
|
|
|
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
|
|
|
|
2018-07-30 19:37:19 +02:00
|
|
|
QTranslator qTranslator;
|
|
|
|
QLocale german(QLocale::German);
|
|
|
|
#ifdef __linux__
|
2018-08-07 20:39:15 +02:00
|
|
|
qTranslator.load("qt_" + german.name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
2018-07-30 19:37:19 +02:00
|
|
|
#endif
|
|
|
|
#ifdef _WIN32
|
2018-08-01 09:37:11 +02:00
|
|
|
qTranslator.load("qt_" + german.name(),
|
2018-08-07 20:39:15 +02:00
|
|
|
QApplication::applicationDirPath() + QDir::separator() + "translations");
|
2018-07-30 19:37:19 +02:00
|
|
|
#endif
|
|
|
|
kimaApp.installTranslator(&qTranslator);
|
|
|
|
|
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
|
|
|
}
|