mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2024-12-22 22:15:17 +00:00
Propagate version number from yaml to QML
* The application now will use the version number from the Spectacle yaml in HTTP-requests and display it in the about page as well.
This commit is contained in:
parent
419e97a882
commit
4a9be69c07
|
@ -17,7 +17,12 @@ QT += multimedia
|
|||
CONFIG += sailfishapp c++11
|
||||
|
||||
# Help, something keeps eating my quotes and backslashes
|
||||
DEFINES += "SAILFIN_VERSION=\"\\\"0.1.0\\\"\""
|
||||
|
||||
!defined(SAILFIN_VERSION, var) {
|
||||
SAILFIN_VERSION = "(UNKNOWN VERSION)"
|
||||
}
|
||||
|
||||
DEFINES += "SAILFIN_VERSION=\"\\\"$$SAILFIN_VERSION\\\"\""
|
||||
|
||||
SOURCES += \
|
||||
src/credentialmanager.cpp \
|
||||
|
@ -77,7 +82,7 @@ CONFIG += sailfishapp_i18n
|
|||
# modify the localized app name in the the .desktop file.
|
||||
# TRANSLATIONS += \
|
||||
|
||||
HEADERS += \
|
||||
HEADERS += \
|
||||
src/credentialmanager.h \
|
||||
src/jellyfinapiclient.h \
|
||||
src/jellyfinapimodel.h \
|
||||
|
|
|
@ -19,6 +19,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
import QtQuick 2.6
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
import nl.netsoj.chris.Jellyfin 1.0
|
||||
|
||||
import "../components"
|
||||
|
||||
Page {
|
||||
|
@ -49,10 +51,11 @@ Page {
|
|||
anchors.leftMargin: Theme.horizontalPageMargin
|
||||
anchors.rightMargin: Theme.horizontalPageMargin
|
||||
wrapMode: Text.WordWrap
|
||||
text: "<p><b>Sailfin version 0.1.0</b><br/>" +
|
||||
text: qsTr("<p><b>Sailfin version %1</b><br/>" +
|
||||
"Copyright © Chris Josten 2020</p>" +
|
||||
"<p>Sailfin is Free Software licensed under the <a href='lgpl'>LGPL-v2.1</a> or later, at your choice. " +
|
||||
"Parts of the code of Sailfin are from other libraries. <a href='3rdparty'>View their licenses here</a>.</p>"
|
||||
"Parts of the code of Sailfin are from other libraries. <a href='3rdparty'>View their licenses here</a>.</p>")
|
||||
.arg(ApiClient.version)
|
||||
textFormat: Text.StyledText
|
||||
color: Theme.secondaryHighlightColor
|
||||
linkColor: Theme.primaryColor
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: harbour-sailfin
|
||||
Summary: Sailfin
|
||||
Version: 0.1
|
||||
Version: &version 0.1.0
|
||||
Release: 1
|
||||
# The contents of the Group field should be one of the groups listed here:
|
||||
# https://github.com/mer-tools/spectacle/blob/master/data/GROUPS
|
||||
|
@ -38,5 +38,8 @@ Files:
|
|||
- '%{_datadir}/applications/%{name}.desktop'
|
||||
- '%{_datadir}/icons/hicolor/*/apps/%{name}.png'
|
||||
|
||||
QMakeOptions:
|
||||
- SAILFIN_VERSION='%{version}-%{release}'
|
||||
|
||||
# For more information about yaml and what's supported in Sailfish OS
|
||||
# build system, please see https://wiki.merproject.org/wiki/Spectacle
|
||||
|
|
|
@ -73,6 +73,7 @@ public:
|
|||
Q_PROPERTY(QString baseUrl MEMBER m_baseUrl READ baseUrl NOTIFY baseUrlChanged)
|
||||
Q_PROPERTY(bool authenticated READ authenticated WRITE setAuthenticated NOTIFY authenticatedChanged)
|
||||
Q_PROPERTY(QString userId READ userId NOTIFY userIdChanged)
|
||||
Q_PROPERTY(QString version READ version)
|
||||
|
||||
/*QNetworkReply *handleRequest(QString path, QStringList sort, Pagination *pagination,
|
||||
QVariantMap filters, QStringList fields, QStringList expand, QString id);*/
|
||||
|
@ -101,6 +102,7 @@ public:
|
|||
QString &userId() { return m_userId; }
|
||||
QJsonObject &deviceProfile() { return m_deviceProfile; }
|
||||
QJsonObject &playbackDeviceProfile() { return m_playbackDeviceProfile; }
|
||||
QString version() const { return QString(m_version); }
|
||||
signals:
|
||||
/*
|
||||
* Emitted when the server requires authentication. Please authenticate your user via authenticate.
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
<source>LGPL 2.1 License</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><p><b>Sailfin version %1</b><br/>Copyright © Chris Josten 2020</p><p>Sailfin is Free Software licensed under the <a href='lgpl'>LGPL-v2.1</a> or later, at your choice. Parts of the code of Sailfin are from other libraries. <a href='3rdparty'>View their licenses here</a>.</p></source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AddServerConnectingPage</name>
|
||||
|
@ -107,7 +111,11 @@
|
|||
<context>
|
||||
<name>EpisodeDetails</name>
|
||||
<message>
|
||||
<source>Released: %1 — Run time: %2</source>
|
||||
<source>Episode %1–%2 Season %3</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Episode %1 Season %2</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
|
|
Loading…
Reference in a new issue