~jonas-drange/ubuntu-system-settings/hotspots

« back to all changes in this revision

Viewing changes to plugins/cellular/Hotspot.qml

  • Committer: jonas-drange
  • Date: 2015-07-31 15:03:42 UTC
  • mfrom: (1312.4.1 tmp)
  • Revision ID: jonas.drange@canonical.com-20150731150342-klim6hmc0u96kto6
bzr merge lp:~pete-woods/ubuntu-system-settings/hotspots-via-indicator

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import Ubuntu.Components 0.1
22
22
import Ubuntu.Components.ListItems 0.1 as ListItem
23
23
import Ubuntu.Components.Popups 0.1
 
24
import Ubuntu.Connectivity 1.0
24
25
import Ubuntu.Settings.Components 0.1 as USC
25
26
import Ubuntu.SystemSettings.Cellular 1.0
26
27
 
41
42
        }
42
43
    }
43
44
 
44
 
    HotspotManager {
45
 
        id: hotspotManager
46
 
    }
47
 
 
48
45
    Loader {
49
46
        id: setup
50
47
        asynchronous: false
57
54
 
58
55
        ListItem.Standard {
59
56
            text: i18n.tr("Hotspot")
60
 
            enabled: hotspotManager.stored
 
57
            enabled: Connectivity.hotspotStored
61
58
            control: Switch {
62
59
                id: hotspotSwitch
63
60
                objectName: "hotspotSwitch"
67
64
                    id: switchSync
68
65
                    userTarget: hotspotSwitch
69
66
                    userProperty: "checked"
70
 
                    serverTarget: hotspotManager
71
 
                    serverProperty: "enabled"
 
67
                    serverTarget: Connectivity
 
68
                    serverProperty: "hotspotEnabled"
72
69
                    useWaitBuffer: true
73
70
 
74
71
                    // Since this blocks the UI thread, we wait until
84
81
                    id: triggerTimer
85
82
                    property bool value
86
83
                    interval: 250; repeat: false
87
 
                    onTriggered: hotspotManager.enabled = value
 
84
                    onTriggered: Connectivity.hotspotEnabled = value
88
85
                }
89
86
            }
90
87
        }
105
102
            objectName: "hotspotSetupEntry"
106
103
            anchors.horizontalCenter: parent.horizontalCenter
107
104
            width: parent.width - units.gu(4)
108
 
            text: hotspotManager.stored ?
 
105
            text: Connectivity.hotspotStored ?
109
106
                i18n.tr("Change password/setup…") : i18n.tr("Set up hotspot…")
110
107
 
111
108
            onClicked: {
112
109
                setup.setSource(Qt.resolvedUrl("HotspotSetup.qml"));
113
110
                PopupUtils.open(setup.item, hotspot, {
114
 
                    hotspotManager: hotspotManager
115
111
                });
116
112
            }
117
113
        }