Merge branch 'dev' into gui_qml

This commit is contained in:
pokamest 2021-08-19 01:51:02 +03:00
commit febf9cfafb
144 changed files with 1200222 additions and 67592 deletions

View file

@ -13,9 +13,13 @@
#include "debug.h"
#include "defines.h"
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
#define QAPPLICATION_CLASS QGuiApplication
#include "singleapplication.h"
#undef QAPPLICATION_CLASS
#endif
#ifdef Q_OS_WIN
#include "Windows.h"
@ -39,6 +43,7 @@ int main(int argc, char *argv[])
AllowSetForegroundWindow(ASFW_ANY);
#endif
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
SingleApplication app(argc, argv, true, SingleApplication::Mode::User | SingleApplication::Mode::SecondaryNotification);
if (!app.isPrimary()) {
@ -47,6 +52,10 @@ int main(int argc, char *argv[])
});
return app.exec();
}
#else
QApplication app(argc, argv);
#endif
#ifdef Q_OS_WIN
AllowSetForegroundWindow(0);
#endif
@ -96,5 +105,26 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("UiLogic", &uiLogic);
engine.load(url);
// TODO - fix
//#ifdef Q_OS_WIN
// if (parser.isSet("a")) mainWindow.showOnStartup();
// else mainWindow.show();
//#else
// mainWindow.showOnStartup();
//#endif
// TODO - fix
//#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
// if (app.isPrimary()) {
// QObject::connect(&app, &SingleApplication::instanceStarted, &mainWindow, [&](){
// qDebug() << "Secondary instance started, showing this window instead";
// mainWindow.show();
// mainWindow.showNormal();
// mainWindow.raise();
// });
// }
//#endif
return app.exec();
}