diff --git a/qml/EpisodeItem.qml b/qml/EpisodeItem.qml index e6556df..df97f16 100644 --- a/qml/EpisodeItem.qml +++ b/qml/EpisodeItem.qml @@ -78,7 +78,7 @@ ListItem { margins: 30 * pgst.scalef } - elide: Text.ElideRight + truncationMode: TruncationMode.Fade text: title opacity: { @@ -96,7 +96,7 @@ ListItem { anchors { right: parent.right verticalCenter: parent.verticalCenter - margins: 30 * pgst.scalef + rightMargin: (30 * pgst.scalef) * (text != '') } font.pixelSize: parent.contentHeight diff --git a/qml/EpisodesPage.qml b/qml/EpisodesPage.qml index 2278ec7..451d43a 100644 --- a/qml/EpisodesPage.qml +++ b/qml/EpisodesPage.qml @@ -92,6 +92,11 @@ Page { delegate: EpisodeItem { onClicked: pgst.loadPage('EpisodeDetail.qml', {episode_id: id, title: title}); } + + ViewPlaceholder { + enabled: episodeList.count == 0 + text: 'No episodes' + } } } diff --git a/qml/Main.qml b/qml/Main.qml index 6857b0a..bdfbd6f 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -22,14 +22,12 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 import io.thp.pyotherside 1.0 -Page { +PodcastsPage { id: pgst property bool ready: false property real scalef: width / 480 - anchors.fill: parent - function update(page, x) { var index = -1; for (var i=0; i - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - -import QtQuick 2.0 -import Sailfish.Silica 1.0 - -Page { - id: startPage - - function update_stats() { - py.call('main.get_stats', [], function (result) { - stats.text = result; - }); - - py.call('main.get_fresh_episodes_summary', [3], function (episodes) { - freshEpisodesRepeater.model = episodes; - }); - } - - Component.onCompleted: { - py.setHandler('update-stats', startPage.update_stats); - } - - Component.onDestruction: { - py.setHandler('update-stats', undefined); - } - - SilicaFlickable { - id: startPageFlickable - - PullDownMenu { - MenuItem { - text: 'Now playing' - onClicked: pgst.loadPage('PlayerPage.qml'); - } - MenuItem { - text: "Settings" - onClicked: pgst.loadPage('Settings.qml'); - } - } - - VerticalScrollDecorator { flickable: startPageFlickable } - - Connections { - target: pgst - onReadyChanged: { - if (pgst.ready) { - startPage.update_stats(); - } - } - } - - anchors.fill: parent - - contentWidth: startPageColumn.width - contentHeight: startPageColumn.height + startPageColumn.spacing - - Column { - id: startPageColumn - - width: startPage.width - spacing: 20 * pgst.scalef - - PageHeader { - title: 'gPodder' - } - - SectionHeader { - text: 'Subscriptions' - } - - BackgroundItem { - id: subscriptionsPane - - onClicked: pgst.loadPage('PodcastsPage.qml'); - width: startPage.width - height: startPage.height / 5 - - Label { - id: stats - - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - margins: 20 * pgst.scalef - } - } - } - - SectionHeader { - id: freshEpisodesHeader - text: 'Fresh episodes' - } - - BackgroundItem { - id: freshEpisodesPage - height: startPage.height / 6 - width: parent.width - - onClicked: pgst.loadPage('FreshEpisodes.qml'); - - Component.onCompleted: { - py.setHandler('refreshing', function (is_refreshing) { - if (!is_refreshing) { - freshEpisodesHeader.text = 'Fresh episodes'; - } - }); - - py.setHandler('refresh-progress', function (pos, total) { - freshEpisodesHeader.text = 'Refreshing feeds (' + pos + '/' + total + ')'; - }); - } - - Row { - id: freshRow - - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.margins: spacing - - spacing: 10 * pgst.scalef - - Repeater { - id: freshEpisodesRepeater - - Image { - source: modelData.coverart - sourceSize { width: 80 * pgst.scalef; height: 80 * pgst.scalef } - width: 80 * pgst.scalef - height: 80 * pgst.scalef - - /* - Label { - anchors { - horizontalCenter: parent.horizontalCenter - bottom: parent.bottom - } - - text: modelData.newEpisodes - } - */ - } - } - } - } - } - } -} - diff --git a/qml/StartPageButton.qml b/qml/StartPageButton.qml deleted file mode 100644 index 1e5d959..0000000 --- a/qml/StartPageButton.qml +++ /dev/null @@ -1,35 +0,0 @@ - -/** - * - * gPodder QML UI Reference Implementation - * Copyright (c) 2013, Thomas Perl - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - */ - -import QtQuick 2.0 -import Sailfish.Silica 1.0 - -Column { - id: startPageButton - property string title - - anchors.horizontalCenter: parent.horizontalCenter - width: parent.width * .9 - height: 200 * pgst.scalef - - SectionHeader { - text: startPageButton.title - } -}