~system-settings-touch/ubuntu-system-settings/15.04

« back to all changes in this revision

Viewing changes to plugins/cellular/Components/MultiSim.qml

merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import Ubuntu.Components 0.1
24
24
import Ubuntu.Components.ListItems 0.1 as ListItem
25
25
 
 
26
/* This is a temporary solution to the issue of Hotspots failing on mako. If
 
27
the device is mako, we hide the hotspot entry. Will be removed once lp:1434591
 
28
has been resolved. */
 
29
import Ubuntu.SystemSettings.Update 1.0
 
30
 
26
31
Column {
27
32
    objectName: "multiSim"
28
33
 
48
53
        anchors { left: parent.left; right: parent.right }
49
54
    }
50
55
 
51
 
    ListItem.SingleValue {
52
 
        text : i18n.tr("Hotspot disabled because Wi-Fi is off.")
53
 
        visible: showAllUI && !hotspotItem.visible
54
 
    }
55
 
 
56
 
    ListItem.SingleValue {
57
 
        id: hotspotItem
58
 
        text: i18n.tr("Wi-Fi hotspot")
59
 
        progression: true
60
 
        onClicked: {
61
 
            pageStack.push(Qt.resolvedUrl("Hotspot.qml"))
62
 
        }
63
 
        visible: showAllUI && (actionGroup.actionObject.valid ? actionGroup.actionObject.state : false)
64
 
    }
65
 
 
66
56
    ListItem.Standard {
67
57
        id: dataUsage
68
58
        text: i18n.tr("Data usage statistics")
110
100
 
111
101
            expanded: true
112
102
            text: sim.title
113
 
            model: sim.radioSettings.modemTechnologies
 
103
            model: sim.radioSettings.availableTechnologies
114
104
            delegate: OptionSelectorDelegate {
115
105
                objectName: sim.path + "_radio_" + modelData
116
106
                text: sim.techToString(modelData)
132
122
            Connections {
133
123
                target: sim.radioSettings
134
124
                onTechnologyPreferenceChanged: radio.selectedIndex =
135
 
                    sim.radioSettings.modemTechnologies.indexOf(preference)
 
125
                    sim.radioSettings.availableTechnologies.indexOf(preference)
136
126
 
137
 
                onModemTechnologiesChanged: {
 
127
                onAvailableTechnologiesChanged: {
138
128
                    if ((technologies.indexOf('umts') === -1)
139
129
                         && (sim.mtkSettings.has3G === false)) {
140
130
                        radio.model = sim.addUmtsEnableToModel(technologies);
148
138
            }
149
139
 
150
140
            Component.onCompleted: {
151
 
                if ((sim.radioSettings.modemTechnologies.indexOf('umts') === -1)
 
141
                if ((sim.radioSettings.availableTechnologies.indexOf('umts') === -1)
152
142
                     && (sim.mtkSettings.has3G === false)) {
153
 
                    radio.model = sim.addUmtsEnableToModel(sim.radioSettings.modemTechnologies);
 
143
                    radio.model = sim.addUmtsEnableToModel(sim.radioSettings.availableTechnologies);
154
144
                } else {
155
 
                    radio.model = sim.radioSettings.modemTechnologies;
 
145
                    radio.model = sim.radioSettings.availableTechnologies;
156
146
                }
157
147
            }
158
148
        }