Remove start page
This commit is contained in:
parent
debc6519be
commit
579b88cdac
9 changed files with 79 additions and 292 deletions
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
import 'common/constants.js' as Constants
|
||||||
|
|
||||||
SlidePage {
|
SlidePage {
|
||||||
id: aboutPage
|
id: aboutPage
|
||||||
|
|
||||||
|
@ -35,35 +37,39 @@ SlidePage {
|
||||||
id: detailColumn
|
id: detailColumn
|
||||||
|
|
||||||
width: aboutPage.width
|
width: aboutPage.width
|
||||||
spacing: 5 * pgst.scalef
|
spacing: 15 * pgst.scalef
|
||||||
|
|
||||||
SlidePageHeader {
|
SlidePageHeader {
|
||||||
title: 'About gPodder'
|
title: 'About gPodder'
|
||||||
}
|
}
|
||||||
|
|
||||||
SectionHeader {
|
Column {
|
||||||
text: 'How to use'
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
}
|
|
||||||
|
|
||||||
PLabel {
|
PLabel {
|
||||||
width: parent.width * .9
|
width: parent.width * .95
|
||||||
font.pixelSize: 30 * pgst.scalef
|
font.pixelSize: 30 * pgst.scalef
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
wrapMode: Text.WordWrap
|
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.'
|
text: 'gPodder ' + py.uiversion
|
||||||
}
|
color: Constants.colors.highlight
|
||||||
|
|
||||||
SectionHeader {
|
|
||||||
text: 'More information'
|
|
||||||
width: parent.width
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PLabel {
|
PLabel {
|
||||||
width: parent.width * .9
|
width: parent.width * .95
|
||||||
font.pixelSize: 20 * pgst.scalef
|
font.pixelSize: 20 * pgst.scalef
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
text: 'http://gpodder.org/'
|
||||||
|
color: Constants.colors.placeholder
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PLabel {
|
||||||
|
width: parent.width * .95
|
||||||
|
font.pixelSize: 30 * pgst.scalef
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
text: [
|
text: [
|
||||||
'© 2005-2014 Thomas Perl and the gPodder Team',
|
'© 2005-2014 Thomas Perl and the gPodder Team',
|
||||||
'License: ISC / GPLv3 or later',
|
'License: ISC / GPLv3 or later',
|
||||||
|
|
|
@ -25,10 +25,20 @@ import 'common'
|
||||||
SlidePage {
|
SlidePage {
|
||||||
id: directory
|
id: directory
|
||||||
|
|
||||||
|
function search(text) {
|
||||||
|
loading.visible = true;
|
||||||
|
directorySearchModel.search(text, function() {
|
||||||
|
loading.visible = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
id: listView
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
PScrollDecorator {}
|
|
||||||
|
PScrollDecorator { flickable: listView }
|
||||||
|
|
||||||
model: GPodderDirectorySearchModel { id: directorySearchModel }
|
model: GPodderDirectorySearchModel { id: directorySearchModel }
|
||||||
|
|
||||||
|
@ -53,6 +63,7 @@ SlidePage {
|
||||||
id: input
|
id: input
|
||||||
width: parent.width
|
width: parent.width
|
||||||
placeholderText: 'Search term'
|
placeholderText: 'Search term'
|
||||||
|
onAccepted: directory.search(input.text);
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonArea {
|
ButtonArea {
|
||||||
|
@ -65,12 +76,7 @@ SlidePage {
|
||||||
text: 'Search'
|
text: 'Search'
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: directory.search(input.text);
|
||||||
loading.visible = true;
|
|
||||||
directorySearchModel.search(input.text, function() {
|
|
||||||
loading.visible = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,8 +130,7 @@ Item {
|
||||||
onClicked: loadPage('PlayerPage.qml');
|
onClicked: loadPage('PlayerPage.qml');
|
||||||
}
|
}
|
||||||
|
|
||||||
StartPage {
|
PodcastsPage {
|
||||||
id: startPage
|
|
||||||
visible: py.ready
|
visible: py.ready
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,25 +27,30 @@ Item {
|
||||||
|
|
||||||
property alias text: textInput.text
|
property alias text: textInput.text
|
||||||
property string placeholderText: ''
|
property string placeholderText: ''
|
||||||
|
signal accepted
|
||||||
|
|
||||||
height: 50 * pgst.scalef
|
height: 50 * pgst.scalef
|
||||||
|
|
||||||
TextInput {
|
TextInput {
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
verticalCenter: parent.verticalCenter
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
margins: 5 * pgst.scalef
|
margins: 5 * pgst.scalef
|
||||||
}
|
}
|
||||||
color: Constants.colors.text
|
color: Constants.colors.text
|
||||||
selectionColor: Constants.colors.background
|
selectionColor: Constants.colors.background
|
||||||
id: textInput
|
id: textInput
|
||||||
font.pixelSize: height
|
font.pixelSize: parent.height * 0.7
|
||||||
font.family: placeholder.font.family
|
font.family: placeholder.font.family
|
||||||
|
focus: true
|
||||||
|
onAccepted: textField.accepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
PLabel {
|
PLabel {
|
||||||
id: placeholder
|
id: placeholder
|
||||||
anchors.fill: textInput
|
anchors.fill: textInput
|
||||||
visible: !textInput.focus && (textInput.text == '')
|
visible: (textInput.text == '')
|
||||||
text: textField.placeholderText
|
text: textField.placeholderText
|
||||||
color: Constants.colors.placeholder
|
color: Constants.colors.placeholder
|
||||||
font.pixelSize: textInput.font.pixelSize
|
font.pixelSize: textInput.font.pixelSize
|
||||||
|
|
|
@ -27,6 +27,7 @@ import 'common/constants.js' as Constants
|
||||||
|
|
||||||
SlidePage {
|
SlidePage {
|
||||||
id: podcastsPage
|
id: podcastsPage
|
||||||
|
canClose: false
|
||||||
|
|
||||||
PListView {
|
PListView {
|
||||||
id: podcastList
|
id: podcastList
|
||||||
|
@ -45,12 +46,30 @@ SlidePage {
|
||||||
py.call('main.check_for_episodes');
|
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',
|
label: 'Add new podcast',
|
||||||
callback: function () {
|
callback: function () {
|
||||||
pgst.loadPage('Subscribe.qml');
|
pgst.loadPage('Subscribe.qml');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Search gpodder.net',
|
||||||
|
callback: function () {
|
||||||
|
pgst.loadPage('Directory.qml');
|
||||||
|
},
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,8 @@ Dialog {
|
||||||
model: selectionDialog.items
|
model: selectionDialog.items
|
||||||
|
|
||||||
delegate: ButtonArea {
|
delegate: ButtonArea {
|
||||||
|
id: buttonArea
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 60 * pgst.scalef
|
height: 60 * pgst.scalef
|
||||||
|
|
||||||
|
@ -67,7 +69,7 @@ Dialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
text: modelData
|
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: {
|
onClicked: {
|
||||||
|
|
|
@ -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 }
|
|
||||||
}
|
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -27,16 +27,26 @@ Dialog {
|
||||||
|
|
||||||
contentHeight: contentColumn.height
|
contentHeight: contentColumn.height
|
||||||
|
|
||||||
|
function accepted() {
|
||||||
|
loading.visible = true;
|
||||||
|
button.visible = false;
|
||||||
|
input.visible = false;
|
||||||
|
py.call('main.subscribe', [input.text], function () {
|
||||||
|
subscribe.closePage();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: contentColumn
|
id: contentColumn
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: 30 * pgst.scalef
|
spacing: 20 * pgst.scalef
|
||||||
|
|
||||||
PTextField {
|
PTextField {
|
||||||
id: input
|
id: input
|
||||||
width: subscribe.width *.8
|
width: subscribe.width *.8
|
||||||
placeholderText: 'Feed URL'
|
placeholderText: 'Feed URL'
|
||||||
|
onAccepted: subscribe.accepted();
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonArea {
|
ButtonArea {
|
||||||
|
@ -49,14 +59,7 @@ Dialog {
|
||||||
text: 'Subscribe'
|
text: 'Subscribe'
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: subscribe.accepted();
|
||||||
loading.visible = true;
|
|
||||||
button.visible = false;
|
|
||||||
input.visible = false;
|
|
||||||
py.call('main.subscribe', [input.text], function () {
|
|
||||||
subscribe.closePage();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PBusyIndicator {
|
PBusyIndicator {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue