Settings page
This commit is contained in:
parent
2d6c60efe0
commit
8d9809d963
3 changed files with 99 additions and 36 deletions
|
@ -38,8 +38,8 @@ Page {
|
|||
busy: py.refreshing
|
||||
|
||||
MenuItem {
|
||||
text: 'About'
|
||||
onClicked: pgst.loadPage('AboutPage.qml');
|
||||
text: 'Settings'
|
||||
onClicked: pgst.loadPage('SettingsPage.qml');
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
|
|
|
@ -1,34 +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 Sailfish.Silica 1.0
|
||||
|
||||
Page {
|
||||
allowedOrientations: Orientation.All
|
||||
|
||||
PageHeader { title: 'Settings' }
|
||||
|
||||
Label {
|
||||
anchors.centerIn: parent
|
||||
text: 'TODO'
|
||||
}
|
||||
}
|
||||
|
97
qml/SettingsPage.qml
Normal file
97
qml/SettingsPage.qml
Normal file
|
@ -0,0 +1,97 @@
|
|||
|
||||
/**
|
||||
*
|
||||
* 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 Sailfish.Silica 1.0
|
||||
|
||||
import 'common'
|
||||
|
||||
Page {
|
||||
id: settingsPage
|
||||
allowedOrientations: Orientation.All
|
||||
|
||||
onStatusChanged: {
|
||||
if (status === PageStatus.Activating) {
|
||||
py.getConfig('plugins.youtube.api_key_v3', function (value) {
|
||||
youtube_api_key_v3.text = value;
|
||||
});
|
||||
py.getConfig('limit.episodes', function (value) {
|
||||
limit_episodes.value = value;
|
||||
});
|
||||
} else if (status === PageStatus.Deactivating) {
|
||||
py.setConfig('plugins.youtube.api_key_v3', youtube_api_key_v3.text);
|
||||
py.setConfig('limit.episodes', parseInt(limit_episodes.value));
|
||||
youtube_api_key_v3.focus = false;
|
||||
}
|
||||
}
|
||||
|
||||
SilicaFlickable {
|
||||
id: settingsList
|
||||
anchors.fill: parent
|
||||
|
||||
VerticalScrollDecorator { flickable: settingsList }
|
||||
|
||||
PullDownMenu {
|
||||
MenuItem {
|
||||
text: 'About'
|
||||
onClicked: pgst.loadPage('AboutPage.qml');
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.paddingMedium
|
||||
|
||||
PageHeader {
|
||||
title: 'Settings'
|
||||
}
|
||||
|
||||
SectionHeader {
|
||||
text: 'YouTube'
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: youtube_api_key_v3
|
||||
label: 'API Key (v3)'
|
||||
placeholderText: label
|
||||
width: parent.width
|
||||
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
|
||||
EnterKey.iconSource: (text.length > 0) ? "image://theme/icon-m-enter-accept" : "image://theme/icon-m-enter-close"
|
||||
EnterKey.onClicked: focus = false
|
||||
}
|
||||
|
||||
SectionHeader {
|
||||
text: 'Limits'
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
|
||||
Slider {
|
||||
id: limit_episodes
|
||||
label: 'Maximum episodes per feed'
|
||||
valueText: value
|
||||
width: parent.width
|
||||
minimumValue: 100
|
||||
maximumValue: 1000
|
||||
stepSize: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue