Add stage and revision info in about page #4893

This commit is contained in:
Xinyu Hou 2015-09-15 14:55:58 -07:00 committed by Jerry (Xinyu Hou)
parent faa170b40d
commit 6320156279
4 changed files with 10 additions and 2 deletions

View File

@ -508,6 +508,8 @@ class InternalCommands:
qmake_cmd_string += " QMAKE_MAC_SDK=" + shortForm qmake_cmd_string += " QMAKE_MAC_SDK=" + shortForm
qmake_cmd_string += " QMAKE_MAC_SDK." + shortForm + ".path=" + sdkDir 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 print "QMake command: " + qmake_cmd_string
# run qmake from the gui dir # run qmake from the gui dir
@ -957,7 +959,7 @@ class InternalCommands:
def getGitRevision(self): def getGitRevision(self):
if sys.version_info < (2, 4): if sys.version_info < (2, 4):
raise Exception("Python 2.4 or greater required.") raise Exception("Python 2.4 or greater required.")
p = subprocess.Popen( p = subprocess.Popen(
["git", "log", "--pretty=format:%h", "-n", "1"], ["git", "log", "--pretty=format:%h", "-n", "1"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout=subprocess.PIPE, stderr=subprocess.PIPE)

View File

@ -2,6 +2,8 @@ QT += widgets \
network network
TEMPLATE = app TEMPLATE = app
TARGET = synergy TARGET = synergy
DEFINES += VERSION_STAGE=\\\"$$QMAKE_VERSION_STAGE\\\"
DEFINES += VERSION_REVISION=\\\"$$QMAKE_VERSION_REVISION\\\"
DEPENDPATH += . \ DEPENDPATH += . \
res res
INCLUDEPATH += . \ INCLUDEPATH += . \

View File

@ -28,7 +28,9 @@ AboutDialog::AboutDialog(QWidget* parent, const QString& synergyApp) :
setupUi(this); setupUi(this);
m_versionChecker.setApp(synergyApp); 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 // change default size based on os
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)

View File

@ -96,7 +96,9 @@ QString VersionChecker::getVersion()
QRegExp rx(VERSION_REGEX); QRegExp rx(VERSION_REGEX);
QString text = process.readLine(); QString text = process.readLine();
if (rx.indexIn(text) != -1) if (rx.indexIn(text) != -1)
{
return rx.cap(1); return rx.cap(1);
}
} }
return tr("Unknown"); return tr("Unknown");