Mercurial > trustbridge
comparison ui/main.cpp @ 16:225a5ec20dad
Use QSettings and manage downloader from mainwindow.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 19 Feb 2014 10:45:29 +0000 |
parents | cb0cde2c5eb9 |
children | c12825a651ed |
comparison
equal
deleted
inserted
replaced
15:95e1b6edf2fc | 16:225a5ec20dad |
---|---|
3 #include <QApplication> | 3 #include <QApplication> |
4 #include <QSystemTrayIcon> | 4 #include <QSystemTrayIcon> |
5 #include <QtPlugin> | 5 #include <QtPlugin> |
6 #include <QMessageBox> | 6 #include <QMessageBox> |
7 | 7 |
8 #ifndef VERSION | |
9 #define VERSION "0.0.1" | |
10 #endif | |
11 | |
12 #ifndef APPNAME | |
13 #define APPNAME "m13ui" | |
14 #endif | |
15 | |
16 #ifndef ORGANIZATION | |
17 #define ORGANIZATION "m13org" | |
18 #endif | |
8 | 19 |
9 #ifdef Q_OS_WIN | 20 #ifdef Q_OS_WIN |
10 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) | 21 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) |
11 #else | 22 #else |
12 Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) | 23 Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) |
15 int main(int argc, char **argv) | 26 int main(int argc, char **argv) |
16 { | 27 { |
17 QApplication app (argc, argv); | 28 QApplication app (argc, argv); |
18 | 29 |
19 if (!QSystemTrayIcon::isSystemTrayAvailable()) { | 30 if (!QSystemTrayIcon::isSystemTrayAvailable()) { |
20 QMessageBox::critical(0, QObject::tr("m13ui"), | 31 QMessageBox::critical(0, QString::fromLatin1(APPNAME), |
21 QObject::tr("Couldn't detect any system tray " | 32 QObject::tr("Couldn't detect any system tray " |
22 "on this system. This software can only " | 33 "on this system. This software can only " |
23 "be used in a desktop environment.")); | 34 "be used in a desktop environment.")); |
24 return 1; | 35 return 1; |
25 } | 36 } |
37 | |
26 QApplication::setQuitOnLastWindowClosed(false); | 38 QApplication::setQuitOnLastWindowClosed(false); |
39 QApplication::setOrganizationName(QString::fromLatin1(ORGANIZATION)); | |
40 QApplication::setApplicationName(QString::fromLatin1(APPNAME)); | |
41 QApplication::setApplicationVersion(QString::fromLatin1(VERSION)); | |
27 | 42 |
28 MainWindow mainWin; | 43 MainWindow mainWin; |
29 mainWin.show(); | 44 mainWin.show(); |
30 | 45 |
31 return app.exec(); | 46 return app.exec(); |