Remove EpisodeSwipePage; only showing all episodes for now

The "New Episodes" tab is to be replaced by a filter view button and
dialog to be able to filter several episode statuses.  I.e. new,
played / not played, etc.
This commit is contained in:
Bart De Vries 2021-07-02 16:06:32 +02:00
parent c7676d51a4
commit 59c4894639
4 changed files with 16 additions and 111 deletions

View File

@ -15,6 +15,8 @@ import org.kde.kasts 1.0
Kirigami.ScrollablePage {
title: i18n("Episode List")
property var episodeType: EpisodeModel.All
supportsRefreshing: true
@ -25,11 +27,13 @@ Kirigami.ScrollablePage {
}
}
actions.main: Kirigami.Action {
iconName: "view-refresh"
text: i18n("Refresh All Podcasts")
onTriggered: refreshing = true
visible: Kirigami.Settings.isMobile && episodeList.count === 0
actions {
main: Kirigami.Action {
iconName: "view-refresh"
text: i18n("Refresh All Podcasts")
onTriggered: refreshing = true
visible: !Kirigami.Settings.isMobile || episodeList.count === 0
}
}
Kirigami.PlaceholderMessage {

View File

@ -1,83 +0,0 @@
/**
* SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
import QtQuick 2.14
import QtQuick.Controls 2.14 as Controls
import QtQuick.Layouts 1.14
import QtGraphicalEffects 1.15
import org.kde.kirigami 2.15 as Kirigami
import org.kde.kasts 1.0
Kirigami.Page {
id: page
title: i18n("Episode List")
padding: 0
actions.main: Kirigami.Action {
iconName: "view-refresh"
text: i18n("Refresh All Podcasts")
visible: !Kirigami.Settings.isMobile
onTriggered: updateAllFeeds.run()
}
header: Loader {
id: headerLoader
active: !Kirigami.Settings.isMobile
sourceComponent: tabBarComponent
}
footer: Loader {
id: footerLoader
active: Kirigami.Settings.isMobile
sourceComponent: tabBarComponent
}
Component {
id: tabBarComponent
Controls.TabBar {
id: tabBar
position: Kirigami.Settings.isMobile ? Controls.TabBar.Footer : Controls.TabBar.Header
currentIndex: swipeView.currentIndex
contentHeight: tabBarHeight
Controls.TabButton {
width: parent.parent.width/parent.count
height: tabBarHeight
text: i18n("New Episodes")
}
Controls.TabButton {
width: parent.parent.width/parent.count
height: tabBarHeight
text: i18n("All Episodes")
}
}
}
contentItem: Controls.SwipeView {
id: swipeView
anchors {
top: page.header.bottom
right: page.right
left: page.left
bottom: page.footer.top
}
currentIndex: Kirigami.Settings.isMobile ? footerLoader.item.currentIndex : headerLoader.item.currentIndex
EpisodeListPage {
title: i18n("New Episodes")
episodeType: EpisodeModel.New
}
EpisodeListPage {
title: i18n("All Episodes")
episodeType: EpisodeModel.All
}
}
}

View File

@ -21,9 +21,7 @@ Kirigami.ApplicationWindow {
minimumHeight: Kirigami.Units.gridUnit * 20
property var miniplayerSize: Kirigami.Units.gridUnit * 3 + Kirigami.Units.gridUnit / 6
property int tabBarHeight: Kirigami.Units.gridUnit * 2
property int bottomMessageSpacing: Kirigami.Settings.isMobile ? Kirigami.Units.largeSpacing * 9 + ( AudioManager.entry ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + tabBarActive * tabBarHeight : Kirigami.Units.largeSpacing * 2
property int tabBarActive: 0
property int bottomMessageSpacing: Kirigami.Settings.isMobile ? Kirigami.Units.largeSpacing * 9 + ( AudioManager.entry ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) : Kirigami.Units.largeSpacing * 2
property int originalWidth: Kirigami.Units.gridUnit * 10
property var lastFeed: ""
property string currentPage: ""
@ -37,7 +35,7 @@ Kirigami.ApplicationWindow {
function getPage(page) {
switch (page) {
case "QueuePage": return "qrc:/QueuePage.qml";
case "EpisodeSwipePage": return "qrc:/EpisodeSwipePage.qml";
case "EpisodeListPage": return "qrc:/EpisodeListPage.qml";
case "DiscoverPage": return "qrc:/DiscoverPage.qml";
case "FeedListPage": return "qrc:/FeedListPage.qml";
case "DownloadListPage": return "qrc:/DownloadListPage.qml";
@ -53,12 +51,6 @@ Kirigami.ApplicationWindow {
}
Component.onCompleted: {
tabBarActive = SettingsManager.lastOpenedPage === "FeedListPage" ? 0
: SettingsManager.lastOpenedPage === "QueuePage" ? 0
: SettingsManager.lastOpenedPage === "EpisodeSwipePage" ? 1
: SettingsManager.lastOpenedPage === "DownloadListPage" ? 0
: SettingsManager.lastOpenedPage === "DiscoverPage" ? 0
: 0
currentPage = SettingsManager.lastOpenedPage
pageStack.initialPage = getPage(SettingsManager.lastOpenedPage)
@ -94,7 +86,7 @@ Kirigami.ApplicationWindow {
}
// make room at the bottom for miniplayer
handle.anchors.bottomMargin: (( AudioManager.entry && Kirigami.Settings.isMobile ) ? (footerLoader.item.contentY == 0 ? miniplayerSize : 0) : 0) + Kirigami.Units.smallSpacing + tabBarActive * tabBarHeight
handle.anchors.bottomMargin: (( AudioManager.entry && Kirigami.Settings.isMobile ) ? (footerLoader.item.contentY == 0 ? miniplayerSize : 0) : 0) + Kirigami.Units.smallSpacing
handleVisible: Kirigami.Settings.isMobile ? !AudioManager.entry || footerLoader.item.contentY === 0 : false
showHeaderWhenCollapsed: true
actions: [
@ -105,7 +97,6 @@ Kirigami.ApplicationWindow {
onTriggered: {
pushPage("QueuePage")
SettingsManager.lastOpenedPage = "QueuePage" // for persistency
tabBarActive = 0
}
},
Kirigami.Action {
@ -115,17 +106,15 @@ Kirigami.ApplicationWindow {
onTriggered: {
pushPage("DiscoverPage")
SettingsManager.lastOpenedPage = "DiscoverPage" // for persistency
tabBarActive = 0
}
},
Kirigami.Action {
text: i18n("Episodes")
iconName: "rss"
checked: currentPage == "EpisodeSwipePage"
checked: currentPage == "EpisodeListPage"
onTriggered: {
pushPage("EpisodeSwipePage")
SettingsManager.lastOpenedPage = "EpisodeSwipePage" // for persistency
tabBarActive = 1
pushPage("EpisodeListPage")
SettingsManager.lastOpenedPage = "EpisodeListPage" // for persistency
}
},
Kirigami.Action {
@ -135,7 +124,6 @@ Kirigami.ApplicationWindow {
onTriggered: {
pushPage("FeedListPage")
SettingsManager.lastOpenedPage = "FeedListPage" // for persistency
tabBarActive = 0
}
},
Kirigami.Action {
@ -145,7 +133,6 @@ Kirigami.ApplicationWindow {
onTriggered: {
pushPage("DownloadListPage")
SettingsManager.lastOpenedPage = "DownloadListPage" // for persistency
tabBarActive = 0
}
},
Kirigami.Action {
@ -154,7 +141,6 @@ Kirigami.ApplicationWindow {
checked: currentPage == "SettingsPage"
onTriggered: {
pushPage("SettingsPage")
tabBarActive = 0
}
},
Kirigami.Action {
@ -163,7 +149,6 @@ Kirigami.ApplicationWindow {
checked: currentPage == "AboutPage"
onTriggered: {
pushPage("AboutPage")
tabBarActive = 0
}
}
]
@ -191,7 +176,7 @@ Kirigami.ApplicationWindow {
contextDrawer: Kirigami.ContextDrawer {
id: contextDrawer
// make room at the bottom for miniplayer
handle.anchors.bottomMargin: ( (AudioManager.entry && Kirigami.Settings.isMobile) ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + Kirigami.Units.smallSpacing + tabBarActive * tabBarHeight
handle.anchors.bottomMargin: ( (AudioManager.entry && Kirigami.Settings.isMobile) ? ( footerLoader.item.contentY == 0 ? miniplayerSize : 0 ) : 0 ) + Kirigami.Units.smallSpacing
handleVisible: Kirigami.Settings.isMobile ? !AudioManager.entry || footerLoader.item.contentY === 0 : false
}

View File

@ -18,7 +18,6 @@
<file alias="EpisodeListPage.qml">qml/EpisodeListPage.qml</file>
<file alias="DownloadListPage.qml">qml/DownloadListPage.qml</file>
<file alias="ErrorListOverlay.qml">qml/ErrorListOverlay.qml</file>
<file alias="EpisodeSwipePage.qml">qml/EpisodeSwipePage.qml</file>
<file alias="GenericHeader.qml">qml/GenericHeader.qml</file>
<file alias="GenericEntryDelegate.qml">qml/GenericEntryDelegate.qml</file>
<file alias="DiscoverPage.qml">qml/DiscoverPage.qml</file>