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

« back to all changes in this revision

Viewing changes to plugins/cellular/Hotspot.qml

  • Committer: jonas-drange
  • Date: 2015-05-22 15:13:30 UTC
  • Revision ID: jonas.drange@canonical.com-20150522151330-y53a35eioshrggsi
using usc serverpropertysynchroniser

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
24
 
import Ubuntu.Components.Popups 0.1
25
26
 
26
27
ItemPage {
27
28
 
45
46
        spacing: units.gu(2)
46
47
 
47
48
        ListItem.Standard {
48
 
            text: i18n.tr("Hotspot")
 
49
            text: switchSync.syncWaiting ? 'Hotspot (waiting)' : 'Hotspot'
 
50
            //text: i18n.tr("Hotspot")
49
51
            enabled: hotspotManager.stored
50
52
            control: Switch {
51
53
                id: hotspotSwitch
52
54
                objectName: "hotspotSwitch"
 
55
 
53
56
                property bool serverChecked: hotspotManager.enabled
54
 
                onServerCheckedChanged: checked = serverChecked
55
 
                Component.onCompleted: checked = serverChecked
56
 
                onTriggered: hotspotManager.enabled = checked
 
57
                USC.ServerPropertySynchroniser {
 
58
                    id: switchSync
 
59
                    userTarget: hotspotSwitch
 
60
                    userProperty: "checked"
 
61
                    serverTarget: hotspotSwitch
 
62
                    serverProperty: "serverChecked"
 
63
                    useWaitBuffer: true
 
64
 
 
65
                    onSyncTriggered: hotspotManager.enabled = value
 
66
                }
57
67
            }
58
68
        }
59
69