Add git version to About
This commit is contained in:
@@ -37,9 +37,15 @@ HEADERS += \
|
||||
LIBS += -lgit2
|
||||
|
||||
win32 {
|
||||
DEFINES += "_WIN32_WINNT=0x06010000"
|
||||
DEFINES += _WIN32_WINNT=0x06010000
|
||||
}
|
||||
|
||||
GIT_TAG = $$system(git describe --tags)
|
||||
GIT_SHA = $$system(git rev-parse --short HEAD)
|
||||
|
||||
DEFINES += GIT_TAG=\\\"$$GIT_TAG\\\" \
|
||||
GIT_SHA=\\\"$$GIT_SHA\\\"
|
||||
|
||||
DISTFILES += \
|
||||
README.md
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "control.h"
|
||||
#include "addon.h"
|
||||
#include <QIcon>
|
||||
#include <QQmlContext>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -35,6 +36,7 @@ int main(int argc, char *argv[])
|
||||
return Control::instance();
|
||||
});
|
||||
qmlRegisterUncreatableType<Addon>("GitAddonsManager.engine",1,0,"Addon","");
|
||||
engine.rootContext()->setContextProperty("gitVersion", QString("%1 (%2)").arg(GIT_TAG, GIT_SHA));
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
if (engine.rootObjects().isEmpty())
|
||||
return -1;
|
||||
|
||||
@@ -133,12 +133,20 @@ ApplicationWindow {
|
||||
Label {
|
||||
text: "Author: woblight <woblight@gmail.com>"
|
||||
}
|
||||
|
||||
Label {
|
||||
text: "Source code: <a href=https://gitlab.com/woblight/GitAddonsManager>GitLab</a>"
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
textFormat: Text.RichText
|
||||
}
|
||||
RowLayout {
|
||||
Label {
|
||||
text: "Version:"
|
||||
}
|
||||
TextArea {
|
||||
readOnly: true
|
||||
text: gitVersion
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user