mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2024-11-15 05:55:18 +00:00
Chris Josten
53b3eac213
Features so far: - Login is working, both on back-end and GUI-wise - Saving and reusing login tokens is working - The home page is mostly functional - Show details can be received and displayed in a basic manner Following features are taken into account, but have not been fully implemented: - Support for multiple accounts/servers - Securely saving login tokens
66 lines
1.5 KiB
QML
66 lines
1.5 KiB
QML
import QtQuick 2.0
|
|
import Sailfish.Silica 1.0
|
|
import nl.netsoj.chris.Jellyfin 1.0
|
|
import Nemo.Notifications 1.0
|
|
|
|
import "components"
|
|
import "pages"
|
|
|
|
ApplicationWindow {
|
|
id: appWindow
|
|
property bool isInSetup: false
|
|
property bool _hasInitialized: false
|
|
//property alias backdrop: backdrop
|
|
|
|
Connections {
|
|
target: ApiClient
|
|
onNetworkError: errorNotification.show("Network error: " + error)
|
|
onConnectionFailed: errorNotification.show("Connect error: " + error)
|
|
//onConnectionSuccess: errorNotification.show("Success: " + loginMessage)
|
|
}
|
|
|
|
/*GlassyBackground {
|
|
id: backdrop
|
|
anchors.fill: parent
|
|
opacity: status == Image.Ready ? 1.0 : 0.0
|
|
Behavior on opacity { NumberAnimation { duration: 300 } }
|
|
|
|
function clear() {
|
|
source = ""
|
|
}
|
|
}*/
|
|
|
|
initialPage: Component {
|
|
MainPage {
|
|
Connections {
|
|
target: ApiClient
|
|
onSetupRequired: {
|
|
if (!isInSetup) {
|
|
isInSetup = true;
|
|
pageStack.replace(Qt.resolvedUrl("pages/AddServerPage.qml"), {"backNavigation": false});
|
|
}
|
|
}
|
|
}
|
|
onStatusChanged: {
|
|
if (status == PageStatus.Active && !_hasInitialized) {
|
|
_hasInitialized = true;
|
|
ApiClient.initialize();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
cover: Qt.resolvedUrl("cover/CoverPage.qml")
|
|
allowedOrientations: Orientation.All
|
|
|
|
Notification {
|
|
id: errorNotification
|
|
previewSummary: "foo"
|
|
isTransient: true
|
|
|
|
function show(data) {
|
|
previewSummary = data;
|
|
publish();
|
|
}
|
|
}
|
|
}
|