20
20
import SystemSettings 1.0
21
21
import Ubuntu.Components 0.1
22
22
import Ubuntu.Components.ListItems 0.1 as ListItem
23
import Ubuntu.Components.Popups 0.1
24
import Ubuntu.Settings.Components 0.1 as USC
23
25
import Ubuntu.SystemSettings.Cellular 1.0
30
objectName: "hotspotPage"
29
32
title: i18n.tr("Wi-Fi hotspot")
34
// We disable the back action while a hotspot is in the process of either
35
// being enabled or disabled.
36
head.backAction: Action {
38
enabled: hotspotSwitch.enabled
37
55
anchors.fill: parent
39
58
ListItem.Standard {
40
59
text: i18n.tr("Hotspot")
60
enabled: hotspotManager.stored
43
checked: hotspotManager.isHotspotActive()
46
hotspotManager.enableHotspot()
48
hotspotManager.disableHotspot()
63
objectName: "hotspotSwitch"
64
enabled: !switchSync.syncWaiting
66
USC.ServerPropertySynchroniser {
68
userTarget: hotspotSwitch
69
userProperty: "checked"
70
serverTarget: hotspotManager
71
serverProperty: "enabled"
74
// Since this blocks the UI thread, we wait until
75
// the UI has completed the checkbox animation before we
76
// ask the server to uipdate.
78
triggerTimer.value = value;
86
interval: 250; repeat: false
87
onTriggered: hotspotManager.enabled = value
56
wrapMode: Text.WordWrap
57
anchors.leftMargin: units.gu(2)
58
anchors.rightMargin: units.gu(2)
59
text : hotspotSwitch.enabled ?
96
leftMargin: units.gu(2)
97
rightMargin: units.gu(2)
99
text : hotspotSwitch.stored ?
60
100
i18n.tr("When hotspot is on, other devices can use your cellular data connection over Wi-Fi. Normal data charges apply.")
61
: i18n.tr("Other devices can use your cellular data connection over the Wi-Fi network. Normal data charges apply.")
101
: i18n.tr("Other devices can use your cellular data connection over the Wi-Fi network. Normal data charges apply.")
65
text: i18n.tr("Set up hotspot")
66
anchors.left: parent.left
67
anchors.right: parent.right
68
anchors.leftMargin: units.gu(2)
69
anchors.rightMargin: units.gu(2)
105
objectName: "hotspotSetupEntry"
106
anchors.horizontalCenter: parent.horizontalCenter
107
width: parent.width - units.gu(4)
108
text: hotspotManager.stored ?
109
i18n.tr("Change password/setup…") : i18n.tr("Set up hotspot…")
71
pageStack.push(Qt.resolvedUrl("HotspotSetup.qml"), {hotspotManager: hotspotManager})
112
setup.setSource(Qt.resolvedUrl("HotspotSetup.qml"));
113
PopupUtils.open(setup.item, hotspot, {
114
hotspotManager: hotspotManager