Make refreshing a boolean property of GPodderCore

This commit is contained in:
Thomas Perl 2014-02-03 19:57:35 +01:00
parent fdaa87df4c
commit 3b53c3c557
2 changed files with 4 additions and 14 deletions

View file

@ -27,6 +27,7 @@ Python {
property string progname: 'gpodder'
property bool ready: false
property bool refreshing: false
signal downloading(int episode_id)
signal downloadProgress(int episode_id, real progress)
signal playbackProgress(int episode_id, real progress)
@ -54,6 +55,7 @@ Python {
setHandler('podcast-list-changed', py.podcastListChanged);
setHandler('updating-podcast', py.updatingPodcast);
setHandler('updated-podcast', py.updatedPodcast);
setHandler('refreshing', function(v) { py.refreshing = v; });
var path = Qt.resolvedUrl('../..').substr('file://'.length);
addImportPath(path);

View file

@ -110,22 +110,9 @@ SlidePage {
StartPageButton {
id: freshEpisodesPage
title: 'Fresh episodes'
title: py.refreshing ? 'Refreshing feeds' : 'Fresh episodes'
onClicked: pgst.loadPage('FreshEpisodes.qml');
Component.onCompleted: {
py.setHandler('refreshing', function (is_refreshing) {
refresherButtonArea.visible = !is_refreshing;
if (!is_refreshing) {
freshEpisodesPage.title = 'Fresh episodes';
}
});
py.setHandler('refresh-progress', function (pos, total) {
freshEpisodesPage.title = 'Refreshing feeds (' + pos + '/' + total + ')';
});
}
Row {
anchors.bottom: parent.bottom
anchors.bottomMargin: 50 * pgst.scalef
@ -157,6 +144,7 @@ SlidePage {
ButtonArea {
id: refresherButtonArea
visible: !py.refreshing
anchors {
bottom: parent.bottom