Commit 26907c28 authored by kempe's avatar kempe

[FEATURE] Show version on about page

parent 466ce9d2
......@@ -15,6 +15,14 @@ TARGET = harbour-received
QT += multimedia dbus
CONFIG += sailfishapp
# Write version file
VERSION_H = \
"$${LITERAL_HASH}ifndef RECEIVED_VERSION" \
"$${LITERAL_HASH} define RECEIVED_VERSION \"$$VERSION\"" \
"$${LITERAL_HASH} define RECEIVED_BUILD_NUMBER \"$$BUILD_NUMBER\"" \
"$${LITERAL_HASH}endif"
write_file($$$$OUT_PWD/received_version.h, VERSION_H)
HEADERS += \
src/settings.h \
src/audioplayer.h \
......
......@@ -38,6 +38,13 @@ Page {
text: "Received"
}
Label {
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: Theme.fontSizeExtraSmall
color: Theme.secondaryColor
text: qsTr("Version: ") + Qt.application.version
}
ButtonLayout {
width: parent.width
......
......@@ -43,7 +43,9 @@ Received is a unofficial client for radio.net (rad.io). For now it is possible s
# >> build pre
# << build pre
%qtc_qmake5
%qtc_qmake5 \
VERSION=%{version} \
BUILD_NUMBER=%{release}
%qtc_make %{?_smp_mflags}
......
......@@ -11,15 +11,22 @@ Description: |
Received is a unofficial client for radio.net (rad.io). For now it is possible search, browse according to different categories and favourites(not connected to radio.net favourites)
Configure: none
Builder: qtc5
QMakeOptions:
- VERSION=%{version}
- BUILD_NUMBER=%{release}
PkgConfigBR:
- sailfishapp >= 1.0.2
- Qt5Core
- Qt5Qml
- Qt5Quick
- Qt5Multimedia
Requires:
- sailfishsilica-qt5 >= 0.10.9
- pyotherside-qml-plugin-python3-qt5 >= 1.4.0
Files:
- '%{_bindir}'
- '%{_datadir}/%{name}'
......
......@@ -42,6 +42,7 @@
#include "src/settings.h"
#include "src/audioplayer.h"
#include <received_version.h>
void setupSettings(Settings &settings) {
......@@ -59,6 +60,7 @@ int main(int argc, char *argv[])
{
//return SailfishApp::main(argc, argv);
QGuiApplication *app = SailfishApp::application(argc, argv);
app->setApplicationVersion(QStringLiteral(RECEIVED_VERSION) + "-" + QStringLiteral(RECEIVED_BUILD_NUMBER));
QQuickView *view = SailfishApp::createView();
qmlRegisterSingletonType<AudioPlayer>("it.kempe.AudioPlayer", 1, 0, "AudioPlayer", audioPlayerProvider);
......
......@@ -15,6 +15,10 @@
<source>Source code</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Version: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApiLanguageListModel</name>
......
......@@ -15,6 +15,10 @@
<source>Source code</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Version: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApiLanguageListModel</name>
......
......@@ -15,6 +15,10 @@
<source>Source code</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Version: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApiLanguageListModel</name>
......
......@@ -15,6 +15,10 @@
<source>Source code</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Version: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApiLanguageListModel</name>
......
......@@ -15,6 +15,10 @@
<source>Source code</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Version: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ApiLanguageListModel</name>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment