From 8a9b29aed272bf479c67c5551ca2032cfaec7acb Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Thu, 30 Jan 2014 18:50:51 +0100 Subject: [PATCH] QML: Turn subscribe page into a Dialog --- qml/Subscribe.qml | 56 ++++++++++++++++++----------------------------- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/qml/Subscribe.qml b/qml/Subscribe.qml index 202cf21..bdb667b 100644 --- a/qml/Subscribe.qml +++ b/qml/Subscribe.qml @@ -21,48 +21,34 @@ import QtQuick 2.0 import Sailfish.Silica 1.0 -Page { +Dialog { id: subscribe + canAccept: input.text != '' - PageHeader { title: 'Add subscription' } + SubscribeProgress { + id: progress + } + + onAccepted: { + py.call('main.subscribe', [input.text], function () { + // TODO + }); + } Column { - anchors.centerIn: parent - spacing: 30 * pgst.scalef + anchors.fill: parent + + DialogHeader { + title: 'Add subscription' + acceptText: 'Subscribe' + } TextField { id: input - width: subscribe.width *.8 - placeholderText: 'Feed URL' - } - - BackgroundItem { - id: button - width: input.width - height: input.height - - Label { - anchors.centerIn: parent - text: 'Subscribe' - } - - onClicked: { - loading.visible = true; - button.visible = false; - input.visible = false; - py.call('main.subscribe', [input.text], function () { - if (pageStack.currentPage == subscribe) { - pageStack.pop(); - } - }); - } - } - - BusyIndicator { - id: loading - visible: false - running: visible - anchors.horizontalCenter: parent.horizontalCenter + width: parent.width + label: 'Feed URL' + placeholderText: label + inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase } } }