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 + ".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)

View File

@ -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 += . \

View File

@ -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)

View File

@ -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");