Merge pull request #314

f19318f Add git version to the settings page (moneromooo.monero)
This commit is contained in:
Riccardo Spagni 2016-12-21 09:22:05 +02:00
commit 40922305da
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
4 changed files with 41 additions and 0 deletions

View file

@ -45,6 +45,10 @@ elif [ "$platform" == "mingw64" ] || [ "$platform" == "mingw32" ]; then
MONEROD_EXEC=monerod.exe
fi
# force version update
get_tag
echo "var VERSION = \"$VERSIONTAG\"" > version.js
cd build
qmake ../monero-wallet-gui.pro "$CONFIG"
make

View file

@ -31,6 +31,7 @@ import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2
import "../version.js" as Version
import "../components"
@ -345,6 +346,14 @@ Rectangle {
}
}
Label {
id: guiVersion
Layout.topMargin: 8
color: "#4A4949"
text: qsTr("GUI version: ") + Version.VERSION + translationManager.emptyString
fontSize: 16
}
}
// Daemon console

View file

@ -121,5 +121,6 @@
<file>components/StandardDialog.qml</file>
<file>pages/Sign.qml</file>
<file>components/DaemonManagerDialog.qml</file>
<file>version.js</file>
</qresource>
</RCC>

View file

@ -21,6 +21,33 @@ function get_platform {
}
function get_tag()
{
COMMIT=$(git rev-parse --short HEAD | sed -e 's/[\t ]*//')
if test $? -ne 0
then
echo "Cannot determine current commit. Make sure that you are building either from a Git working tree or from a source archive."
VERSIONTAG="unknown"
else
echo "You are currently on commit ${COMMIT}"
TAGGEDCOMMIT=$(git rev-list --tags --max-count=1 --abbrev-commit | sed -e 's/[\t ]*//')
if test -z "$TAGGEDCOMMIT"
then
echo "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive."
VERSIONTAG=$COMMIT
else
echo "The most recent tag was at ${TAGGEDCOMMIT}"
if test "$TAGGEDCOMMIT" = "$COMMIT"
then
echo "You are building a tagged release"
VERSIONTAG="release"
else
echo "You are ahead of or behind a tagged release"
VERSIONTAG="$COMMIT"
fi
fi
fi
}