# HG changeset patch # User Raimund Renkert # Date 1395734398 -3600 # Node ID 3349c9596043ded6c3ec0dc9d41652eeb01e9e01 # Parent 252ffe6e27fd3d626bf2cd92da0f13270066ce88 Added commandline arguemnt '--tray' to hide or show the mainwindow. diff -r 252ffe6e27fd -r 3349c9596043 ui/main.cpp --- 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(); }