mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-05 10:12:46 +00:00
Implemented series and final for touches alpha release
This commit is contained in:
parent
020c968f9c
commit
14a99c3342
30 changed files with 1213 additions and 114 deletions
97
qml/pages/AboutPage.qml
Normal file
97
qml/pages/AboutPage.qml
Normal file
|
@ -0,0 +1,97 @@
|
|||
import QtQuick 2.6
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
import "../components"
|
||||
|
||||
Page {
|
||||
id: page
|
||||
|
||||
// The effective value will be restricted by ApplicationWindow.allowedOrientations
|
||||
allowedOrientations: Orientation.All
|
||||
|
||||
SilicaFlickable {
|
||||
anchors.fill: parent
|
||||
contentHeight: content.height
|
||||
Column {
|
||||
id: content
|
||||
width: parent.width
|
||||
PageHeader {
|
||||
title: qsTr("About Sailfin")
|
||||
}
|
||||
Image {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
source: Qt.resolvedUrl("../icon.png")
|
||||
}
|
||||
|
||||
Item { width: 1; height: Theme.paddingLarge }
|
||||
|
||||
Label {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: Theme.horizontalPageMargin
|
||||
anchors.rightMargin: Theme.horizontalPageMargin
|
||||
wrapMode: Text.WordWrap
|
||||
text: "<p><b>Sailfin version 0.1.0</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>"
|
||||
textFormat: Text.StyledText
|
||||
color: Theme.secondaryHighlightColor
|
||||
linkColor: Theme.primaryColor
|
||||
onLinkActivated: {
|
||||
switch(link) {
|
||||
case "lgpl":
|
||||
pageStack.push(licensePage)
|
||||
break;
|
||||
case "3rdparty":
|
||||
pageStack.push(Qt.resolvedUrl("LegalPage.qml"))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
VerticalScrollDecorator {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: licensePage
|
||||
|
||||
Page {
|
||||
allowedOrientations: Orientation.All
|
||||
SilicaFlickable {
|
||||
anchors.fill: parent
|
||||
contentHeight: content.height
|
||||
PullDownMenu {
|
||||
MenuItem {
|
||||
text: qsTr("Open externally")
|
||||
onClicked: Qt.openUrlExternally(Qt.resolvedUrl("../licenses/lgpl-2.1.html"))
|
||||
}
|
||||
}
|
||||
VerticalScrollDecorator {}
|
||||
Column {
|
||||
id: content
|
||||
width: parent.width
|
||||
PageHeader {
|
||||
title: qsTr("LGPL 2.1 License")
|
||||
}
|
||||
PlainLabel {
|
||||
id: licenseLabel
|
||||
|
||||
Component.onCompleted: {
|
||||
var xhr = new XMLHttpRequest;
|
||||
xhr.open("GET", Qt.resolvedUrl("../licenses/lgpl-2.1.html")); // set Method and File
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState === XMLHttpRequest.DONE){ // if request_status == DONE
|
||||
licenseLabel.text = xhr.responseText;
|
||||
}
|
||||
}
|
||||
xhr.send(); // begin the request
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ Page {
|
|||
if (_backdropImages && _backdropImages.length > 0) {
|
||||
var rand = Math.floor(Math.random() * (_backdropImages.length - 0.001))
|
||||
console.log("Random: ", rand)
|
||||
backdrop.source = ApiClient.baseUrl + "/Items/" + itemId + "/Images/Backdrop/" + rand + "?tag=" + _backdropImages[rand]
|
||||
backdrop.source = ApiClient.baseUrl + "/Items/" + itemId + "/Images/Backdrop/" + rand + "?tag=" + _backdropImages[rand] + "&maxHeight" + height
|
||||
} else if (_parentBackdropImages && _parentBackdropImages.length > 0) {
|
||||
console.log(parentId)
|
||||
backdrop.source = ApiClient.baseUrl + "/Items/" + itemData.ParentBackdropItemId + "/Images/Backdrop/0?tag=" + _parentBackdropImages[0]
|
||||
|
@ -89,6 +89,12 @@ Page {
|
|||
switch (itemData.Type){
|
||||
case "Movie":
|
||||
return Qt.resolvedUrl("../components/itemdetails/FilmDetails.qml")
|
||||
case "Series":
|
||||
return Qt.resolvedUrl("../components/itemdetails/SeriesDetails.qml")
|
||||
case "Season":
|
||||
return Qt.resolvedUrl("../components/itemdetails/SeasonDetails.qml")
|
||||
case "Episode":
|
||||
return Qt.resolvedUrl("../components/itemdetails/EpisodeDetails.qml")
|
||||
default:
|
||||
return Qt.resolvedUrl("../components/itemdetails/UnsupportedDetails.qml")
|
||||
}
|
||||
|
@ -117,7 +123,10 @@ Page {
|
|||
onStatusChanged: {
|
||||
if (status == PageStatus.Deactivating) {
|
||||
backdrop.clear()
|
||||
appWindow.itemData = ({})
|
||||
//appWindow.itemData = ({})
|
||||
}
|
||||
if (status == PageStatus.Active && itemData) {
|
||||
appWindow.itemData = itemData
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,6 +137,7 @@ Page {
|
|||
//console.log(JSON.stringify(result))
|
||||
pageRoot.itemData = result
|
||||
pageRoot._loading = false
|
||||
if (status == PageStatus.Active)
|
||||
appWindow.itemData = result
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ import Sailfish.Silica 1.0
|
|||
import nl.netsoj.chris.Jellyfin 1.0
|
||||
|
||||
import "../components"
|
||||
import "../"
|
||||
import "../Utils.js" as Utils
|
||||
|
||||
/**
|
||||
* Main page, which simply shows some content of every library, as well as next items.
|
||||
|
@ -21,11 +23,7 @@ Page {
|
|||
PullDownMenu {
|
||||
MenuItem {
|
||||
text: qsTr("About")
|
||||
onClicked: pageStack.push(Qt.resolvedUrl("LegalPage.qml"))
|
||||
}
|
||||
MenuItem {
|
||||
text: qsTr("Settings")
|
||||
onClicked: pageStack.push(Qt.resolvedUrl("SecondPage.qml"))
|
||||
onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,11 +43,12 @@ Page {
|
|||
}
|
||||
|
||||
MoreSection {
|
||||
text: "Kijken hervatten"
|
||||
enabled: false
|
||||
text: qsTr("Resume watching")
|
||||
clickable: false
|
||||
}
|
||||
MoreSection {
|
||||
text: "Volgende"
|
||||
text: qsTr("Next up")
|
||||
clickable: false
|
||||
}
|
||||
|
||||
UserViewModel {
|
||||
|
@ -61,29 +60,46 @@ Page {
|
|||
MoreSection {
|
||||
text: model.name
|
||||
busy: userItemModel.status != ApiModel.Ready
|
||||
property string collectionType: model.collectionType
|
||||
|
||||
onHeaderClicked: pageStack.push(Qt.resolvedUrl("DetailPage.qml"), {"itemId": model.id})
|
||||
|
||||
SilicaListView {
|
||||
clip: true
|
||||
height: count > 0 ? Screen.width / 4 : 0
|
||||
height: {
|
||||
if (count > 0) {
|
||||
console.log(collectionType)
|
||||
if (["tvshows", "movies"].indexOf(collectionType) == -1) {
|
||||
Constants.libraryDelegateHeight
|
||||
} else {
|
||||
Constants.libraryDelegatePosterHeight
|
||||
}
|
||||
} else {
|
||||
0
|
||||
}
|
||||
}
|
||||
Behavior on height {
|
||||
NumberAnimation { duration: 300 }
|
||||
}
|
||||
width: parent.width
|
||||
model: userItemModel
|
||||
orientation: ListView.Horizontal
|
||||
leftMargin: Theme.horizontalPageMargin
|
||||
rightMargin: Theme.horizontalPageMargin
|
||||
spacing: Theme.paddingLarge
|
||||
delegate: LibraryItemDelegate {
|
||||
property string id: model.id
|
||||
title: model.name
|
||||
poster: model.imageTags["Primary"] ? ApiClient.baseUrl + "/Items/" + model.id
|
||||
poster: Utils.itemModelImageUrl(ApiClient.baseUrl, model.id, model.imageTags["Primary"], "Primary", {"maxHeight": height})
|
||||
/*model.imageTags["Primary"] ? ApiClient.baseUrl + "/Items/" + model.id
|
||||
+ "/Images/Primary?maxHeight=" + height + "&tag=" + model.imageTags["Primary"]
|
||||
: ""
|
||||
landscape: true
|
||||
: ""*/
|
||||
landscape: ["Series", "Movie"].indexOf(model.type) == -1
|
||||
|
||||
onClicked: {
|
||||
pageStack.push(Qt.resolvedUrl("DetailPage.qml"), {"itemId": model.id})
|
||||
}
|
||||
}
|
||||
HorizontalScrollDecorator {}
|
||||
UserItemLatestModel {
|
||||
id: userItemModel
|
||||
apiClient: ApiClient
|
||||
|
@ -104,6 +120,12 @@ Page {
|
|||
}
|
||||
}
|
||||
|
||||
onStatusChanged: {
|
||||
if (status == PageStatus.Active) {
|
||||
appWindow.itemData = null
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ApiClient
|
||||
onAuthenticatedChanged: {
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
Page {
|
||||
id: page
|
||||
|
||||
// The effective value will be restricted by ApplicationWindow.allowedOrientations
|
||||
allowedOrientations: Orientation.All
|
||||
|
||||
SilicaListView {
|
||||
id: listView
|
||||
model: 20
|
||||
anchors.fill: parent
|
||||
header: PageHeader {
|
||||
title: qsTr("Nested Page")
|
||||
}
|
||||
delegate: BackgroundItem {
|
||||
id: delegate
|
||||
|
||||
Label {
|
||||
x: Theme.horizontalPageMargin
|
||||
text: qsTr("Item") + " " + index
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
|
||||
}
|
||||
onClicked: console.log("Clicked " + index)
|
||||
}
|
||||
VerticalScrollDecorator {}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue