summaryrefslogtreecommitdiffstats
path: root/src/pvsgui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pvsgui.cpp')
-rw-r--r--src/pvsgui.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pvsgui.cpp b/src/pvsgui.cpp
index c2ac3cb..5b11104 100644
--- a/src/pvsgui.cpp
+++ b/src/pvsgui.cpp
@@ -438,13 +438,20 @@ void printVersion()
int main(int argc, char *argv[])
{
- QApplication app(argc, argv);
+ QtSingleApplication app(argc, argv);
QStringList args = app.arguments();
app.setQuitOnLastWindowClosed(false);
app.setOrganizationName("openslx");
app.setOrganizationDomain("openslx.org");
app.setApplicationName("pvsgui");
+ // only one instance should be allowed
+ if (app.sendMessage(""))
+ {
+ qDebug("[PVSGUI] ERROR: Already running. Exiting");
+ return 0;
+ }
+
// use system locale as language to translate gui
QTranslator translator;
translator.load(":pvsgui");