Unverified Commit 84c30291 authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #7455 from patrickelectric/p

main: Returning critical messsage and an error code when QGC is alredy running
parents f58ce6e3 680ad111
......@@ -19,6 +19,7 @@
#include <QApplication>
#include <QIcon>
#include <QSslSocket>
#include <QMessageBox>
#include <QProcessEnvironment>
#include <QHostAddress>
#include <QUdpSocket>
......@@ -222,7 +223,12 @@ int main(int argc, char *argv[])
#ifndef __mobile__
RunGuard guard("QGroundControlRunGuardKey");
if (!guard.tryToRun()) {
return 0;
// QApplication is necessary to use QMessageBox
QApplication errorApp(argc, argv);
QMessageBox::critical(nullptr, QObject::tr("Error"),
QObject::tr("A second instance of QGroundControl is already running. Please close the other instance and try again.")
);
return -1;
}
#endif
......
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