diff --git a/gpodder-ui-qml b/gpodder-ui-qml index 3579f4b..d267582 160000 --- a/gpodder-ui-qml +++ b/gpodder-ui-qml @@ -1 +1 @@ -Subproject commit 3579f4bfe2891852bbd357dc786a4ee6783fded9 +Subproject commit d267582aa0b16cae1ead227b141b0e707e702a67 diff --git a/qml/PodcastItem.qml b/qml/PodcastItem.qml index a4ae3ae..5a4e1e2 100644 --- a/qml/PodcastItem.qml +++ b/qml/PodcastItem.qml @@ -35,6 +35,37 @@ ListItem { }); } } + + MenuItem { + text: 'Rename' + onClicked: { + var ctx = { py: py, id: id }; + pageStack.push('RenameDialog.qml', { + activityName: 'Rename podcast', + affirmativeAction: 'Rename', + inputLabel: 'Podcast name', + initialValue: title, + callback: function (new_title) { + ctx.py.call('main.rename_podcast', [ctx.id, new_title]); + } + }); + } + } + MenuItem { + text: 'Change section' + onClicked: { + var ctx = { py: py, id: id }; + pageStack.push('RenameDialog.qml', { + activityName: 'Change section', + affirmativeAction: 'Move', + inputLabel: 'Section', + initialValue: section, + callback: function (new_section) { + ctx.py.call('main.change_section', [ctx.id, new_section]); + } + }); + } + } } } diff --git a/qml/PodcastsPage.qml b/qml/PodcastsPage.qml index e10553f..36b72c5 100644 --- a/qml/PodcastsPage.qml +++ b/qml/PodcastsPage.qml @@ -107,7 +107,7 @@ Page { } ViewPlaceholder { - enabled: podcastList.count == 0 + enabled: podcastListModel.count == 0 && pgst.ready text: 'No subscriptions' } } diff --git a/qml/RenameDialog.qml b/qml/RenameDialog.qml new file mode 100644 index 0000000..9f15532 --- /dev/null +++ b/qml/RenameDialog.qml @@ -0,0 +1,63 @@ + +/** + * + * gPodder QML UI Reference Implementation + * Copyright (c) 2013, 2014, Thomas Perl + * + * 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 + +Dialog { + id: rename + property string activityName + property string affirmativeAction + property string inputLabel + property string initialValue + property var callback + + canAccept: input.text != '' + + SubscribeProgress { + id: progress + } + + onAccepted: { + rename.callback(input.text) + //py.call('main.rename', [ername, input.text], function () { + // // TODO + //}); + } + + Column { + anchors.fill: parent + + DialogHeader { + title: rename.activityName + acceptText: rename.affirmativeAction + } + + TextField { + id: input + width: parent.width + label: rename.inputLabel + placeholderText: label + text: initialValue + //inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase + EnterKey.onClicked: rename.accept() + } + } +}