Mercurial > trustbridge
diff ui/main.cpp @ 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 | 5c616934cbe4 |
children | 75f7288ad67b |
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(); }