Stats on cover, refresh cover action, refresh spinner

This commit is contained in:
Thomas Perl 2014-02-10 21:29:00 +01:00
parent 63070138b0
commit 943ac98b01
3 changed files with 50 additions and 2 deletions

@ -1 +1 @@
Subproject commit 0ff355737c911e24fcf0404d083fa1c69f6b4a57 Subproject commit ccd4a4dc17eba1effc40e3be449414f99c8a6d59

View file

@ -56,5 +56,14 @@ CoverBackground {
iconSource: 'image://theme/icon-cover-play' iconSource: 'image://theme/icon-cover-play'
onTriggered: player.play(); onTriggered: player.play();
} }
CoverAction {
iconSource: 'image://theme/icon-cover-refresh'
onTriggered: {
if (!py.refreshing) {
py.call('main.check_for_episodes');
}
}
}
} }
} }

View file

@ -21,8 +21,47 @@
import QtQuick 2.0 import QtQuick 2.0
import Sailfish.Silica 1.0 import Sailfish.Silica 1.0
import 'common/util.js' as Util
CoverPlaceholder { CoverPlaceholder {
id: podcastsCover
icon.source: '/usr/share/icons/hicolor/86x86/apps/harbour-org.gpodder.sailfish.png' icon.source: '/usr/share/icons/hicolor/86x86/apps/harbour-org.gpodder.sailfish.png'
text: 'gPodder\n' + podcastListModel.count + ' podcasts' property string _info_text: 'gPodder'
text: refreshingIndicator.visible ? '' : _info_text
function update_stats() {
py.call('main.get_stats', [], function (result) {
podcastsCover._info_text = Util.format(
'{podcasts} podcasts\n' +
'{episodes} episodes\n' +
'{newEpisodes} new episodes\n' +
'{downloaded} downloaded',
result);
});
}
Connections {
target: py
onUpdateStats: podcastsCover.update_stats();
onReadyChanged: {
if (py.ready) {
podcastsCover.update_stats();
}
}
}
BusyIndicator {
id: refreshingIndicator
visible: running
running: py.refreshing
anchors.centerIn: parent
NumberAnimation on rotation {
from: 0; to: 360
duration: 2000
running: py.refreshing
loops: Animation.Infinite
}
}
} }