From d17dd787eb05530a38141249728af13eaa91c78e Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Mon, 27 Jun 2011 20:39:29 +0000 Subject: [PATCH] Included application version in the about dialog. This closes ticket #9. --- confclerk.pro | 7 ++++--- src/app/main.cpp | 1 + src/global.pri | 4 ++++ src/gui/about.ui | 7 +++++++ src/gui/mainwindow.cpp | 1 + 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/confclerk.pro b/confclerk.pro index 8f2160c..0b88c76 100644 --- a/confclerk.pro +++ b/confclerk.pro @@ -3,14 +3,15 @@ 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 -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 diff --git a/src/app/main.cpp b/src/app/main.cpp index 0d450f6..d70f890 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -43,6 +43,7 @@ int main(int argc, char *argv[]) // needed by QDesktopServices QCoreApplication::setOrganizationName("Toastfreeware"); QCoreApplication::setApplicationName("ConfClerk"); + QCoreApplication::setApplicationVersion(VERSION); SqlEngine::initialize(); // creates "SQLITE" DB connection diff --git a/src/global.pri b/src/global.pri index 468a028..1a72c7e 100644 --- a/src/global.pri +++ b/src/global.pri @@ -3,6 +3,10 @@ # 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) diff --git a/src/gui/about.ui b/src/gui/about.ui index 6ea6df9..818a116 100644 --- a/src/gui/about.ui +++ b/src/gui/about.ui @@ -192,6 +192,13 @@ + + + + Version %1 + + + diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 1d92544..74db6b9 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -133,6 +133,7 @@ void MainWindow::aboutApp() QDialog dialog(this); Ui::AboutDialog ui; ui.setupUi(&dialog); + ui.labelVersion->setText(ui.labelVersion->text().arg(qApp->applicationVersion())); #ifdef N810 dialog.setFixedWidth(width()); #endif -- 2.39.5