comparison ui/main.cpp @ 612:2ea11a95aa4a

Bail if the user is already running the application.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 18 Jun 2014 15:09:42 +0200
parents 077b4342d69b
children edf269b6e499
comparison
equal deleted inserted replaced
611:957b28a97959 612:2ea11a95aa4a
4 * This file is Free Software under the GNU GPL (v>=2) 4 * This file is Free Software under the GNU GPL (v>=2)
5 * and comes with ABSOLUTELY NO WARRANTY! 5 * and comes with ABSOLUTELY NO WARRANTY!
6 * See LICENSE.txt for details. 6 * See LICENSE.txt for details.
7 */ 7 */
8 #include "mainwindow.h" 8 #include "mainwindow.h"
9 #include "processhelp.h"
9 10
10 #include <QApplication> 11 #include <QApplication>
11 #include <QSystemTrayIcon> 12 #include <QSystemTrayIcon>
12 #include <QtPlugin> 13 #include <QtPlugin>
13 #include <QMessageBox> 14 #include <QMessageBox>
53 54
54 if (trayMode && !autoStart) { 55 if (trayMode && !autoStart) {
55 return 0; 56 return 0;
56 } 57 }
57 58
59 if (ProcessHelp::otherProcessesExist(APPNAME)) {
60 qDebug() << "Another " << APPNAME << " process is already running. Exiting.";
61 ProcessHelp::activateWindowForProcess(APPNAME);
62 return 0;
63 }
64
58 QTranslator translator; 65 QTranslator translator;
59 if (QLocale::system().name() == "C") { 66 if (QLocale::system().name() == "C") {
60 /* Useful for testing / development as the primary target is german */ 67 /* Useful for testing / development as the primary target is german */
61 translator.load(":/l10n/trustbridge_de_DE"); 68 translator.load(":/l10n/trustbridge_de_DE");
62 } else { 69 } else {

http://wald.intevation.org/projects/trustbridge/