From 6320156279e6890bb9bcba12c0595fabd15b8f6b Mon Sep 17 00:00:00 2001 From: Xinyu Hou Date: Tue, 15 Sep 2015 14:55:58 -0700 Subject: [PATCH] Add stage and revision info in about page #4893 --- ext/toolchain/commands1.py | 4 +++- src/gui/gui.pro | 2 ++ src/gui/src/AboutDialog.cpp | 4 +++- src/gui/src/VersionChecker.cpp | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 0a300299..da0af1aa 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -508,6 +508,8 @@ class InternalCommands: qmake_cmd_string += " QMAKE_MAC_SDK=" + shortForm qmake_cmd_string += " QMAKE_MAC_SDK." + shortForm + ".path=" + sdkDir + qmake_cmd_string += " QMAKE_VERSION_STAGE=" + self.getVersionStage() + qmake_cmd_string += " QMAKE_VERSION_REVISION=" + self.getGitRevision() print "QMake command: " + qmake_cmd_string # run qmake from the gui dir @@ -957,7 +959,7 @@ class InternalCommands: def getGitRevision(self): if sys.version_info < (2, 4): raise Exception("Python 2.4 or greater required.") - + p = subprocess.Popen( ["git", "log", "--pretty=format:%h", "-n", "1"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 28d1ee6e..6cf5d399 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -2,6 +2,8 @@ QT += widgets \ network TEMPLATE = app TARGET = synergy +DEFINES += VERSION_STAGE=\\\"$$QMAKE_VERSION_STAGE\\\" +DEFINES += VERSION_REVISION=\\\"$$QMAKE_VERSION_REVISION\\\" DEPENDPATH += . \ res INCLUDEPATH += . \ diff --git a/src/gui/src/AboutDialog.cpp b/src/gui/src/AboutDialog.cpp index f2d69d3b..ee528e9c 100644 --- a/src/gui/src/AboutDialog.cpp +++ b/src/gui/src/AboutDialog.cpp @@ -28,7 +28,9 @@ AboutDialog::AboutDialog(QWidget* parent, const QString& synergyApp) : setupUi(this); m_versionChecker.setApp(synergyApp); - m_pLabelSynergyVersion->setText(m_versionChecker.getVersion()); + QString version = m_versionChecker.getVersion(); + version = version + '-' + VERSION_STAGE + '-' + VERSION_REVISION; + m_pLabelSynergyVersion->setText(version); // change default size based on os #if defined(Q_OS_MAC) diff --git a/src/gui/src/VersionChecker.cpp b/src/gui/src/VersionChecker.cpp index 26543eb6..dcb5720f 100644 --- a/src/gui/src/VersionChecker.cpp +++ b/src/gui/src/VersionChecker.cpp @@ -96,7 +96,9 @@ QString VersionChecker::getVersion() QRegExp rx(VERSION_REGEX); QString text = process.readLine(); if (rx.indexIn(text) != -1) + { return rx.cap(1); + } } return tr("Unknown");