1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-05 10:12:46 +00:00

Added comments and general cleanup on qml files

This commit is contained in:
Chris Josten 2020-09-25 15:21:08 +02:00
parent 92a18c4fa5
commit 1eb6a8fb5d
17 changed files with 101 additions and 47 deletions

View file

@ -4,8 +4,14 @@ import Sailfish.Silica 1.0
import nl.netsoj.chris.Jellyfin 1.0
import "../components"
import "../compontents/details"
import "../components/itemdetails"
/**
* This page displays details about a film, show, season, episode, and so on.
*
* It contains the common functionality for all items. Additional components are
* loaded in for every specific type of items, from ../components/itemdetails.
*/
Page {
id: pageRoot
property string itemId: ""

View file

@ -4,6 +4,12 @@ import Sailfish.Silica 1.0
import "../components"
/**
* This page contains legal information about snippets and 3rd party libraries.
*
* Displaying them is done by loading ../3rdparty.xml, which contains a list of all
* the included snippets/libraries and their licenses.
*/
Page {
allowedOrientations: Orientation.All
@ -32,7 +38,7 @@ Page {
}
PlainLabel {
text: qsTr("The Sailfin application contains some code from other projects. Without them, Sailfin would " +
text: qsTr("Sailfin contains code taken from other projects. Without them, Sailfin would " +
"not be possible!")
}

View file

@ -5,31 +5,15 @@ import nl.netsoj.chris.Jellyfin 1.0
import "../components"
// Test
/**
* Main page, which simply shows some content of every library, as well as next items.
*/
Page {
id: page
property bool _modelsLoaded: false
// The effective value will be restricted by ApplicationWindow.allowedOrientations
id: page
allowedOrientations: Orientation.All
property bool _modelsLoaded: false
Connections {
target: ApiClient
onAuthenticatedChanged: {
if (authenticated && !_modelsLoaded) loadModels();
}
}
Component.onCompleted: {
if (ApiClient.authenticated && _modelsLoaded) {
loadModels();
}
}
// To enable PullDownMenu, place our content in a SilicaFlickable
SilicaFlickable {
anchors.fill: parent
@ -48,7 +32,6 @@ Page {
// Tell SilicaFlickable the height of its content.
contentHeight: column.height
// Place our content in a Column. The PageHeader is always placed at the top
// of the page, followed by our content.
Column {
@ -120,7 +103,19 @@ Page {
}
}
}
Connections {
target: ApiClient
onAuthenticatedChanged: {
if (authenticated && !_modelsLoaded) loadModels();
}
}
Component.onCompleted: {
if (ApiClient.authenticated && _modelsLoaded) {
loadModels();
}
}
function loadModels() {
_modelsLoaded = true;
mediaLibraryModel.reload()

View file

@ -3,30 +3,31 @@ import Sailfish.Silica 1.0
import "../components"
/**
* Page only containing a video player.
*
* On larger devices the video player could potentially be embedded somewhere else.
*/
Page {
id: videoPage
property string itemId
property var itemData
allowedOrientations: Orientation.All
palette.colorScheme: Theme.LightOnDark
showNavigationIndicator: videoPlayer.hudVisible
Rectangle {
anchors.fill: parent
color: "black"
}
VideoPlayer {
id: videoPlayer
anchors.fill: parent
itemId: videoPage.itemId
player: appWindow.mediaPlayer
title: itemData.Name
onLandscapeChanged: {
console.log("Is landscape: " + landscape)
//appWindow.orientation = landscape ? Orientation.Landscape : Orientation.Portrait
videoPage.allowedOrientations = landscape ? Orientation.LandscapeMask : Orientation.PortraitMask
}
player: appWindow.mediaPlayer
title: itemData.Name
}
onStatusChanged: {

View file

@ -2,6 +2,9 @@ import QtQuick 2.6
import Sailfish.Silica 1.0
import nl.netsoj.chris.Jellyfin 1.0
/**
* Page to indicate that the application is connecting to a server.
*/
Page {
property string serverName
property string serverAddress

View file

@ -2,6 +2,11 @@ import QtQuick 2.6
import Sailfish.Silica 1.0
import nl.netsoj.chris.Jellyfin 1.0
/**
* Dialog showed when the user has to connect to a Jellyfin server.
*
* This dialog allows manual address entry or use one of the addresses discovered via UDP broadcasts.
*/
Dialog {
id: dialogRoot
allowedOrientations: Orientation.All

View file

@ -4,6 +4,11 @@ import nl.netsoj.chris.Jellyfin 1.0
import "../../components"
/**
* Page where the user can login on their server. Is displayed after the AddServerPage successfully connected
* to a Jellyfin server. This page also displays a login message and, if applicable, a list of public users.
*/
Dialog {
property string loginMessage
property Page firstPage