Mercurial > trustbridge
comparison ui/administrator.cpp @ 829:294d76174102
(issue5) Add --version to trustbridge and trustbridge-admin
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 24 Jul 2014 11:41:52 +0200 |
parents | 09077eca0b0d |
children | 170b13ea05ee |
comparison
equal
deleted
inserted
replaced
828:95e14add5c50 | 829:294d76174102 |
---|---|
24 | 24 |
25 #ifndef ORGANIZATION | 25 #ifndef ORGANIZATION |
26 #define ORGANIZATION "BSI" | 26 #define ORGANIZATION "BSI" |
27 #endif | 27 #endif |
28 | 28 |
29 #define COPYRIGHT "Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik \n" \ | |
30 "Software engineering by Intevation GmbH \n\n" \ | |
31 "This file is Free Software under the GNU GPL (v>=2)\n" \ | |
32 "and comes with ABSOLUTELY NO WARRANTY!\n" | |
33 | |
29 #ifdef Q_OS_WIN | 34 #ifdef Q_OS_WIN |
30 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) | 35 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) |
31 #else | 36 #else |
32 Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) | 37 Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) |
33 #endif | 38 #endif |
41 QApplication::setOrganizationName(QString::fromLatin1(ORGANIZATION)); | 46 QApplication::setOrganizationName(QString::fromLatin1(ORGANIZATION)); |
42 QApplication::setApplicationName(QString::fromLatin1(APPNAME)); | 47 QApplication::setApplicationName(QString::fromLatin1(APPNAME)); |
43 QApplication::setApplicationVersion(QString::fromLatin1(VERSION)); | 48 QApplication::setApplicationVersion(QString::fromLatin1(VERSION)); |
44 QSettings::setDefaultFormat(QSettings::IniFormat); | 49 QSettings::setDefaultFormat(QSettings::IniFormat); |
45 | 50 |
51 if (QApplication::arguments().contains("--version")) { | |
52 printf (APPNAME " Version: %s \n", | |
53 QApplication::applicationVersion().toLocal8Bit().constData()); | |
54 printf (COPYRIGHT); | |
55 return 0; | |
56 } | |
57 | |
46 QTranslator translator; | 58 QTranslator translator; |
47 if (QLocale::system().name() == "C") { | 59 if (QLocale::system().name() == "C") { |
48 /* Useful for testing / development as the primary target is german */ | 60 /* Useful for testing / development as the primary target is german */ |
49 translator.load(":/l10n/administrator_de_DE"); | 61 translator.load(":/l10n/administrator_de_DE"); |
50 } else { | 62 } else { |