Remove start page

This commit is contained in:
Thomas Perl 2014-03-15 20:30:34 +01:00
parent debc6519be
commit 579b88cdac
9 changed files with 79 additions and 292 deletions

View file

@ -20,6 +20,8 @@
import QtQuick 2.0
import 'common/constants.js' as Constants
SlidePage {
id: aboutPage
@ -35,35 +37,39 @@ SlidePage {
id: detailColumn
width: aboutPage.width
spacing: 5 * pgst.scalef
spacing: 15 * pgst.scalef
SlidePageHeader {
title: 'About gPodder'
}
SectionHeader {
text: 'How to use'
Column {
width: parent.width
PLabel {
width: parent.width * .95
font.pixelSize: 30 * pgst.scalef
anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Text.WordWrap
text: 'gPodder ' + py.uiversion
color: Constants.colors.highlight
}
PLabel {
width: parent.width * .95
font.pixelSize: 20 * pgst.scalef
anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Text.WordWrap
text: 'http://gpodder.org/'
color: Constants.colors.placeholder
}
}
PLabel {
width: parent.width * .9
width: parent.width * .95
font.pixelSize: 30 * pgst.scalef
anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Text.WordWrap
text: 'Swipe left on a page to reveal the menu for that page. Go back by swiping pages to the right.\n\nAdd subscriptions via their feed URL or use gpodder.net to search for podcasts.'
}
SectionHeader {
text: 'More information'
width: parent.width
}
PLabel {
width: parent.width * .9
font.pixelSize: 20 * pgst.scalef
anchors.horizontalCenter: parent.horizontalCenter
wrapMode: Text.WordWrap
text: [
'© 2005-2014 Thomas Perl and the gPodder Team',
'License: ISC / GPLv3 or later',

View file

@ -25,10 +25,20 @@ import 'common'
SlidePage {
id: directory
function search(text) {
loading.visible = true;
directorySearchModel.search(text, function() {
loading.visible = false;
});
}
ListView {
id: listView
anchors.fill: parent
boundsBehavior: Flickable.StopAtBounds
PScrollDecorator {}
PScrollDecorator { flickable: listView }
model: GPodderDirectorySearchModel { id: directorySearchModel }
@ -53,6 +63,7 @@ SlidePage {
id: input
width: parent.width
placeholderText: 'Search term'
onAccepted: directory.search(input.text);
}
ButtonArea {
@ -65,12 +76,7 @@ SlidePage {
text: 'Search'
}
onClicked: {
loading.visible = true;
directorySearchModel.search(input.text, function() {
loading.visible = false;
});
}
onClicked: directory.search(input.text);
}
}
}

View file

@ -130,8 +130,7 @@ Item {
onClicked: loadPage('PlayerPage.qml');
}
StartPage {
id: startPage
PodcastsPage {
visible: py.ready
}
}

View file

@ -27,25 +27,30 @@ Item {
property alias text: textInput.text
property string placeholderText: ''
signal accepted
height: 50 * pgst.scalef
TextInput {
anchors {
fill: parent
verticalCenter: parent.verticalCenter
left: parent.left
right: parent.right
margins: 5 * pgst.scalef
}
color: Constants.colors.text
selectionColor: Constants.colors.background
id: textInput
font.pixelSize: height
font.pixelSize: parent.height * 0.7
font.family: placeholder.font.family
focus: true
onAccepted: textField.accepted()
}
PLabel {
id: placeholder
anchors.fill: textInput
visible: !textInput.focus && (textInput.text == '')
visible: (textInput.text == '')
text: textField.placeholderText
color: Constants.colors.placeholder
font.pixelSize: textInput.font.pixelSize

View file

@ -27,6 +27,7 @@ import 'common/constants.js' as Constants
SlidePage {
id: podcastsPage
canClose: false
PListView {
id: podcastList
@ -45,12 +46,30 @@ SlidePage {
py.call('main.check_for_episodes');
}
},
{
label: 'Filter episodes',
callback: function () {
pgst.loadPage('EpisodeQueryPage.qml');
}
},
{
label: 'About',
callback: function () {
pgst.loadPage('AboutPage.qml');
},
},
{
label: 'Add new podcast',
callback: function () {
pgst.loadPage('Subscribe.qml');
},
},
{
label: 'Search gpodder.net',
callback: function () {
pgst.loadPage('Directory.qml');
},
},
]);
}

View file

@ -54,6 +54,8 @@ Dialog {
model: selectionDialog.items
delegate: ButtonArea {
id: buttonArea
width: parent.width
height: 60 * pgst.scalef
@ -67,7 +69,7 @@ Dialog {
}
text: modelData
color: (index == selectionDialog.selectedIndex) ? Constants.colors.highlight : Constants.colors.text
color: (index == selectionDialog.selectedIndex || buttonArea.pressed) ? Constants.colors.highlight : Constants.colors.text
}
onClicked: {

View file

@ -1,211 +0,0 @@
/**
*
* gPodder QML UI Reference Implementation
* Copyright (c) 2013, 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 'icons/icons.js' as Icons
import 'common/constants.js' as Constants
import 'common/util.js' as Util
SlidePage {
id: startPage
canClose: false
function update_stats() {
py.call('main.get_stats', [], function (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) {
freshEpisodesRepeater.model = episodes;
});
}
Item {
Connections {
target: py
onUpdateStats: startPage.update_stats();
}
}
Flickable {
id: flickable
boundsBehavior: Flickable.StopAtBounds
Connections {
target: py
onReadyChanged: {
if (py.ready) {
startPage.update_stats();
}
}
}
anchors.fill: parent
contentWidth: startPageColumn.width
contentHeight: startPageColumn.height + startPageColumn.spacing
Column {
id: startPageColumn
width: startPage.width
spacing: 20 * pgst.scalef
SlidePageHeader {
title: 'gPodder'
}
StartPageButton {
id: subscriptionsPane
title: 'Subscriptions'
onClicked: pgst.loadPage('PodcastsPage.qml');
PLabel {
id: stats
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
margins: 20 * pgst.scalef
}
}
ButtonArea {
anchors {
bottom: parent.bottom
right: parent.right
}
transparent: true
onClicked: pgst.loadPage('Subscribe.qml');
width: subscriptions.width + 2*subscriptions.anchors.margins
height: subscriptions.height + 2*subscriptions.anchors.margins
PIcon {
id: subscriptions
icon: Icons.plus
color: Constants.colors.download
anchors {
bottom: parent.bottom
right: parent.right
margins: 20 * pgst.scalef
}
}
}
}
StartPageButton {
id: freshEpisodes
title: py.refreshing ? 'Refreshing feeds' : 'Episodes'
onClicked: pgst.loadPage('EpisodeQueryPage.qml');
Row {
id: freshEpisodesRow
anchors.bottom: parent.bottom
anchors.bottomMargin: 20 * pgst.scalef
anchors.leftMargin: 20 * pgst.scalef
anchors.left: parent.left
spacing: 10 * pgst.scalef
PLabel {
color: Constants.colors.placeholder
text: 'No fresh episodes'
visible: freshEpisodesRepeater.count == 0
}
Repeater {
id: freshEpisodesRepeater
CoverArt {
source: modelData.coverart
text: modelData.title
width: 80 * pgst.scalef
height: 80 * pgst.scalef
}
}
}
ButtonArea {
id: refresherButtonArea
visible: !py.refreshing
anchors {
bottom: parent.bottom
right: parent.right
}
transparent: true
onClicked: py.call('main.check_for_episodes');
width: refresher.width + 2*refresher.anchors.margins
height: refresher.height + 2*refresher.anchors.margins
PIcon {
id: refresher
icon: Icons.loop_alt2
color: Constants.colors.highlight
anchors {
bottom: parent.bottom
right: parent.right
margins: 20 * pgst.scalef
}
}
}
}
Repeater {
model: ListModel {
ListElement { caption: 'gpodder.net'; target: 'Directory.qml' }
ListElement { caption: 'Help'; target: 'AboutPage.qml' }
}
delegate: ButtonArea {
onClicked: pgst.loadPage(target)
anchors {
left: freshEpisodes.left
right: freshEpisodes.right
}
height: 80 * pgst.scalef
PLabel {
anchors.centerIn: parent
text: caption
}
}
}
}
}
PScrollDecorator { flickable: flickable }
}

View file

@ -1,42 +0,0 @@
/**
*
* gPodder QML UI Reference Implementation
* Copyright (c) 2013, 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
ButtonArea {
id: startPageButton
property string title
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width * .9
height: 200 * pgst.scalef
PLabel {
anchors {
right: parent.right
top: parent.top
margins: 20 * pgst.scalef
}
text: startPageButton.title
}
}

View file

@ -27,16 +27,26 @@ Dialog {
contentHeight: contentColumn.height
function accepted() {
loading.visible = true;
button.visible = false;
input.visible = false;
py.call('main.subscribe', [input.text], function () {
subscribe.closePage();
});
}
Column {
id: contentColumn
anchors.centerIn: parent
spacing: 30 * pgst.scalef
spacing: 20 * pgst.scalef
PTextField {
id: input
width: subscribe.width *.8
placeholderText: 'Feed URL'
onAccepted: subscribe.accepted();
}
ButtonArea {
@ -49,14 +59,7 @@ Dialog {
text: 'Subscribe'
}
onClicked: {
loading.visible = true;
button.visible = false;
input.visible = false;
py.call('main.subscribe', [input.text], function () {
subscribe.closePage();
});
}
onClicked: subscribe.accepted();
}
PBusyIndicator {