Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Thomas Perl
e95ec1f76a Experimental tablet UI 2015-03-07 17:38:12 +01:00
8 changed files with 142 additions and 65 deletions

View file

@ -62,6 +62,10 @@ ListModel {
}); });
} }
onPodcast_idChanged: {
reload();
}
property var worker: ModelWorkerScript { property var worker: ModelWorkerScript {
id: modelWorker id: modelWorker
} }

View file

@ -29,6 +29,7 @@ PListView {
id: episodeList id: episodeList
property int selectedIndex: -1 property int selectedIndex: -1
property alias podcast_id: episodeListModel.podcast_id
PScrollIntoView { id: scrollIntoView } PScrollIntoView { id: scrollIntoView }
@ -42,14 +43,14 @@ PListView {
GPodderEpisodeListModelConnections {} GPodderEpisodeListModelConnections {}
PBusyIndicator { PBusyIndicator {
visible: !episodeListModel.ready visible: !episodeListModel.ready && episodeListModel.podcast_id
anchors.centerIn: parent anchors.centerIn: parent
} }
PPlaceholder { PPlaceholder {
// TODO: If filter is "all", say "No episodes" // TODO: If filter is "all", say "No episodes"
text: 'No episodes found' text: episodeListModel.podcast_id ? 'No episodes found' : 'No podcast selected'
visible: episodeList.count === 0 && episodeListModel.ready visible: (episodeList.count === 0 && episodeListModel.ready) || !episodeListModel.podcast_id
} }
delegate: EpisodeItem { } delegate: EpisodeItem { }

View file

@ -80,12 +80,6 @@ SlidePage {
], undefined, undefined, true); ], undefined, undefined, true);
} }
Component.onCompleted: {
episodeList.model.podcast_id = podcast_id;
// List model will be loaded automatically on load
}
EpisodeQueryControl { EpisodeQueryControl {
id: queryControl id: queryControl
model: episodeList.model model: episodeList.model
@ -95,5 +89,6 @@ SlidePage {
EpisodeListView { EpisodeListView {
id: episodeList id: episodeList
title: page.title title: page.title
podcast_id: page.podcast_id
} }
} }

View file

@ -68,7 +68,7 @@ Item {
// Initial focus // Initial focus
focus: true focus: true
property real scalef: (width < height) ? (width / 480) : (height / 480) property real scalef: 1.0 //(width < height) ? (width / 480) : (height / 480)
property int shorterSide: (width < height) ? width : height property int shorterSide: (width < height) ? width : height
property int dialogsVisible: 0 property int dialogsVisible: 0

View file

@ -25,8 +25,9 @@ import 'common/util.js' as Util
import 'icons/icons.js' as Icons import 'icons/icons.js' as Icons
import 'common/constants.js' as Constants import 'common/constants.js' as Constants
SlidePage { SplitPage {
id: page id: page
position: 0.4
canClose: false canClose: false
@ -91,67 +92,80 @@ SlidePage {
], undefined, undefined, true); ], undefined, undefined, true);
} }
PListView { SplitPane {
id: podcastList PListView {
title: 'Subscriptions' id: podcastList
title: 'Subscriptions'
section.property: 'section' section.property: 'section'
section.delegate: SectionHeader { text: section } section.delegate: SectionHeader { text: section }
PPlaceholder { PPlaceholder {
text: 'No podcasts' text: 'No podcasts'
visible: podcastList.count === 0 visible: podcastList.count === 0
} }
model: podcastListModel model: podcastListModel
delegate: PodcastItem { delegate: PodcastItem {
onClicked: pgst.loadPage('EpisodesPage.qml', {'podcast_id': id, 'title': title}); onClicked: {
onPressAndHold: { episodesPage.podcast_id = id;
pgst.showSelection([ episodesPage.title = title;
{ }//pgst.loadPage('EpisodesPage.qml', {'podcast_id': id, 'title': title});
label: 'Refresh', onPressAndHold: {
callback: function () { pgst.showSelection([
py.call('main.check_for_episodes', [url]); {
label: 'Refresh',
callback: function () {
py.call('main.check_for_episodes', [url]);
},
}, },
}, {
{ label: 'Unsubscribe',
label: 'Unsubscribe', callback: function () {
callback: function () { var ctx = { py: py, id: id };
var ctx = { py: py, id: id }; pgst.showConfirmation(title, 'Unsubscribe', 'Cancel', 'Remove this podcast and all downloaded episodes?', Icons.trash, function () {
pgst.showConfirmation(title, 'Unsubscribe', 'Cancel', 'Remove this podcast and all downloaded episodes?', Icons.trash, function () { ctx.py.call('main.unsubscribe', [ctx.id]);
ctx.py.call('main.unsubscribe', [ctx.id]); });
}); },
}, },
}, {
{ label: 'Rename',
label: 'Rename', callback: function () {
callback: function () { var ctx = { py: py, id: id };
var ctx = { py: py, id: id }; pgst.loadPage('TextInputDialog.qml', {
pgst.loadPage('TextInputDialog.qml', { buttonText: 'Rename',
buttonText: 'Rename', placeholderText: 'New name',
placeholderText: 'New name', text: title,
text: title, callback: function (new_title) {
callback: function (new_title) { ctx.py.call('main.rename_podcast', [ctx.id, new_title]);
ctx.py.call('main.rename_podcast', [ctx.id, new_title]); }
} });
}); }
}
},
{
label: 'Mark episodes as old',
callback: function () {
py.call('main.mark_episodes_as_old', [id]);
}, },
}, {
{ label: 'Mark episodes as old',
label: 'Podcast details', callback: function () {
callback: function () { py.call('main.mark_episodes_as_old', [id]);
pgst.loadPage('PodcastDetail.qml', {podcast_id: id, title: title}); },
} },
}, {
], title); label: 'Podcast details',
callback: function () {
pgst.loadPage('PodcastDetail.qml', {podcast_id: id, title: title});
}
},
], title);
}
} }
} }
} }
SplitPane {
EpisodesPage {
id: episodesPage
anchors.fill: parent
}
}
} }

34
touch/SplitPage.qml Normal file
View file

@ -0,0 +1,34 @@
/**
*
* gPodder QML UI Reference Implementation
* Copyright (c) 2015, Thomas Perl <m@thp.io>
*
* 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 'common/constants.js' as Constants
SlidePage {
id: splitPage
property real position: 0.5
Component.onCompleted: {
children[0].width = Qt.binding(function () { return splitPage.width * splitPage.position; });
children[1].width = Qt.binding(function () { return splitPage.width * (1.0 - splitPage.position); });
children[1].x = Qt.binding(function () { return children[0].width; });
}
}

29
touch/SplitPane.qml Normal file
View file

@ -0,0 +1,29 @@
/**
*
* gPodder QML UI Reference Implementation
* Copyright (c) 2015, Thomas Perl <m@thp.io>
*
* 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
Item {
anchors {
top: parent.top
bottom: parent.bottom
}
}

View file

@ -24,7 +24,7 @@ import 'common/constants.js' as Constants
Rectangle { Rectangle {
color: Constants.colors.page color: Constants.colors.page
width: 480 width: 1280
height: 800 height: 800
Main {} Main {}