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-07-30 13:40:58 +02:00
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QSettings>
|
2018-07-30 19:37:19 +02:00
|
|
|
#include <QTranslator>
|
|
|
|
#include <QLibraryInfo>
|
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-17 10:19:41 +02:00
|
|
|
// Q_INIT_RESOURCE(application);
|
2018-07-14 14:03:35 +02:00
|
|
|
|
2018-07-24 15:37:19 +02:00
|
|
|
// Set the locale to german, so that currency is correct
|
2018-07-30 13:40:58 +02:00
|
|
|
// std::locale german("de_DE.utf-8");
|
2018-07-24 15:37:19 +02:00
|
|
|
std::locale myLocale("");
|
|
|
|
std::locale::global(myLocale);
|
|
|
|
|
2018-07-14 14:03:35 +02:00
|
|
|
QApplication kimaApp{argc, argv};
|
|
|
|
|
2018-07-17 08:25:41 +02:00
|
|
|
QCoreApplication::setOrganizationName("RustySoft");
|
|
|
|
QCoreApplication::setOrganizationDomain("rustysoft.de");
|
|
|
|
QCoreApplication::setApplicationName("KIMA2");
|
|
|
|
|
2018-07-30 19:37:19 +02:00
|
|
|
QTranslator qTranslator;
|
|
|
|
QLocale german(QLocale::German);
|
|
|
|
#ifdef __linux__
|
|
|
|
qTranslator.load("qt_" + german.name(),
|
|
|
|
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
|
|
|
#endif
|
|
|
|
#ifdef _WIN32
|
|
|
|
qtTranslator.load("qt_" + german.name(),
|
|
|
|
QApplication::applicationDirPath() + QDir::separator() + "translations");
|
|
|
|
#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
|
|
|
}
|