1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-06 02:32:44 +00:00

sailfish: allow configuring the startup page

A setting has been added to allow users to select which page should be
opened first. This allows for using Sailfin as a music player
exclusively, as proposed in #34

Special care has been taken to avoid the user being locked out from the
app, for when the library selected as home has been deleted on the
server side. It is real tricky to guide the user to delete dconf keys.

Therefore, a pulley menu with access to settings has been added to all
collection pages and to the unknown page. Additionally, when the setting
is changed, it throws away the entire pagestack and replaces it with the
new home page + the settings page, so the user can always navigate back.
The navigation history of the user will get lost, but otherwise the
implementation gets to complex for a feature that is expected to be used
not that often.

This uses more timers than I hoped for, because otherwise things are
undefined for some reason which I do not know and using timers solves
it. :(
This commit is contained in:
Chris Josten 2024-01-02 21:43:45 +01:00
parent 3c02985990
commit a35d8026be
6 changed files with 167 additions and 8 deletions

View file

@ -1,6 +1,6 @@
/*
Sailfin: a Jellyfin client written using Qt
Copyright (C) 2020 Chris Josten
Copyright (C) 2020-2024 Chris Josten
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -27,6 +27,20 @@ BaseDetailPage {
PageHeader {
title: itemData.name
}
PullDownMenu {
// If for some reason the initial library item is not accessible, we must be able
// to access the settings.
MenuItem {
//: Pulley menu item: navigate to application settings page
text: qsTr("Settings")
onClicked: pageStack.push(Qt.resolvedUrl("../SettingsPage.qml"))
}
MenuItem {
//: Pulley menu item: shows controllable device page
text: qsTr("Remote control")
onClicked: pageStack.push(Qt.resolvedUrl("../ControllableDevicesPage.qml"))
}
}
ViewPlaceholder {
enabled: true