diff options
| author | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-03 16:38:02 +0100 |
|---|---|---|
| committer | Tomasz Sterna <tomek@xiaoka.com> | 2015-01-03 19:07:48 +0100 |
| commit | 4e7da1944f5fa75a0739c0757d40a8102f045365 (patch) | |
| tree | 5f3fe179256536e4135eb4d5031a1d754af5e26c /app/qml/pages/AppConfigDialog.qml | |
| parent | 4150005566bec7827ce1cdd759a2397d47eba583 (diff) | |
| parent | e6ec758b364fcaf9fda35e56740c3fcd7e8fe25e (diff) | |
Merge remote-tracking branch 'javispedro/js-testing'
Conflicts:
daemon/daemon.pro
daemon/dbusconnector.cpp
daemon/manager.cpp
daemon/watchcommands.cpp
daemon/watchcommands.h
daemon/watchconnector.cpp
daemon/watchconnector.h
log4qt-debug.conf
log4qt-release.conf
rpm/pebble.spec
rpm/pebble.yaml
Diffstat (limited to 'app/qml/pages/AppConfigDialog.qml')
| -rw-r--r-- | app/qml/pages/AppConfigDialog.qml | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/app/qml/pages/AppConfigDialog.qml b/app/qml/pages/AppConfigDialog.qml new file mode 100644 index 0000000..1562985 --- /dev/null +++ b/app/qml/pages/AppConfigDialog.qml @@ -0,0 +1,87 @@ +import QtQuick 2.0 +import QtQml 2.1 +import QtWebKit 3.0 +import Sailfish.Silica 1.0 + +Dialog { + id: appConfigPage + + property alias url: webview.url + property string uuid + property string name + + SilicaWebView { + id: webview + visible: url != "" + anchors.fill: parent + + header: DialogHeader { + title: "Configuring " + name + } + + VerticalScrollDecorator { flickable: webview } + + overridePageStackNavigation: true + + onNavigationRequested: { + console.log("appconfig navigation requested to " + request.url); + var url = request.url.toString(); + if (/^pebblejs:\/\/close/.exec(url)) { + var data = decodeURIComponent(url.substring(17)); + console.log("appconfig requesting close; data: " + data); + pebbled.setAppConfiguration(uuid, data); + appConfigPage.canAccept = true; + appConfigPage.accept(); + request.action = WebView.IgnoreRequest; + } else { + request.action = WebView.AcceptRequest; + } + } + + experimental.itemSelector: Component { + Item { + Component.onCompleted: { + var dialog = pageStack.push(Qt.resolvedUrl("WebItemSelDialog.qml"), { + model: model.items + }); + dialog.onRejected.connect(function() { + model.reject(); + }); + dialog.onAccepted.connect(function() { + model.accept(dialog.selectedIndex); + }); + } + } + } + } + + ProgressBar { + anchors { + left: parent.left + right: parent.right + bottom: parent.bottom + } + + visible: webview.visible && webview.loading + minimumValue: 0 + maximumValue: 100 + indeterminate: webview.loadProgress === 0 + value: webview.loadProgress + } + + Text { + anchors.centerIn: parent + visible: url == "" + text: qsTr("No configuration settings available") + width: parent.width - 2*Theme.paddingLarge + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.Wrap + font { + pixelSize: Theme.fontSizeLarge + family: Theme.fontFamilyHeading + } + color: Theme.highlightColor + } + + canAccept: false +} |
