2020-09-27 18:38:33 +00:00
|
|
|
/*
|
|
|
|
Sailfin: a Jellyfin client written using Qt
|
|
|
|
Copyright (C) 2020 Chris Josten
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
2020-09-26 21:29:45 +00:00
|
|
|
import QtQuick 2.6
|
|
|
|
import Sailfish.Silica 1.0
|
|
|
|
|
2021-07-31 13:06:17 +00:00
|
|
|
import nl.netsoj.chris.Jellyfin 1.0 as J
|
2020-09-26 21:29:45 +00:00
|
|
|
|
|
|
|
import "../components"
|
2021-08-11 21:35:33 +00:00
|
|
|
import ".."
|
2020-09-26 21:29:45 +00:00
|
|
|
|
|
|
|
Page {
|
|
|
|
id: settingsPage
|
2021-02-16 16:25:11 +00:00
|
|
|
allowedOrientations: Orientation.All
|
2020-09-26 21:29:45 +00:00
|
|
|
|
2021-08-17 22:04:27 +00:00
|
|
|
property alias loggedInUser: userLoader.data
|
|
|
|
|
2020-09-26 21:29:45 +00:00
|
|
|
SilicaFlickable {
|
|
|
|
anchors.fill: parent
|
|
|
|
contentHeight: content.height
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: content
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
RemorsePopup {
|
|
|
|
id: remorse
|
|
|
|
}
|
|
|
|
|
|
|
|
PageHeader {
|
|
|
|
//: Header of Settings page
|
|
|
|
title: qsTr("Settings")
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SectionHeader {
|
|
|
|
text: qsTr("Session")
|
|
|
|
}
|
|
|
|
|
2020-10-10 13:56:04 +00:00
|
|
|
Item {
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
leftMargin: Theme.horizontalPageMargin
|
|
|
|
right: parent.right
|
|
|
|
rightMargin: Theme.horizontalPageMargin
|
|
|
|
}
|
|
|
|
height: user.implicitHeight + server.implicitHeight + Theme.paddingMedium
|
2021-08-17 22:04:27 +00:00
|
|
|
J.UserLoader{
|
|
|
|
id: userLoader
|
|
|
|
apiClient: appWindow.apiClient
|
|
|
|
userId: appWindow.apiClient.userId
|
2020-10-10 13:56:04 +00:00
|
|
|
}
|
2021-01-14 19:35:24 +00:00
|
|
|
RemoteImage {
|
2020-10-10 13:56:04 +00:00
|
|
|
id: userIcon
|
|
|
|
width: height
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
top: parent.top
|
|
|
|
bottom: parent.bottom
|
|
|
|
}
|
2021-08-11 21:35:33 +00:00
|
|
|
source: apiClient.baseUrl + "/Users/" + apiClient.userId + "/Images/Primary?tag=" + loggedInUser.primaryImageTag
|
2020-10-10 13:56:04 +00:00
|
|
|
}
|
2020-09-26 21:29:45 +00:00
|
|
|
|
2020-10-10 13:56:04 +00:00
|
|
|
Label {
|
|
|
|
id: user
|
|
|
|
anchors {
|
|
|
|
left: userIcon.right
|
|
|
|
leftMargin: Theme.paddingLarge
|
|
|
|
bottom: parent.verticalCenter
|
|
|
|
right: parent.right
|
|
|
|
}
|
2021-08-17 22:04:27 +00:00
|
|
|
text: userLoader.status === J.UserLoader.Ready ? loggedInUser.name : apiClient.userId
|
2020-10-10 13:56:04 +00:00
|
|
|
color: Theme.highlightColor
|
|
|
|
}
|
2020-09-26 21:29:45 +00:00
|
|
|
|
2020-10-10 13:56:04 +00:00
|
|
|
Label {
|
|
|
|
id: server
|
|
|
|
anchors {
|
|
|
|
left: userIcon.right
|
|
|
|
leftMargin: Theme.paddingLarge
|
|
|
|
top: parent.verticalCenter
|
|
|
|
right: parent.right
|
|
|
|
}
|
2021-08-11 21:35:33 +00:00
|
|
|
text: apiClient.baseUrl
|
2020-10-10 13:56:04 +00:00
|
|
|
color: Theme.secondaryHighlightColor
|
|
|
|
}
|
2020-09-26 21:29:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Item { width: 1; height: Theme.paddingLarge; }
|
|
|
|
|
|
|
|
ButtonLayout {
|
|
|
|
Button {
|
|
|
|
text: qsTr("Log out")
|
2021-08-11 21:35:33 +00:00
|
|
|
onClicked: remorse.execute(qsTr("Logging out"), apiClient.deleteSession)
|
2020-09-26 21:29:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SectionHeader {
|
2021-08-11 21:35:33 +00:00
|
|
|
//: Other settings menu item
|
2020-09-26 21:29:45 +00:00
|
|
|
text: qsTr("Other")
|
|
|
|
}
|
|
|
|
|
2021-09-08 19:44:42 +00:00
|
|
|
IconListItem {
|
|
|
|
//: Settings list item for settings related to streaming
|
|
|
|
text: qsTr("Streaming settings")
|
|
|
|
iconSource: "image://theme/icon-m-cloud-download"
|
|
|
|
onClicked: pageStack.push(Qt.resolvedUrl("settings/StreamingPage.qml"))
|
|
|
|
}
|
|
|
|
|
2021-02-13 20:42:57 +00:00
|
|
|
IconListItem {
|
2021-08-11 21:35:33 +00:00
|
|
|
//: Debug information settings menu itemy
|
2021-02-13 20:42:57 +00:00
|
|
|
text: qsTr("Debug information")
|
|
|
|
iconSource: "image://theme/icon-s-developer"
|
|
|
|
onClicked: pageStack.push(Qt.resolvedUrl("settings/DebugPage.qml"))
|
|
|
|
}
|
|
|
|
|
2021-08-11 21:35:33 +00:00
|
|
|
//: About Sailfin settings menu itemy
|
2020-09-26 21:29:45 +00:00
|
|
|
IconListItem {
|
|
|
|
text: qsTr("About Sailfin")
|
|
|
|
iconSource: "image://theme/icon-m-about"
|
|
|
|
onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|