Mercurial > trustbridge
comparison ui/main.cpp @ 158:fb3b2d77518f
Merged
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Tue, 25 Mar 2014 09:30:51 +0100 |
parents | 3349c9596043 |
children | 75f7288ad67b |
comparison
equal
deleted
inserted
replaced
157:a46a4b443410 | 158:fb3b2d77518f |
---|---|
26 | 26 |
27 int main(int argc, char **argv) | 27 int main(int argc, char **argv) |
28 { | 28 { |
29 QApplication app (argc, argv); | 29 QApplication app (argc, argv); |
30 | 30 |
31 QStringList arguments = QApplication::arguments(); | |
32 bool trayMode = arguments.contains("--tray"); | |
33 | |
31 if (!QSystemTrayIcon::isSystemTrayAvailable() || | 34 if (!QSystemTrayIcon::isSystemTrayAvailable() || |
32 !QSystemTrayIcon::supportsMessages()) { | 35 !QSystemTrayIcon::supportsMessages()) { |
33 QMessageBox::critical(0, QString::fromLatin1(APPNAME), | 36 QMessageBox::critical(0, QString::fromLatin1(APPNAME), |
34 QObject::tr("Couldn't detect any system tray " | 37 QObject::tr("Couldn't detect any system tray " |
35 "on this system. This software can only " | 38 "on this system. This software can only " |
42 QApplication::setApplicationName(QString::fromLatin1(APPNAME)); | 45 QApplication::setApplicationName(QString::fromLatin1(APPNAME)); |
43 QApplication::setApplicationVersion(QString::fromLatin1(VERSION)); | 46 QApplication::setApplicationVersion(QString::fromLatin1(VERSION)); |
44 QSettings::setDefaultFormat(QSettings::IniFormat); | 47 QSettings::setDefaultFormat(QSettings::IniFormat); |
45 | 48 |
46 MainWindow mainWin; | 49 MainWindow mainWin; |
50 if (!trayMode) { | |
51 mainWin.show(); | |
52 } | |
47 | 53 |
48 return app.exec(); | 54 return app.exec(); |
49 } | 55 } |