blob: 10fbe05ad69d7bd1e6a2679961db4297c1e13c7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
import QtQuick 2.0
import QtQml 2.1
import QtWebKit 3.0
import Sailfish.Silica 1.0
Page {
id: appConfigPage
property alias url: webview.url
property string name
SilicaWebView {
id: webview
anchors.fill: parent
header: PageHeader {
title: "Configuring " + name
}
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);
pageStack.pop();
request.action = WebView.IgnoreRequest;
} else {
request.action = WebView.AcceptRequest;
}
}
}
ViewPlaceholder {
enabled: url == ""
text: qsTr("No configuration settings available")
}
}
|