Commit ae4b456c authored by Leander Schulten's avatar Leander Schulten

UX: You can start the Lichtsteuerung only once per computer. On windows you...

UX: You can start the Lichtsteuerung only once per computer. On windows you will see a MessageBox with a error message if the Lichtsteuerung is already running.
parent ac289cd4
Pipeline #191853 passed with stage
in 4 minutes and 45 seconds
......@@ -44,6 +44,7 @@
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QQuickView>
#include <QSharedMemory>
#include <QSslSocket>
#include <QTimer>
#include <chrono>
......@@ -51,12 +52,23 @@
#include <id.h>
#include <limits>
#ifdef Q_OS_WIN
#include <winuser.h>
#endif
#ifdef DrMinGW
#include "exchndl.h"
#include <QNetworkReply>
#endif
int main(int argc, char *argv[]) {
QSharedMemory mem(QStringLiteral("Lichteuerung Leander Schulten"));
if (!mem.create(1)) {
#ifdef Q_OS_WIN
MessageBoxA(nullptr, "The Lichtsteuerung is already running on this computer.", nullptr, MB_OK);
#endif
return 0;
}
error::initErrorHandler();
#ifdef DrMinGW
ExcHndlInit();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment