[-]
[+]
|
Changed |
_service:tar_git:harbour-org.gpodder.sailfish.spec
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-org.gpodder.sailfish-4.0.0.tar.gz/gpodder-ui-qml/common/GPodderCore.qml
^
|
@@ -35,6 +35,7 @@
signal updatedPodcast(var podcast)
signal episodeListChanged(int podcast_id)
signal updatedEpisode(var episode)
+ signal updateStats()
Component.onCompleted: {
setHandler('hello', function (coreversion, uiversion) {
@@ -52,6 +53,7 @@
setHandler('refreshing', function(v) { py.refreshing = v; });
setHandler('episode-list-changed', py.episodeListChanged);
setHandler('updated-episode', py.updatedEpisode);
+ setHandler('update-stats', py.updateStats);
addImportPath(Qt.resolvedUrl('../..'));
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-org.gpodder.sailfish-4.0.0.tar.gz/gpodder-ui-qml/common/util.js
^
|
@@ -69,3 +69,9 @@
item.enabled = true;
});
}
+
+function format(s, d) {
+ return s.replace(/{([^}]*)}/g, function (m, k) {
+ return (k in d) ? d[k] : m;
+ });
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-org.gpodder.sailfish-4.0.0.tar.gz/gpodder-ui-qml/main.py
^
|
@@ -96,12 +96,12 @@
downloaded += do
unplayed += un
- return '\n'.join([
- '%d podcasts' % len(podcasts),
- '%d episodes' % total,
- '%d new episodes' % new,
- '%d downloads' % downloaded,
- ])
+ return {
+ 'podcasts': len(podcasts),
+ 'episodes': total,
+ 'newEpisodes': new,
+ 'downloaded': downloaded,
+ }
def _get_cover(self, podcast):
filename = self.core.cover_downloader.get_cover(podcast)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-org.gpodder.sailfish-4.0.0.tar.gz/gpodder-ui-qml/touch/StartPage.qml
^
|
@@ -22,6 +22,7 @@
import 'icons/icons.js' as Icons
import 'common/constants.js' as Constants
+import 'common/util.js' as Util
SlidePage {
id: startPage
@@ -29,7 +30,12 @@
function update_stats() {
py.call('main.get_stats', [], function (result) {
- stats.text = result;
+ stats.text = Util.format(
+ '{podcasts} podcasts\n' +
+ '{episodes} episodes\n' +
+ '{newEpisodes} new episodes\n' +
+ '{downloaded} downloaded',
+ result);
});
py.call('main.get_fresh_episodes_summary', [3], function (episodes) {
@@ -37,12 +43,11 @@
});
}
- Component.onCompleted: {
- py.setHandler('update-stats', startPage.update_stats);
- }
-
- Component.onDestruction: {
- py.setHandler('update-stats', undefined);
+ Item {
+ Connections {
+ target: py
+ onUpdateStats: startPage.update_stats();
+ }
}
Flickable {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-org.gpodder.sailfish-4.0.0.tar.gz/qml/CoverContainer.qml
^
|
@@ -56,5 +56,14 @@
iconSource: 'image://theme/icon-cover-play'
onTriggered: player.play();
}
+
+ CoverAction {
+ iconSource: 'image://theme/icon-cover-refresh'
+ onTriggered: {
+ if (!py.refreshing) {
+ py.call('main.check_for_episodes');
+ }
+ }
+ }
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-org.gpodder.sailfish-4.0.0.tar.gz/qml/PodcastsCover.qml
^
|
@@ -21,8 +21,47 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
+import 'common/util.js' as Util
CoverPlaceholder {
+ id: podcastsCover
+
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
+ }
+ }
}
|