[Pkg-running-devel] [openambit] 71/131: Added simple about dialog

Christian Perrier bubulle at moszumanska.debian.org
Thu Jul 17 20:19:12 UTC 2014


This is an automated email from the git hooks/post-receive script.

bubulle pushed a commit to branch master
in repository openambit.

commit a420d84223bf747706f026a963ea68cb7160b873
Author: Emil Ljungdahl <emil at kratern.se>
Date:   Thu Jan 23 23:49:24 2014 +0100

    Added simple about dialog
---
 src/openambit/main.cpp       |  1 +
 src/openambit/mainwindow.cpp | 10 +++++++++-
 src/openambit/mainwindow.h   |  1 +
 src/openambit/mainwindow.ui  | 17 +++++++++++++++++
 src/openambit/openambit.pro  |  4 ++++
 5 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/src/openambit/main.cpp b/src/openambit/main.cpp
index 8a4c207..dd607dc 100644
--- a/src/openambit/main.cpp
+++ b/src/openambit/main.cpp
@@ -34,6 +34,7 @@ int main(int argc, char *argv[])
     }
 
     // Set application settings
+    QCoreApplication::setApplicationVersion(APP_VERSION);
     QCoreApplication::setOrganizationName("openambit");
     QCoreApplication::setApplicationName("openambit");
 #ifdef Q_WS_X11
diff --git a/src/openambit/mainwindow.cpp b/src/openambit/mainwindow.cpp
index be69ebc..e3f2b2e 100644
--- a/src/openambit/mainwindow.cpp
+++ b/src/openambit/mainwindow.cpp
@@ -22,8 +22,9 @@
 #include "mainwindow.h"
 #include "ui_mainwindow.h"
 
-#include <QListWidgetItem>
 #include <QCloseEvent>
+#include <QListWidgetItem>
+#include <QMessageBox>
 
 #define APPKEY                 "HpF9f1qV5qrDJ1hY1QK1diThyPsX10Mh4JvCw9xVQSglJNLdcwr3540zFyLzIC3e"
 #define MOVESCOUNT_DEFAULT_URL "https://uiservices.movescount.com/"
@@ -191,6 +192,13 @@ void MainWindow::showSettings()
     settingsDialog->show();
 }
 
+void MainWindow::showAbout()
+{
+    QMessageBox::about(this, tr("About openambit"),
+                       tr("<h2>openambit</h2><b>Version %1</b><br />Using Qt %2").arg(QCoreApplication::applicationVersion()).arg(QString(qVersion())) +
+                       "<br /><br /><a href=\"http://sourceforge.net/projects/openambit\">http://sourceforge.net/projects/openambit</a>");
+}
+
 void MainWindow::settingsSaved()
 {
     // Update Movescount
diff --git a/src/openambit/mainwindow.h b/src/openambit/mainwindow.h
index 44de52f..9357d9d 100644
--- a/src/openambit/mainwindow.h
+++ b/src/openambit/mainwindow.h
@@ -61,6 +61,7 @@ private slots:
     void trayIconClicked(QSystemTrayIcon::ActivationReason reason);
 
     void showSettings();
+    void showAbout();
     void settingsSaved();
 
     void syncNowClicked();
diff --git a/src/openambit/mainwindow.ui b/src/openambit/mainwindow.ui
index 9cc8b84..7fa69bb 100644
--- a/src/openambit/mainwindow.ui
+++ b/src/openambit/mainwindow.ui
@@ -432,9 +432,26 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>actionAbout_openambit</sender>
+   <signal>triggered()</signal>
+   <receiver>MainWindow</receiver>
+   <slot>showAbout()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>435</x>
+     <y>270</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>showSettings()</slot>
   <slot>closeRequested()</slot>
+  <slot>showAbout()</slot>
  </slots>
 </ui>
diff --git a/src/openambit/openambit.pro b/src/openambit/openambit.pro
index d631d5c..3f50df9 100644
--- a/src/openambit/openambit.pro
+++ b/src/openambit/openambit.pro
@@ -8,6 +8,8 @@ QT       += core gui network
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
 
+VERSION = HEAD
+
 TARGET = openambit
 TEMPLATE = app
 
@@ -47,3 +49,5 @@ OTHER_FILES +=
 
 RESOURCES += \
     resources.qrc
+
+DEFINES += APP_VERSION=\\\"$$VERSION\\\"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/openambit.git



More information about the Pkg-running-devel mailing list