changeset 154:3349c9596043

Added commandline arguemnt '--tray' to hide or show the mainwindow.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 25 Mar 2014 08:59:58 +0100
parents 252ffe6e27fd
children c0fdb8d336cf
files ui/main.cpp
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ui/main.cpp	Tue Mar 25 08:58:18 2014 +0100
+++ b/ui/main.cpp	Tue Mar 25 08:59:58 2014 +0100
@@ -28,6 +28,9 @@
 {
     QApplication app (argc, argv);
 
+    QStringList arguments = QApplication::arguments();
+    bool trayMode = arguments.contains("--tray");
+
     if (!QSystemTrayIcon::isSystemTrayAvailable() ||
             !QSystemTrayIcon::supportsMessages()) {
         QMessageBox::critical(0, QString::fromLatin1(APPNAME),
@@ -44,6 +47,9 @@
     QSettings::setDefaultFormat(QSettings::IniFormat);
 
     MainWindow mainWin;
+    if (!trayMode) {
+        mainWin.show();
+    }
 
     return app.exec();
 }

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