diff ui/main.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 8de162b91a22
children c9a31544aaab
line wrap: on
line diff
--- a/ui/main.cpp	Thu Jul 24 11:41:17 2014 +0200
+++ b/ui/main.cpp	Thu Jul 24 11:41:52 2014 +0200
@@ -35,6 +35,11 @@
 #define ORGANIZATION "BSI"
 #endif
 
+#define COPYRIGHT "Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik \n" \
+                  "Software engineering by Intevation GmbH \n\n" \
+                  "This file is Free Software under the GNU GPL (v>=2)\n" \
+                  "and comes with ABSOLUTELY NO WARRANTY!\n"
+
 #ifdef Q_OS_WIN
  Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
 #else
@@ -65,6 +70,13 @@
     QStringList arguments = QApplication::arguments();
     bool trayMode = arguments.contains("--tray");
 
+    if (arguments.contains("--version")) {
+        printf (APPNAME " Version: %s \n",
+                QApplication::applicationVersion().toLocal8Bit().constData());
+        printf (COPYRIGHT);
+        return 0;
+    }
+
     QSettings settings;
     settings.beginGroup("settings");
     bool autoStart = settings.value("autostart", true).toBool();

http://wald.intevation.org/projects/trustbridge/