-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (24 loc) · 703 Bytes
/
Copy pathmain.cpp
File metadata and controls
30 lines (24 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <QApplication>
#include <QFile>
#include <QSharedMemory>
#include <QMessageBox>
#include <controllers/runguard.h>
#include <controllers/controller.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
RunGuard guard( "2c7d2328-cdb5-416d-9a5d-2d8a2ab4b87b" );
if ( !guard.tryToRun() )
{
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Warning);
msgBox.setWindowTitle("Genius is already running");
msgBox.setText( QObject::tr("Cannot run multiple instances.\nAnother instance of Genius is already running.") );
msgBox.exec();
return 0;
}
a.setQuitOnLastWindowClosed(false);
Controller controller;
controller.start();
return a.exec();
}