Toolbar with back button, menu and play throbber

This commit is contained in:
Thomas Perl 2014-03-17 17:40:29 +01:00
parent 532a99edea
commit 7bdf6b783a
19 changed files with 298 additions and 129 deletions

View file

@ -34,6 +34,36 @@ SlidePage {
width: parent.width
height: parent.height
hasMenuButton: true
menuButtonLabel: 'Settings'
onMenuButtonClicked: {
pgst.showSelection([
{
label: 'Filter list (' + queryControl.currentFilter + ')',
callback: function () {
queryControl.showSelectionDialog();
}
},
{
label: 'Mark episodes as old',
callback: function () {
py.call('main.mark_episodes_as_old', [episodesPage.podcast_id]);
},
},
{
label: 'Unsubscribe',
callback: function () {
var ctx = { py: py, id: episodesPage.podcast_id, page: episodesPage };
pgst.showConfirmation('Unsubscribe', Icons.trash, function () {
ctx.py.call('main.unsubscribe', [ctx.id]);
ctx.page.closePage();
});
},
},
]);
}
Component.onCompleted: {
episodeListModel.podcast_id = podcast_id;
episodeListModel.setQuery(episodeListModel.queries.All);
@ -52,35 +82,6 @@ SlidePage {
title: episodesPage.title
model: GPodderEpisodeListModel { id: episodeListModel }
headerIcon: Icons.cog
headerIconText: 'Settings'
onHeaderIconClicked: {
pgst.showSelection([
{
label: 'Filter list (' + queryControl.currentFilter + ')',
callback: function () {
queryControl.showSelectionDialog();
}
},
{
label: 'Mark episodes as old',
callback: function () {
py.call('main.mark_episodes_as_old', [episodesPage.podcast_id]);
},
},
{
label: 'Unsubscribe',
callback: function () {
var ctx = { py: py, id: episodesPage.podcast_id, page: episodesPage };
pgst.showConfirmation('Unsubscribe', Icons.trash, function () {
ctx.py.call('main.unsubscribe', [ctx.id]);
ctx.page.closePage();
});
},
},
]);
}
PPlaceholder {
text: 'No episodes'
visible: episodeList.count === 0