mirror of https://github.com/KDE/kasts.git
Make application remember the last opened main page
This commit is contained in:
parent
fbaf084a37
commit
218b86807e
|
@ -20,7 +20,9 @@ Kirigami.ApplicationWindow {
|
|||
|
||||
title: "Alligator"
|
||||
|
||||
pageStack.initialPage: feedList
|
||||
pageStack.initialPage: SettingsManager.lastOpenedPage === "FeedListPage" ? feedList
|
||||
: SettingsManager.lastOpenedPage === "QueuePage" ? queueList
|
||||
: feedList
|
||||
|
||||
globalDrawer: Kirigami.GlobalDrawer {
|
||||
isMenu: true
|
||||
|
@ -29,14 +31,16 @@ Kirigami.ApplicationWindow {
|
|||
text: i18n("Queue")
|
||||
iconName: "source-playlist"
|
||||
onTriggered: {
|
||||
SettingsManager.lastOpenedPage = "QueuePage" // for persistency
|
||||
pageStack.clear()
|
||||
pageStack.push(queuelist)
|
||||
pageStack.push(queueList)
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: i18n("Subscriptions")
|
||||
iconName: "rss"
|
||||
onTriggered: {
|
||||
SettingsManager.lastOpenedPage = "FeedListPage" // for persistency
|
||||
pageStack.clear()
|
||||
pageStack.push(feedList)
|
||||
}
|
||||
|
@ -72,7 +76,7 @@ Kirigami.ApplicationWindow {
|
|||
}
|
||||
|
||||
QueuePage {
|
||||
id: queuelist
|
||||
id: queueList
|
||||
}
|
||||
|
||||
Audio {
|
||||
|
@ -81,6 +85,7 @@ Kirigami.ApplicationWindow {
|
|||
property var entry
|
||||
property bool playerOpen: false
|
||||
|
||||
onEntryChanged: SettingsManager.lastPlayingEntry = entry.id
|
||||
source: entry ? (entry.enclosure ? "file://" + entry.enclosure.path : "") : ""
|
||||
//source: entry.enclosure.url
|
||||
onError: console.debug(errorString)
|
||||
|
|
|
@ -38,4 +38,14 @@
|
|||
<default>0</default>
|
||||
</entry>
|
||||
</group>
|
||||
<group name="Persistency">
|
||||
<entry name="lastOpenedPage" type="String">
|
||||
<label>The top-level page that was open at shutdown</label>
|
||||
<default>FeedListPage</default>
|
||||
</entry>
|
||||
<entry name="lastPlayingEntry" type="String">
|
||||
<label>The entry that was being played at shutdown</label>
|
||||
<default>none</default>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
||||
|
|
Loading…
Reference in New Issue