1
mirror of https://github.com/monero-project/monero-gui synced 2024-12-29 23:26:24 +01:00

Add git version to the settings page

Useful for bug reports
This commit is contained in:
moneromooo.monero 2016-12-20 21:13:42 +00:00
parent aea9c233cc
commit f19318fbd1
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
}