aheinecke@0: #include "mainwindow.h" aheinecke@0: aheinecke@0: #include aheinecke@0: #include aheinecke@0: #include aheinecke@0: #include aheinecke@17: #include aheinecke@0: aheinecke@16: #ifndef VERSION aheinecke@16: #define VERSION "0.0.1" aheinecke@16: #endif aheinecke@16: aheinecke@16: #ifndef APPNAME aheinecke@16: #define APPNAME "m13ui" aheinecke@16: #endif aheinecke@16: aheinecke@16: #ifndef ORGANIZATION aheinecke@16: #define ORGANIZATION "m13org" aheinecke@16: #endif aheinecke@0: aheinecke@0: #ifdef Q_OS_WIN aheinecke@0: Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) aheinecke@0: #else aheinecke@0: Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) aheinecke@0: #endif aheinecke@0: aheinecke@0: int main(int argc, char **argv) aheinecke@0: { aheinecke@0: QApplication app (argc, argv); aheinecke@0: rrenkert@154: QStringList arguments = QApplication::arguments(); rrenkert@154: bool trayMode = arguments.contains("--tray"); rrenkert@154: aheinecke@73: if (!QSystemTrayIcon::isSystemTrayAvailable() || aheinecke@73: !QSystemTrayIcon::supportsMessages()) { aheinecke@16: QMessageBox::critical(0, QString::fromLatin1(APPNAME), aheinecke@0: QObject::tr("Couldn't detect any system tray " aheinecke@0: "on this system. This software can only " aheinecke@0: "be used in a desktop environment.")); aheinecke@0: return 1; aheinecke@0: } aheinecke@16: aheinecke@0: QApplication::setQuitOnLastWindowClosed(false); aheinecke@16: QApplication::setOrganizationName(QString::fromLatin1(ORGANIZATION)); aheinecke@16: QApplication::setApplicationName(QString::fromLatin1(APPNAME)); aheinecke@16: QApplication::setApplicationVersion(QString::fromLatin1(VERSION)); aheinecke@17: QSettings::setDefaultFormat(QSettings::IniFormat); aheinecke@0: aheinecke@365: MainWindow mainWin(trayMode); aheinecke@0: aheinecke@0: return app.exec(); aheinecke@0: }