Included application version in the about dialog. This closes ticket #9.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 27 Jun 2011 20:39:29 +0000 (20:39 +0000)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Mon, 27 Jun 2011 20:39:29 +0000 (20:39 +0000)
confclerk.pro
src/app/main.cpp
src/global.pri
src/gui/about.ui
src/gui/mainwindow.cpp

index 8f2160c..0b88c76 100644 (file)
@@ -3,14 +3,15 @@
 QMAKEVERSION = $$[QMAKE_VERSION]
 ISQT4 = $$find(QMAKEVERSION, ^[2-9])
 isEmpty( ISQT4 ) {
 QMAKEVERSION = $$[QMAKE_VERSION]
 ISQT4 = $$find(QMAKEVERSION, ^[2-9])
 isEmpty( ISQT4 ) {
-error("Use the qmake include with Qt4.4 or greater, on Debian that is
-qmake-qt4");
+       error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4");
 }
 
 TEMPLATE = subdirs
 SUBDIRS = src
 
 }
 
 TEMPLATE = subdirs
 SUBDIRS = src
 
-VERSION = 0.5.0
+# The global.pri defines the VERSION of the project
+include(src/global.pri)
+
 
 QMAKE_DISTCLEAN += src/bin/*.a
 QMAKE_EXTRA_TARGETS += changelog icon man release tarball
 
 QMAKE_DISTCLEAN += src/bin/*.a
 QMAKE_EXTRA_TARGETS += changelog icon man release tarball
index 0d450f6..d70f890 100644 (file)
@@ -43,6 +43,7 @@ int main(int argc, char *argv[])
     // needed by QDesktopServices
     QCoreApplication::setOrganizationName("Toastfreeware");
     QCoreApplication::setApplicationName("ConfClerk");
     // needed by QDesktopServices
     QCoreApplication::setOrganizationName("Toastfreeware");
     QCoreApplication::setApplicationName("ConfClerk");
+    QCoreApplication::setApplicationVersion(VERSION);
  
     SqlEngine::initialize(); // creates "SQLITE" DB connection
 
  
     SqlEngine::initialize(); // creates "SQLITE" DB connection
 
index 468a028..1a72c7e 100644 (file)
@@ -3,6 +3,10 @@
 # include this file in each "*.pro" file, where it's needed
 # USAGE: include(./global.pri)
 
 # include this file in each "*.pro" file, where it's needed
 # USAGE: include(./global.pri)
 
+# VERSION
+VERSION = 0.5.0
+DEFINES += VERSION=\\\"$$VERSION\\\"
+
 # Define 'MAEMO' specific CONFIG/DEFINE
 # To handle 'MAEMO' specific soruces/code
 DISTRO = $$system(cat /etc/issue)
 # Define 'MAEMO' specific CONFIG/DEFINE
 # To handle 'MAEMO' specific soruces/code
 DISTRO = $$system(cat /etc/issue)
index 6ea6df9..818a116 100644 (file)
                 </property>
                </widget>
               </item>
                 </property>
                </widget>
               </item>
+              <item>
+               <widget class="QLabel" name="labelVersion">
+                <property name="text">
+                 <string>Version %1</string>
+                </property>
+               </widget>
+              </item>
               <item>
                <widget class="QLabel" name="spacer">
                 <property name="text">
               <item>
                <widget class="QLabel" name="spacer">
                 <property name="text">
index 1d92544..74db6b9 100644 (file)
@@ -133,6 +133,7 @@ void MainWindow::aboutApp()
     QDialog dialog(this);
     Ui::AboutDialog ui;
     ui.setupUi(&dialog);
     QDialog dialog(this);
     Ui::AboutDialog ui;
     ui.setupUi(&dialog);
+    ui.labelVersion->setText(ui.labelVersion->text().arg(qApp->applicationVersion()));
 #ifdef N810
     dialog.setFixedWidth(width());
 #endif
 #ifdef N810
     dialog.setFixedWidth(width());
 #endif