Merge lp:~jonas-drange/ubuntu-system-settings/slotslayouts into lp:ubuntu-system-settings

Proposed by Jonas G. Drange
Status: Superseded
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/slotslayouts
Merge into: lp:ubuntu-system-settings
Prerequisite: lp:~jonas-drange/ubuntu-system-settings/settings-listitems
Diff against target: 3473 lines (+758/-916)
54 files modified
plugins/about/EntryComponent.qml (+3/-5)
plugins/about/PageComponent.qml (+50/-54)
plugins/bluetooth/DevicePage.qml (+24/-46)
plugins/bluetooth/PageComponent.qml (+55/-93)
plugins/brightness/PageComponent.qml (+10/-10)
plugins/cellular/Components/MultiSim.qml (+8/-12)
plugins/cellular/Components/Sim.qml (+5/-1)
plugins/cellular/Components/SingleSim.qml (+18/-23)
plugins/cellular/PageCarrierAndApn.qml (+6/-6)
plugins/cellular/PageCarriersAndApns.qml (+35/-52)
plugins/cellular/PageChooseApn.qml (+18/-49)
plugins/cellular/PageComponent.qml (+0/-1)
plugins/flight-mode/EntryComponent.qml (+6/-6)
plugins/hotspot/HotspotSetup.qml (+18/-43)
plugins/hotspot/PageComponent.qml (+6/-5)
plugins/language/KeyboardLayoutItem.qml (+21/-30)
plugins/language/PageComponent.qml (+42/-51)
plugins/language/SpellChecking.qml (+3/-3)
plugins/language/SubsetView.qml (+5/-4)
plugins/orientation-lock/EntryComponent.qml (+7/-7)
plugins/phone/CallForwardItem.qml (+10/-8)
plugins/phone/CallForwarding.qml (+1/-2)
plugins/phone/CallWaiting.qml (+30/-43)
plugins/phone/MultiSim.qml (+5/-12)
plugins/phone/NoSims.qml (+5/-11)
plugins/phone/PageComponent.qml (+4/-6)
plugins/phone/ServiceInfo.qml (+6/-5)
plugins/phone/Services.qml (+3/-4)
plugins/phone/SingleSim.qml (+5/-12)
plugins/reset/EntryComponent.qml (+2/-4)
plugins/reset/PageComponent.qml (+54/-19)
plugins/sound/PageComponent.qml (+36/-34)
plugins/time-date/ChooseTimeZone.qml (+3/-2)
plugins/time-date/PageComponent.qml (+8/-8)
plugins/time-date/Scroller.qml (+6/-7)
plugins/time-date/TimePicker.qml (+0/-1)
plugins/wifi/AccessPoint.qml (+11/-22)
plugins/wifi/DivMenuItem.qml (+3/-3)
plugins/wifi/FramedMenuItem.qml (+7/-3)
plugins/wifi/MenuItemFactory.qml (+5/-5)
plugins/wifi/NetworkDetails.qml (+25/-28)
plugins/wifi/NetworkDetailsBrief.qml (+17/-16)
plugins/wifi/PageComponent.qml (+8/-12)
plugins/wifi/PreviousNetworks.qml (+2/-3)
plugins/wifi/SectionMenuItem.qml (+14/-29)
plugins/wifi/StandardMenuItem.qml (+5/-27)
plugins/wifi/SwitchMenuItem.qml (+1/-1)
src/CMakeLists.txt (+1/-1)
src/SystemSettings/qmldir (+1/-0)
src/qml/CategorySection.qml (+13/-24)
src/qml/EntryComponent.qml (+5/-49)
src/qml/MainWindow.qml (+19/-6)
src/ui.qrc (+1/-1)
tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py (+102/-7)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/slotslayouts
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Touch System Settings Pending
Review via email: mp+277861@code.launchpad.net

This proposal has been superseded by a proposal from 2015-11-23.

Commit message

migrating to slotslayout and new designs

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1577. By Jonas G. Drange

foo

1578. By Jonas G. Drange

sync with trunk

1579. By Jonas G. Drange

use listview instead of repeater as that will re-render the whole list on every change, and migrate to slotslayout and new design

1580. By Jonas G. Drange

migrate brightness panel

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1581. By Jonas G. Drange

merge latest from listitems

1582. By Jonas G. Drange

change to find instead of search icon, and swap FM with orientation lock

1583. By Jonas G. Drange

change icons that we have

1584. By Jonas G. Drange

start working on battery panel

1585. By Jonas G. Drange

undoing drawaxes change

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/about/EntryComponent.qml'
2--- plugins/about/EntryComponent.qml 2015-08-10 13:31:45 +0000
3+++ plugins/about/EntryComponent.qml 2015-11-23 13:42:19 +0000
4@@ -1,7 +1,7 @@
5 /*
6 * This file is part of system-settings
7 *
8- * Copyright (C) 2013 Canonical Ltd.
9+ * Copyright (C) 2013-2015 Canonical Ltd.
10 *
11 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
12 *
13@@ -19,15 +19,13 @@
14 */
15
16 import QtQuick 2.4
17+import SystemSettings.ListItems 1.0 as SettingsListItems
18 import Ubuntu.Components 1.3
19-import Ubuntu.Components.ListItems 1.3 as ListItem
20
21-ListItem.Standard {
22+SettingsListItems.IconProgression {
23 id: root
24
25 objectName: "entryComponent-about"
26 iconSource: Qt.resolvedUrl(model.icon)
27- iconFrame: false
28 text: i18n.tr(model.displayName)
29- progression: true
30 }
31
32=== modified file 'plugins/about/PageComponent.qml'
33--- plugins/about/PageComponent.qml 2015-10-29 15:48:06 +0000
34+++ plugins/about/PageComponent.qml 2015-11-23 13:42:19 +0000
35@@ -21,8 +21,9 @@
36 import QtQuick 2.4
37 import QtSystemInfo 5.0
38 import SystemSettings 1.0
39+import SystemSettings.ListItems 1.0 as SettingsListItems
40 import Ubuntu.Components 1.3
41-import Ubuntu.Components.ListItems 1.3 as ListItem
42+import Ubuntu.Components.ListItems 1.3 as ListItems
43 import Ubuntu.SystemSettings.StorageAbout 1.0
44 import Ubuntu.SystemSettings.Update 1.0
45 import MeeGo.QOfono 0.2
46@@ -69,31 +70,30 @@
47 anchors.left: parent.left
48 anchors.right: parent.right
49
50- ListItem.Empty {
51- height: ubuntuLabel.height + deviceLabel.height + units.gu(6)
52-
53- Column {
54- anchors.left: parent.left
55- anchors.right: parent.right
56- anchors.centerIn: parent
57- spacing: units.gu(2)
58- Label {
59- id: ubuntuLabel
60- anchors.horizontalCenter: parent.horizontalCenter
61- text: ""
62- fontSize: "x-large"
63- }
64- Label {
65- id: deviceLabel
66- objectName: "deviceLabel"
67- anchors.horizontalCenter: parent.horizontalCenter
68- text: deviceInfos.manufacturer() ? deviceInfos.manufacturer() + " " + deviceInfos.model() : backendInfos.vendorString
69- }
70- }
71- highlightWhenPressed: false
72+ Column {
73+ anchors.left: parent.left
74+ anchors.right: parent.right
75+ Label {
76+ id: ubuntuLabel
77+ anchors {
78+ left: parent.left
79+ right: parent.right
80+ }
81+ height: contentHeight + units.gu(2)
82+ horizontalAlignment: Text.AlignHCenter
83+ verticalAlignment: Text.AlignVCenter
84+ text: ""
85+ fontSize: "x-large"
86+ }
87+ Label {
88+ id: deviceLabel
89+ objectName: "deviceLabel"
90+ anchors.horizontalCenter: parent.horizontalCenter
91+ text: deviceInfos.manufacturer() ? deviceInfos.manufacturer() + " " + deviceInfos.model() : backendInfos.vendorString
92+ }
93 }
94
95- ListItem.SingleValue {
96+ SettingsListItems.SingleValue {
97 id: serialItem
98 objectName: "serialItem"
99 text: i18n.tr("Serial")
100@@ -101,7 +101,7 @@
101 visible: backendInfos.serialNumber
102 }
103
104- ListItem.SingleValue {
105+ SettingsListItems.SingleValue {
106 objectName: "imeiItem"
107 property string imeiNumber
108 imeiNumber: deviceInfos.imei(0)
109@@ -111,21 +111,21 @@
110 visible: modemsSorted.length <= 1
111 }
112
113- ListItem.MultiValue {
114- text: "IMEI"
115- objectName: "imeiItems"
116- values: {
117- var imeis = [];
118- modemsSorted.forEach(function (path, i) {
119- var imei = deviceInfos.imei(i);
120- imei ? imeis.push(imei) : imeis.push(i18n.tr("None"));
121- });
122- return imeis;
123- }
124- visible: modemsSorted.length > 1
125- }
126+ // ListItem.MultiValue {
127+ // text: "IMEI"
128+ // objectName: "imeiItems"
129+ // values: {
130+ // var imeis = [];
131+ // modemsSorted.forEach(function (path, i) {
132+ // var imei = deviceInfos.imei(i);
133+ // imei ? imeis.push(imei) : imeis.push(i18n.tr("None"));
134+ // });
135+ // return imeis;
136+ // }
137+ // visible: modemsSorted.length > 1
138+ // }
139
140- ListItem.SingleValue {
141+ SettingsListItems.SingleValue {
142 property string address: wlinfo.macAddress(NetworkInfo.WlanMode, 0)
143 text: i18n.tr("Wi-Fi address")
144 value: address ? address.toUpperCase() : ""
145@@ -133,7 +133,7 @@
146 showDivider: bthwaddr.visible
147 }
148
149- ListItem.SingleValue {
150+ SettingsListItems.SingleValue {
151 id: bthwaddr
152 text: i18n.tr("Bluetooth address")
153 value: network.bluetoothMacAddress
154@@ -141,15 +141,14 @@
155 showDivider: false
156 }
157
158- ListItem.Divider {}
159+ ListItems.Divider {}
160
161- ListItem.SingleValue {
162+ SettingsListItems.SingleValueProgression {
163 id: storageItem
164 objectName: "storageItem"
165 text: i18n.tr("Storage")
166 /* TRANSLATORS: that's the free disk space, indicated in the most appropriate storage unit */
167 value: i18n.tr("%1 free").arg(Utilities.formatSize(backendInfos.getFreeSpace("/home")))
168- progression: true
169 onClicked: pageStack.push(Qt.resolvedUrl("Storage.qml"))
170 }
171
172@@ -158,7 +157,7 @@
173 text: i18n.tr("Software:")
174 }
175
176- ListItem.SingleValue {
177+ SettingsListItems.SingleValueProgression {
178 property string versionIdentifier: {
179 var num = UpdateManager.currentBuildNumber;
180 var ota = UpdateManager.detailedVersionDetails['tag'];
181@@ -170,21 +169,21 @@
182 value: "Ubuntu %1%2"
183 .arg(deviceInfos.version(DeviceInfo.Os))
184 .arg(versionIdentifier ? " (%1)".arg(versionIdentifier) : "")
185- progression: true
186 onClicked: pageStack.push(Qt.resolvedUrl("Version.qml"), {
187 version: versionIdentifier
188 })
189 }
190
191- ListItem.SingleValue {
192+ SettingsListItems.SingleValueProgression {
193 objectName: "lastUpdatedItem"
194 text: i18n.tr("Last updated")
195 value: UpdateManager.lastUpdateDate && !isNaN(UpdateManager.lastUpdateDate) ?
196 Qt.formatDate(UpdateManager.lastUpdateDate) : i18n.tr("Never")
197 }
198
199- ListItem.SingleControl {
200- control: Button {
201+ SettingsListItems.SingleControl {
202+
203+ Button {
204 objectName: "updateButton"
205 text: i18n.tr("Check for updates")
206 width: parent.width - units.gu(4)
207@@ -209,26 +208,23 @@
208 text: i18n.tr("Legal:")
209 }
210
211- ListItem.Standard {
212+ SettingsListItems.StandardProgression {
213 objectName: "licenseItem"
214 text: i18n.tr("Software licenses")
215- progression: true
216 onClicked: pageStack.push(Qt.resolvedUrl("Software.qml"))
217 }
218
219- ListItem.Standard {
220+ SettingsListItems.StandardProgression {
221 property var regulatoryInfo:
222 pluginManager.getByName("regulatory-information")
223 text: i18n.tr("Regulatory info")
224- progression: true
225 visible: regulatoryInfo
226 onClicked: pageStack.push(regulatoryInfo.pageComponent)
227 }
228
229- ListItem.SingleValue {
230+ SettingsListItems.SingleValueProgression {
231 objectName: "devmodeItem"
232 text: i18n.tr("Developer mode")
233- progression: true
234 onClicked: pageStack.push(Qt.resolvedUrl("DevMode.qml"))
235 }
236 }
237
238=== modified file 'plugins/bluetooth/DevicePage.qml'
239--- plugins/bluetooth/DevicePage.qml 2015-11-12 09:53:00 +0000
240+++ plugins/bluetooth/DevicePage.qml 2015-11-23 13:42:19 +0000
241@@ -21,9 +21,9 @@
242 import QMenuModel 0.1
243 import QtQuick 2.0
244 import SystemSettings 1.0
245+import SystemSettings.ListItems 1.0 as SettingsListItems
246 import Ubuntu.Components 1.3
247 import Ubuntu.Components.Popups 1.3
248-import Ubuntu.Components.ListItems 1.3 as ListItem
249 import Ubuntu.SystemSettings.Bluetooth 1.0
250
251 Page {
252@@ -96,63 +96,37 @@
253 right: parent.right
254 }
255
256- ListItem.SingleValue {
257+ SettingsListItems.SingleValue {
258 text: i18n.tr("Name")
259 value: backend.selectedDevice &&
260 backend.selectedDevice.name.length > 0 ?
261 backend.selectedDevice.name :
262 i18n.tr("None")
263 }
264- ListItem.Standard {
265- Rectangle {
266- color: "transparent"
267- anchors.fill: parent
268- anchors.topMargin: units.gu(1)
269- anchors.leftMargin: units.gu(2)
270- anchors.rightMargin: units.gu(2)
271-
272- Label {
273- anchors {
274- top: parent.top
275- left: parent.left
276- topMargin: units.gu(1)
277- }
278- height: units.gu(3)
279- text: i18n.tr("Type")
280- }
281- Image {
282- anchors {
283- right: deviceType.left
284- rightMargin: units.gu(1)
285- }
286- height: units.gu(4)
287- width: units.gu(4)
288- source: backend.selectedDevice ? backend.selectedDevice.iconName : ""
289- }
290- Label {
291- id: deviceType
292- anchors {
293- top: parent.top
294- right: parent.right
295- topMargin: units.gu(1)
296- }
297- height: units.gu(3)
298- text: getTypeString(backend.selectedDevice ? backend.selectedDevice.type : Device.OTHER)
299- }
300+ SettingsListItems.SingleValue {
301+ text: i18n.tr("Type")
302+ value: getTypeString(backend.selectedDevice ? backend.selectedDevice.type : Device.OTHER)
303+ Image {
304+ height: units.gu(4)
305+ width: units.gu(4)
306+ source: backend.selectedDevice ? backend.selectedDevice.iconName : ""
307+ visible: source
308+ SlotsLayout.position: SlotsLayout.Trailing-1
309 }
310 }
311- ListItem.SingleValue {
312+ SettingsListItems.SingleValue {
313 text: i18n.tr("Status")
314 value: getStatusString(backend.selectedDevice ? backend.selectedDevice.connection : Device.Disconnected)
315 }
316- ListItem.SingleValue {
317+ SettingsListItems.SingleValue {
318 text: i18n.tr("Signal Strength")
319 value: getSignalString(backend.selectedDevice ? backend.selectedDevice.strength : Device.None)
320 }
321- ListItem.Standard {
322+ SettingsListItems.Standard {
323 id: trustedCheck
324 text: i18n.tr("Connect automatically when detected:")
325- control: CheckBox {
326+
327+ CheckBox {
328 property bool serverChecked: backend.selectedDevice ? backend.selectedDevice.trusted : false
329 onServerCheckedChanged: checked = serverChecked
330 Component.onCompleted: checked = serverChecked
331@@ -163,8 +137,10 @@
332 }
333 }
334 }
335- ListItem.SingleControl {
336- control: Button {
337+
338+ SettingsListItems.SingleControl {
339+
340+ Button {
341 text: backend.selectedDevice && (backend.selectedDevice.connection == Device.Connected || backend.selectedDevice.connection == Device.Connecting) ? i18n.tr("Disconnect") : i18n.tr("Connect")
342 width: parent.width - units.gu(8)
343 onClicked: {
344@@ -184,8 +160,10 @@
345 enabled: backend.selectedDevice && backend.powered ? (backend.isSupportedType(backend.selectedDevice.type) || backend.selectedDevice.connection != Device.Disconnected) : false
346 }
347 }
348- ListItem.SingleControl {
349- control: Button {
350+
351+ SettingsListItems.SingleControl {
352+
353+ Button {
354 text: i18n.tr("Forget this device")
355 width: parent.width - units.gu(8)
356 onClicked: {
357
358=== modified file 'plugins/bluetooth/PageComponent.qml'
359--- plugins/bluetooth/PageComponent.qml 2015-11-20 08:47:27 +0000
360+++ plugins/bluetooth/PageComponent.qml 2015-11-23 13:42:19 +0000
361@@ -21,9 +21,9 @@
362 import QMenuModel 0.1
363 import QtQuick 2.4
364 import SystemSettings 1.0
365+import SystemSettings.ListItems 1.0 as SettingsListItems
366 import Ubuntu.Components 1.3
367 import Ubuntu.Components.Popups 1.3
368-import Ubuntu.Components.ListItems 1.3 as ListItem
369 import Ubuntu.SystemSettings.Bluetooth 1.0
370 import Ubuntu.Settings.Components 0.1 as USC
371
372@@ -215,9 +215,10 @@
373 Component.onCompleted: start()
374 }
375
376- ListItem.Standard {
377+ SettingsListItems.Standard {
378 text: i18n.tr("Bluetooth")
379- control: Switch {
380+
381+ Switch {
382 id: btSwitch
383 property bool serverChecked: bluetoothActionGroup.enabled.state != undefined ? bluetoothActionGroup.enabled.state : false
384 USC.ServerPropertySynchroniser {
385@@ -232,77 +233,59 @@
386 }
387
388 // Discoverability
389- ListItem.Standard {
390+ SettingsListItems.SingleValue {
391+ text: backend.discoverable ? i18n.tr("Discoverable") : i18n.tr("Not discoverable")
392+ value: backend.discoverable ? backend.adapterName() : ""
393 enabled: bluetoothActionGroup.enabled
394 showDivider: false
395
396- Rectangle {
397- color: "transparent"
398- anchors.fill: parent
399- anchors.topMargin: units.gu(1)
400- anchors.leftMargin: units.gu(2)
401- anchors.rightMargin: units.gu(2)
402-
403- Label {
404- anchors {
405- top: parent.top
406- left: parent.left
407- topMargin: units.gu(1)
408- }
409- height: units.gu(3)
410- text: backend.discoverable ? i18n.tr("Discoverable") : i18n.tr("Not discoverable")
411- }
412-
413- Label {
414- anchors {
415- top: parent.top
416- right: parent.right
417- topMargin: units.gu(1)
418- }
419- height: units.gu(3)
420- text: backend.discoverable ? backend.adapterName() : ""
421- color: "darkgrey"
422- visible: backend.discoverable
423- enabled: false
424- }
425-
426- ActivityIndicator {
427- anchors {
428- top: parent.top
429- right: parent.right
430- topMargin: units.gu(1)
431- }
432- visible: backend.powered && !backend.discoverable
433- running: visible
434- }
435+ ActivityIndicator {
436+ visible: backend.powered && !backend.discoverable
437+ running: visible
438 }
439 }
440
441- ListItem.Standard {
442+ SettingsItemTitle {
443 id: connectedHeader
444- text: i18n.tr("Connected devices:")
445-
446+ text: i18n.tr("Connect a device")
447 enabled: bluetoothActionGroup.enabled
448- visible: connectedList.visible
449+ visible: connectList.visible
450+
451+ ActivityIndicator {
452+ anchors {
453+ right: parent.right
454+ top: parent.top
455+ margins: units.gu(1.5)
456+ }
457+ visible: backend.powered && backend.discovering
458+ running: visible
459+ }
460 }
461
462 Column {
463- id: connectedList
464+
465 anchors {
466 left: parent.left
467 right: parent.right
468 }
469- visible: (bluetoothActionGroup.enabled.state != undefined && bluetoothActionGroup.enabled.state) && (connectedRepeater.count > 0)
470- objectName: "connectedList"
471
472- Repeater {
473- id: connectedRepeater
474+ ListView {
475+ id: connectList
476+ height: contentItem.height
477+ anchors {
478+ left: parent.left
479+ right: parent.right
480+ }
481+ visible: (bluetoothActionGroup.enabled.state != undefined && bluetoothActionGroup.enabled.state)
482+ objectName: "connectedList"
483 model: backend.connectedDevices
484- delegate: ListItem.Standard {
485+ delegate: SettingsListItems.IconProgression {
486 iconSource: iconPath
487- iconFrame: false
488 text: getDisplayName(type, displayName)
489- control: ActivityIndicator {
490+ layout.subtitle.text: connection == Device.Connecting ? i18n.tr("Connecting…") : i18n.tr("Connected")
491+ layout.subtitle.color: UbuntuColors.green
492+
493+ ActivityIndicator {
494 visible: connection == Device.Connecting
495 running: visible
496 }
497@@ -310,50 +293,31 @@
498 backend.setSelectedDevice(addressName);
499 pageStack.push(Qt.resolvedUrl("DevicePage.qml"), {backend: backend, root: root});
500 }
501- progression: true
502- }
503- }
504- }
505-
506- SettingsItemTitle {
507- id: disconnectedHeader
508- text: connectedList.visible ? i18n.tr("Connect another device:") : i18n.tr("Connect a device:")
509- enabled: bluetoothActionGroup.enabled.state != undefined ? bluetoothActionGroup.enabled.state : false
510- control: ActivityIndicator {
511- visible: backend.powered && backend.discovering
512- running: visible
513- }
514- }
515-
516- Column {
517- id: disconnectedList
518- anchors {
519- left: parent.left
520- right: parent.right
521- }
522- visible: (bluetoothActionGroup.enabled.state != undefined && bluetoothActionGroup.enabled.state) && (disconnectedRepeater.count > 0)
523- objectName: "disconnectedList"
524-
525- Repeater {
526- id: disconnectedRepeater
527+ }
528+ }
529+
530+ ListView {
531+ id: disconnectedList
532+ height: contentItem.height
533+ anchors {
534+ left: parent.left
535+ right: parent.right
536+ }
537 model: backend.disconnectedDevices
538- delegate: ListItem.Standard {
539+ delegate: SettingsListItems.IconProgression {
540 iconSource: iconPath
541- iconFrame: false
542 text: getDisplayName(type, displayName)
543 onClicked: {
544 backend.setSelectedDevice(addressName);
545 pageStack.push(Qt.resolvedUrl("DevicePage.qml"), {backend: backend, root: root});
546 }
547- progression: true
548 }
549 }
550- }
551- ListItem.Standard {
552- id: disconnectedNone
553- text: i18n.tr("None detected")
554- visible: !disconnectedList.visible && disconnectedHeader.visible
555- enabled: false
556+
557+ SettingsListItems.Standard {
558+ text: i18n.tr("None detected")
559+ visible: connectList.count === 0 && disconnectedList.count === 0
560+ }
561 }
562
563 SettingsItemTitle {
564@@ -374,15 +338,13 @@
565 Repeater {
566 id: autoconnectRepeater
567 model: backend.autoconnectDevices
568- delegate: ListItem.Standard {
569+ delegate: SettingsListItems.IconProgression {
570 iconSource: iconPath
571- iconFrame: false
572 text: getDisplayName(type, displayName)
573 onClicked: {
574 backend.setSelectedDevice(addressName);
575 pageStack.push(Qt.resolvedUrl("DevicePage.qml"), {backend: backend, root: root});
576 }
577- progression: true
578 }
579 }
580 }
581
582=== modified file 'plugins/brightness/PageComponent.qml'
583--- plugins/brightness/PageComponent.qml 2015-08-10 13:31:45 +0000
584+++ plugins/brightness/PageComponent.qml 2015-11-23 13:42:19 +0000
585@@ -1,7 +1,7 @@
586 /*
587 * This file is part of system-settings
588 *
589- * Copyright (C) 2013-14 Canonical Ltd.
590+ * Copyright (C) 2013-2015 Canonical Ltd.
591 *
592 * Contact: Iain Lane <iain.lane@canonical.com>
593 *
594@@ -21,8 +21,8 @@
595 import GSettings 1.0
596 import QtQuick 2.4
597 import SystemSettings 1.0
598+import SystemSettings.ListItems 1.0 as SettingsListItems
599 import Ubuntu.Components 1.3
600-import Ubuntu.Components.ListItems 1.3 as ListItem
601 import Ubuntu.SystemSettings.Brightness 1.0
602 import Ubuntu.Settings.Menus 0.1 as Menus
603 import Ubuntu.Settings.Components 0.1 as USC
604@@ -53,7 +53,7 @@
605 Component.onCompleted: start()
606 }
607
608- ListItem.Standard {
609+ SettingsListItems.Standard {
610 text: i18n.tr("Display brightness")
611 showDivider: false
612 }
613@@ -84,12 +84,17 @@
614 }
615 }
616
617- ListItem.Standard {
618+ SettingsListItems.Standard {
619 id: adjust
620 text: i18n.tr("Adjust automatically")
621 visible: brightnessPanel.powerdRunning &&
622 brightnessPanel.autoBrightnessAvailable
623- control: CheckBox {
624+
625+ layout.summary.text: i18n.tr(
626+ "Brightens and dims the display to suit the surroundings."
627+ )
628+
629+ CheckBox {
630 id: autoAdjustCheck
631 property bool serverChecked: gsettings.autoBrightness
632 onServerCheckedChanged: checked = serverChecked
633@@ -98,11 +103,6 @@
634 }
635 showDivider: false
636 }
637- ListItem.Caption {
638- text: i18n.tr(
639- "Brightens and dims the display to suit the surroundings.")
640- visible: adjust.visible
641- }
642 }
643
644 GSettings {
645
646=== modified file 'plugins/cellular/Components/MultiSim.qml'
647--- plugins/cellular/Components/MultiSim.qml 2015-09-18 14:18:11 +0000
648+++ plugins/cellular/Components/MultiSim.qml 2015-11-23 13:42:19 +0000
649@@ -20,8 +20,9 @@
650 import QtQuick 2.4
651 import GSettings 1.0
652 import SystemSettings 1.0
653+import SystemSettings.ListItems 1.0 as SettingsListItems
654 import Ubuntu.Components 1.3
655-import Ubuntu.Components.ListItems 1.3 as ListItem
656+import Ubuntu.Components.ListItems 1.3 as ListItems
657
658 /* This is a temporary solution to the issue of Hotspots failing on mako. If
659 the device is mako, we hide the hotspot entry. Will be removed once lp:1434591
660@@ -53,20 +54,17 @@
661 anchors { left: parent.left; right: parent.right }
662 }
663
664- ListItem.Standard {
665+ SettingsListItems.StandardProgression {
666 id: dataUsage
667 text: i18n.tr("Data usage statistics")
668- progression: true
669 visible: showAllUI
670 }
671
672- ListItem.Divider {}
673-
674- ListItem.SingleValue {
675+ SettingsListItems.SingleValueProgression {
676 text: i18n.tr("Carriers")
677 id: chooseCarrier
678 objectName: "carrierApnEntry"
679- progression: enabled
680+ progressionVisible: enabled
681 showDivider: false
682 onClicked: {
683 pageStack.push(Qt.resolvedUrl("../PageCarriersAndApns.qml"), {
684@@ -75,26 +73,24 @@
685 }
686 }
687
688- ListItem.Divider {}
689-
690 SimEditor {
691 anchors { left: parent.left; right: parent.right }
692 }
693
694- ListItem.Divider {}
695+ ListItems.Divider {}
696
697 DefaultSim {
698 anchors { left: parent.left; right: parent.right }
699 }
700
701- ListItem.Divider {}
702+ ListItems.Divider {}
703
704 SettingsItemTitle { text: i18n.tr("Connection type:") }
705
706 Repeater {
707 model: sims
708
709- ListItem.ItemSelector {
710+ ListItems.ItemSelector {
711 id: radio
712 property var sim: modelData
713
714
715=== modified file 'plugins/cellular/Components/Sim.qml'
716--- plugins/cellular/Components/Sim.qml 2015-08-10 13:31:45 +0000
717+++ plugins/cellular/Components/Sim.qml 2015-11-23 13:42:19 +0000
718@@ -37,6 +37,10 @@
719 return name + (number ? " (" + number + ")" : "");
720 }
721
722+ function getTechString () {
723+ return techToString(radioSettings.technologyPreference);
724+ }
725+
726 function techToString (tech) {
727 var strings = {
728 'gsm': i18n.tr("2G only (saves battery)"),
729@@ -44,7 +48,7 @@
730 'lte': i18n.tr("2G/3G/4G (faster)")
731 };
732 strings['umts_enable'] = strings['umts'];
733- return strings[tech];
734+ return strings[tech] || "";
735 }
736
737 // adds umts_enable to an copy of model
738
739=== modified file 'plugins/cellular/Components/SingleSim.qml'
740--- plugins/cellular/Components/SingleSim.qml 2015-08-21 14:03:29 +0000
741+++ plugins/cellular/Components/SingleSim.qml 2015-11-23 13:42:19 +0000
742@@ -18,9 +18,9 @@
743 *
744 */
745 import QtQuick 2.4
746-import SystemSettings 1.0
747+import SystemSettings.ListItems 1.0 as SettingsListItems
748+import Ubuntu.SystemSettings.Cellular 1.0
749 import Ubuntu.Components 1.3
750-import Ubuntu.Components.ListItems 1.3 as ListItem
751
752 Column {
753
754@@ -32,10 +32,11 @@
755 @prevOnlineModem path to modem that was online before this event */
756 signal umtsModemChanged (var sim, string prevOnlineModem);
757
758- ListItem.Standard {
759+ SettingsListItems.Standard {
760 id: selector
761 text: i18n.tr("Cellular data:")
762- control: Switch {
763+
764+ Switch {
765 id: dataControl
766 objectName: 'data'
767 property bool serverChecked: sim.connMan.powered
768@@ -45,11 +46,12 @@
769 }
770 }
771
772- ListItem.Standard {
773+ SettingsListItems.Standard {
774 id: dataRoamingItem
775 text: i18n.tr("Data roaming")
776 enabled: sim.connMan.powered
777- control: Switch {
778+
779+ Switch {
780 id: dataRoamingControl
781 objectName: "roaming"
782 property bool serverChecked: sim.connMan.roamingAllowed
783@@ -59,31 +61,24 @@
784 }
785 }
786
787- ListItem.Standard {
788+ SettingsListItems.StandardProgression{
789 text: i18n.tr("Data usage statistics")
790- progression: true
791 visible: showAllUI
792 }
793
794- ListItem.Divider {
795- visible: radio.visible
796- }
797-
798- RadioSingleSim {
799- id: radio
800- anchors { left: parent.left; right: parent.right }
801- visible: radio.enabled
802- }
803-
804- ListItem.Divider {}
805-
806- ListItem.SingleValue {
807- text: i18n.tr("Carrier");
808+ SettingsListItems.SingleValueProgression {
809+ text: i18n.tr("Carrier & APN");
810 id: chooseCarrier
811 objectName: "carrierApnEntry"
812- progression: enabled
813+ value: sim.netReg.name || ""
814 onClicked: pageStack.push(Qt.resolvedUrl("../PageCarrierAndApn.qml"), {
815 sim: sim
816 })
817 }
818+
819+ RadioSingleSim {
820+ id: radio
821+ anchors { left: parent.left; right: parent.right }
822+ visible: radio.enabled
823+ }
824 }
825
826=== modified file 'plugins/cellular/PageCarrierAndApn.qml'
827--- plugins/cellular/PageCarrierAndApn.qml 2015-08-10 13:31:45 +0000
828+++ plugins/cellular/PageCarrierAndApn.qml 2015-11-23 13:42:19 +0000
829@@ -19,12 +19,12 @@
830 */
831 import QtQuick 2.4
832 import SystemSettings 1.0
833+import SystemSettings.ListItems 1.0 as SettingsListItems
834 import Ubuntu.Components 1.3
835-import Ubuntu.Components.ListItems 1.3 as ListItem
836
837 ItemPage {
838 id: root
839- title: i18n.tr("Carrier")
840+ title: i18n.tr("Carrier & APN")
841 objectName: "carrierApnPage"
842 flickable: null
843
844@@ -40,23 +40,23 @@
845 anchors.left: parent.left
846 anchors.right: parent.right
847
848- ListItem.SingleValue {
849+ SettingsListItems.SingleValueProgression {
850 text: i18n.tr("Carrier")
851 objectName: "carrier"
852 value: sim.netReg.name ? sim.netReg.name : i18n.tr("None")
853 enabled: (sim.netReg.status !== "") &&
854 (sim.netReg.mode !== "auto-only")
855- progression: enabled
856+ progressionVisible: enabled
857 onClicked: pageStack.push(Qt.resolvedUrl("PageChooseCarrier.qml"), {
858 sim: sim,
859 title: i18n.tr("Carrier")
860 })
861 }
862
863- ListItem.Standard {
864+ SettingsListItems.SingleValueProgression {
865 text: i18n.tr("APN")
866 objectName: "apn"
867- progression: enabled
868+ progressionVisible: enabled
869 onClicked: pageStack.push(Qt.resolvedUrl("PageChooseApn.qml"), {
870 sim: sim
871 })
872
873=== modified file 'plugins/cellular/PageCarriersAndApns.qml'
874--- plugins/cellular/PageCarriersAndApns.qml 2015-08-10 13:31:45 +0000
875+++ plugins/cellular/PageCarriersAndApns.qml 2015-11-23 13:42:19 +0000
876@@ -19,12 +19,12 @@
877 */
878 import QtQuick 2.4
879 import SystemSettings 1.0
880+import SystemSettings.ListItems 1.0 as SettingsListItems
881 import Ubuntu.Components 1.3
882-import Ubuntu.Components.ListItems 1.3 as ListItem
883
884 ItemPage {
885 id: root
886- title: i18n.tr("Carriers")
887+ title: i18n.tr("Carriers & APNs")
888 objectName: "carrierApnPage"
889 flickable: null
890
891@@ -40,56 +40,39 @@
892 anchors.left: parent.left
893 anchors.right: parent.right
894
895- SettingsItemTitle {
896- text: sims[0].title
897- }
898-
899- ListItem.SingleValue {
900- text: i18n.tr("Carrier")
901- objectName: sims[0].path + "_carriers"
902- value: sims[0].netReg.name ? sims[0].netReg.name :
903- i18n.tr("None")
904- enabled: (sims[0].netReg.status !== "") &&
905- (sims[0].netReg.mode !== "auto-only")
906- progression: enabled
907- onClicked: pageStack.push(Qt.resolvedUrl("PageChooseCarrier.qml"), {
908- sim: sims[0],
909- title: sims[0].title
910- })
911- }
912-
913- ListItem.Standard {
914- text: i18n.tr("APN")
915- progression: enabled
916- onClicked: pageStack.push(Qt.resolvedUrl("PageChooseApn.qml"), {
917- sim: sims[0]
918- })
919- }
920-
921- SettingsItemTitle {
922- text: sims[1].title
923- }
924-
925- ListItem.SingleValue {
926- text: i18n.tr("Carrier")
927- objectName: sims[1].path + "_carriers"
928- value: sims[1].netReg.name ? sims[1].netReg.name :
929- i18n.tr("None")
930- enabled: (sims[1].netReg.status !== "") &&
931- (sims[1].netReg.mode !== "auto-only")
932- progression: enabled
933- onClicked: pageStack.push(Qt.resolvedUrl("PageChooseCarrier.qml"), {
934- sim: sims[1],
935- title: sims[1].title
936- })
937- }
938-
939- ListItem.Standard {
940- text: i18n.tr("APN")
941- progression: enabled
942- onClicked: pageStack.push(Qt.resolvedUrl("PageChooseApn.qml"), {
943- sim: sims[1]
944- })
945+ Repeater {
946+ model: sims
947+
948+ Column {
949+ anchors.left: parent.left
950+ anchors.right: parent.right
951+
952+ SettingsItemTitle {
953+ text: sims[index].title
954+ }
955+
956+ SettingsListItems.SingleValueProgression {
957+ text: i18n.tr("Carrier")
958+ objectName: sims[index].path + "_carriers"
959+ value: sims[index].netReg.name ? sims[index].netReg.name :
960+ i18n.tr("None")
961+ enabled: (sims[index].netReg.status !== "") &&
962+ (sims[index].netReg.mode !== "auto-only")
963+ progressionVisible: enabled
964+ onClicked: pageStack.push(Qt.resolvedUrl("PageChooseCarrier.qml"), {
965+ sim: sims[index],
966+ title: sims[index].title
967+ })
968+ }
969+
970+ SettingsListItems.StandardProgression {
971+ text: i18n.tr("APN")
972+ progressionVisible: enabled
973+ onClicked: pageStack.push(Qt.resolvedUrl("PageChooseApn.qml"), {
974+ sim: sims[index]
975+ })
976+ }
977+ }
978 }
979 }
980 }
981
982=== modified file 'plugins/cellular/PageChooseApn.qml'
983--- plugins/cellular/PageChooseApn.qml 2015-08-10 13:31:45 +0000
984+++ plugins/cellular/PageChooseApn.qml 2015-11-23 13:42:19 +0000
985@@ -25,9 +25,9 @@
986
987 import QtQuick 2.4
988 import SystemSettings 1.0
989+import SystemSettings.ListItems 1.0 as SettingsListItems
990 import Ubuntu.Components 1.3
991 import Ubuntu.Components.Popups 1.3
992-import Ubuntu.Components.ListItems 1.3 as ListItem
993 import MeeGo.QOfono 0.2
994 import Ubuntu.SystemSettings.Cellular 1.0
995 import "apn_manager.js" as Manager
996@@ -283,16 +283,24 @@
997 Component {
998 id: apnDelegate
999
1000- ListItem.Standard {
1001+
1002+
1003+ SettingsListItems.StandardProgression {
1004 id: apnListItem
1005- property alias text: apnItemName.text
1006+ text: qml.name
1007+ layout.subtitle.text: qml.typeString
1008 objectName: "edit_" + qml.name
1009- height: units.gu(6)
1010- removable: true
1011- confirmRemoval: true
1012- progression: true
1013-
1014- onItemRemoved: Manager.removeContext(path);
1015+
1016+ leadingActions: ListItemActions {
1017+ actions: [
1018+ Action {
1019+ iconName: "delete"
1020+ name: i18n.tr("Delete")
1021+ onTriggered: Manager.removeContext(path)
1022+ }
1023+ ]
1024+ }
1025+
1026 onClicked: {
1027 editor = pageStack.push(Qt.resolvedUrl("PageApnEditor.qml"), {
1028 manager: Manager,
1029@@ -303,7 +311,7 @@
1030 });
1031 }
1032
1033- control: CheckBox {
1034+ CheckBox {
1035 id: check
1036 objectName: qml.name + "_preferred"
1037 property bool serverChecked: qml && qml.preferred
1038@@ -311,45 +319,6 @@
1039 Component.onCompleted: checked = serverChecked
1040 onTriggered: Manager.setPreferred.call(this, qml, checked)
1041 }
1042-
1043- Item {
1044- anchors {
1045- top: parent.top
1046- bottom: parent.bottom
1047- left: parent.left
1048- leftMargin: units.gu(2)
1049- right: parent.right
1050- }
1051-
1052- Label {
1053- id: apnItemName
1054- anchors {
1055- topMargin: units.gu(1)
1056- top: parent.top
1057- left: parent.left
1058- right: parent.right
1059- }
1060-
1061- text: qml.name
1062- elide: Text.ElideRight
1063- opacity: apnListItem.enabled ? 1.0 : 0.5
1064- }
1065-
1066- Label {
1067- id: apnItemType
1068- anchors {
1069- left: parent.left
1070- right: parent.right
1071- top: apnItemName.bottom
1072- }
1073-
1074- text: qml.typeString
1075- color: Theme.palette.normal.backgroundText
1076- fontSize: "small"
1077- wrapMode: Text.Wrap
1078- maximumLineCount: 5
1079- }
1080- }
1081 }
1082 }
1083
1084
1085=== modified file 'plugins/cellular/PageComponent.qml'
1086--- plugins/cellular/PageComponent.qml 2015-08-13 13:13:57 +0000
1087+++ plugins/cellular/PageComponent.qml 2015-11-23 13:42:19 +0000
1088@@ -22,7 +22,6 @@
1089 import SystemSettings 1.0
1090 import Ubuntu.SystemSettings.Cellular 1.0
1091 import Ubuntu.Components 1.3
1092-import Ubuntu.Components.ListItems 1.3 as ListItem
1093 import MeeGo.QOfono 0.2
1094 import QMenuModel 0.1
1095 import "Components" as LocalComponents
1096
1097=== modified file 'plugins/flight-mode/EntryComponent.qml'
1098--- plugins/flight-mode/EntryComponent.qml 2015-08-10 13:31:45 +0000
1099+++ plugins/flight-mode/EntryComponent.qml 2015-11-23 13:42:19 +0000
1100@@ -1,7 +1,7 @@
1101 /*
1102 * This file is part of system-settings
1103 *
1104- * Copyright (C) 2013 Canonical Ltd.
1105+ * Copyright (C) 2013-2015 Canonical Ltd.
1106 *
1107 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
1108 *
1109@@ -19,17 +19,17 @@
1110 */
1111
1112 import QtQuick 2.4
1113+import SystemSettings.ListItems 1.0 as SettingsListItems
1114 import Ubuntu.Components 1.3
1115-import Ubuntu.Components.ListItems 1.3 as ListItem
1116 import Ubuntu.SystemSettings.FlightMode 1.0 as FlightMode
1117 import Ubuntu.Settings.Components 0.1 as USC
1118
1119-ListItem.Standard {
1120+SettingsListItems.Icon {
1121 id: root
1122 iconSource: model.icon
1123- iconFrame: false
1124 text: i18n.tr(model.displayName)
1125- control: Switch {
1126+
1127+ Switch {
1128 id: switchItem
1129
1130 USC.ServerPropertySynchroniser {
1131@@ -42,7 +42,7 @@
1132 }
1133 }
1134
1135- FlightMode.Helper {
1136+ resources: FlightMode.Helper {
1137 id: helper
1138 }
1139 }
1140
1141=== modified file 'plugins/hotspot/HotspotSetup.qml'
1142--- plugins/hotspot/HotspotSetup.qml 2015-09-18 14:18:11 +0000
1143+++ plugins/hotspot/HotspotSetup.qml 2015-11-23 13:42:19 +0000
1144@@ -19,8 +19,9 @@
1145 import QtQuick 2.4
1146 import QtQuick.Layouts 1.1
1147 import SystemSettings 1.0
1148+import SystemSettings.ListItems 1.0 as SettingsListItems
1149 import Ubuntu.Components 1.3
1150-import Ubuntu.Components.ListItems 1.3 as ListItem
1151+import Ubuntu.Components.ListItems 1.3 as ListItems
1152 import Ubuntu.Components.Popups 1.3
1153 import Ubuntu.Connectivity 1.0
1154 import Ubuntu.SystemSettings.Cellular 1.0
1155@@ -187,35 +188,23 @@
1156 width: parent.width
1157 }
1158
1159- ListItem.Empty {
1160+ SettingsListItems.Standard {
1161 id: passwordRequired
1162- onClicked: passwordRequiredToggle.trigger()
1163+ text: i18n.tr("Require a password (recommended):")
1164+ showDivider: false
1165+ layout.padding.leading: 0
1166+ SlotsLayout.padding.leading: 0
1167
1168 CheckBox {
1169 id: passwordRequiredToggle
1170 objectName: "passwordRequiredToggle"
1171 checked: Connectivity.hotspotAuth === "wpa-psk"
1172- anchors {
1173- left: parent.left
1174- verticalCenter: parent.verticalCenter
1175- }
1176+ SlotsLayout.position: SlotsLayout.First
1177+ SlotsLayout.padding.leading: 0
1178 // FIXME: Workaround for lp:1415023
1179 activeFocusOnPress: false
1180 }
1181-
1182- Label {
1183- id: passwordRequiredLabel
1184- anchors {
1185- left: passwordRequiredToggle.right
1186- leftMargin: units.gu(1)
1187- right: parent.right
1188- verticalCenter: parent.verticalCenter
1189- }
1190-
1191- // FIXME: Workaround for label not wrapping (lp:1442851)
1192- wrapMode: Text.Wrap
1193- text: i18n.tr("Require a password (recommended):")
1194- }
1195+ onClicked: passwordRequiredToggle.trigger()
1196 }
1197
1198 TextField {
1199@@ -229,39 +218,25 @@
1200 width: parent.width
1201 }
1202
1203- ListItem.Empty {
1204+ SettingsListItems.Standard {
1205 id: passwordVisible
1206 enabled: passwordRequiredToggle.checked
1207- onClicked: passwordVisibleToggle.trigger()
1208+ text: i18n.tr("Show password")
1209+ layout.padding.leading: 0
1210+ SlotsLayout.padding.leading: 0
1211
1212 CheckBox {
1213 id: passwordVisibleToggle
1214 enabled: parent.enabled
1215- anchors {
1216- left: parent.left
1217- verticalCenter: parent.verticalCenter
1218- }
1219-
1220+ SlotsLayout.position: SlotsLayout.First
1221+ SlotsLayout.padding.leading: 0
1222 // FIXME: Workaround for lp:1415023
1223 activeFocusOnPress: false
1224 }
1225-
1226- Label {
1227- id: passwordVisibleLabel
1228-
1229- /* FIXME: use enabled when lp:1491802 is fixed, or use
1230- CheckBox.text once lp:1323238 is fixed. */
1231- opacity: passwordRequiredToggle.checked ? 1 : 0.5
1232- anchors {
1233- left: passwordVisibleToggle.right
1234- leftMargin: units.gu(1)
1235- verticalCenter: parent.verticalCenter
1236- }
1237- text: i18n.tr("Show password")
1238- }
1239+ onClicked: passwordVisibleToggle.trigger()
1240 }
1241
1242- ListItem.Caption {
1243+ ListItems.Caption {
1244 id: enableWifiCaption
1245 anchors {
1246 left: parent.left
1247
1248=== modified file 'plugins/hotspot/PageComponent.qml'
1249--- plugins/hotspot/PageComponent.qml 2015-09-18 14:18:11 +0000
1250+++ plugins/hotspot/PageComponent.qml 2015-11-23 13:42:19 +0000
1251@@ -20,8 +20,9 @@
1252
1253 import QtQuick 2.4
1254 import SystemSettings 1.0
1255+import SystemSettings.ListItems 1.0 as SettingsListItems
1256+import Ubuntu.Components.ListItems 1.3 as ListItems
1257 import Ubuntu.Components 1.3
1258-import Ubuntu.Components.ListItems 1.3 as ListItem
1259 import Ubuntu.Components.Popups 1.3
1260 import Ubuntu.Connectivity 1.0
1261
1262@@ -77,15 +78,15 @@
1263 }
1264 spacing: units.gu(1)
1265
1266- ListItem.Standard {
1267+ SettingsListItems.Standard {
1268 id: hotspotItem
1269 text: i18n.tr("Hotspot")
1270 enabled: Connectivity.hotspotStored
1271 onClicked: hotspotSwitch.trigger()
1272- control: Switch {
1273+
1274+ Switch {
1275 id: hotspotSwitch
1276 objectName: "hotspotSwitch"
1277- enabled: parent.enabled
1278 checked: Connectivity.hotspotEnabled
1279 onTriggered: Connectivity.hotspotEnabled = checked
1280
1281@@ -101,7 +102,7 @@
1282 }
1283 }
1284
1285- ListItem.Caption {
1286+ ListItems.Caption {
1287 anchors {
1288 left: parent.left
1289 right: parent.right
1290
1291=== modified file 'plugins/language/KeyboardLayoutItem.qml'
1292--- plugins/language/KeyboardLayoutItem.qml 2015-08-10 13:31:45 +0000
1293+++ plugins/language/KeyboardLayoutItem.qml 2015-11-23 13:42:19 +0000
1294@@ -20,18 +20,18 @@
1295
1296 import QtQuick 2.4
1297 import Ubuntu.Components 1.3
1298-import Ubuntu.Components.ListItems 1.3 as ListItem
1299-
1300-ListItem.Base {
1301- property alias name: name.text
1302- property alias checked: checkBox.checked
1303- property alias shortName: shortName.text
1304-
1305- Row {
1306- anchors.top: parent.top
1307- anchors.left: parent.left
1308- anchors.bottom: parent.bottom
1309- spacing: units.gu(1)
1310+
1311+ListItem {
1312+ property string name
1313+ property alias checked: checkBox.checked
1314+ property alias shortName: shortName.text
1315+
1316+ height: layout.height + divider.height
1317+
1318+ ListItemLayout {
1319+ id: layout
1320+
1321+ title.text: name
1322
1323 Rectangle {
1324 width: units.gu(3.0)
1325@@ -40,8 +40,6 @@
1326
1327 color: Theme.palette.normal.backgroundText
1328
1329- anchors.verticalCenter: parent.verticalCenter
1330-
1331 Label {
1332 id: shortName
1333
1334@@ -50,21 +48,14 @@
1335
1336 anchors.centerIn: parent
1337 }
1338- }
1339-
1340- Label {
1341- id: name
1342-
1343- anchors.verticalCenter: parent.verticalCenter
1344- }
1345- }
1346-
1347- CheckBox {
1348- id: checkBox
1349-
1350- anchors.right: parent.right
1351- anchors.verticalCenter: parent.verticalCenter
1352- }
1353-
1354+
1355+ SlotsLayout.position: SlotsLayout.First
1356+ }
1357+
1358+ CheckBox {
1359+ id: checkBox
1360+ SlotsLayout.position: SlotsLayout.Trailing
1361+ }
1362+ }
1363 onClicked: checked = !checked
1364 }
1365
1366=== modified file 'plugins/language/PageComponent.qml'
1367--- plugins/language/PageComponent.qml 2015-08-10 13:31:45 +0000
1368+++ plugins/language/PageComponent.qml 2015-11-23 13:42:19 +0000
1369@@ -21,9 +21,9 @@
1370 import QtQuick 2.4
1371 import GSettings 1.0
1372 import SystemSettings 1.0
1373+import SystemSettings.ListItems 1.0 as SettingsListItems
1374 import Ubuntu.Components 1.3
1375 import Ubuntu.Components.Popups 1.3
1376-import Ubuntu.Components.ListItems 1.3 as ListItem
1377 import Ubuntu.Settings.Menus 0.1 as Menus
1378 import Ubuntu.SystemSettings.LanguagePlugin 1.0
1379
1380@@ -96,53 +96,56 @@
1381 anchors.left: parent.left
1382 anchors.right: parent.right
1383
1384- Menus.StandardMenu {
1385- iconSource: "image://theme/language-chooser"
1386+ SettingsItemTitle {
1387+ text: i18n.tr("Language")
1388+ }
1389+
1390+ SettingsListItems.Standard {
1391+ id: base
1392+ height: layout.height + divider.height
1393+ objectName: "displayLanguage"
1394+ property int currentLanguage: plugin.currentLanguage
1395 text: i18n.tr("Display language…")
1396- objectName: "displayLanguage"
1397- component: Label {
1398- property int currentLanguage: plugin.currentLanguage
1399- objectName: "currentLanguage"
1400- text: plugin.languageNames[plugin.currentLanguage]
1401- elide: Text.ElideRight
1402- opacity: enabled ? 1.0 : 0.5
1403+ layout.subtitle.text: plugin.languageNames[plugin.currentLanguage]
1404+ layout.subtitle.objectName: "currentLanguage"
1405+
1406+ Icon {
1407+ source: "image://theme/language-chooser"
1408+ height: units.gu(2.5)
1409+ width: height
1410+ SlotsLayout.position: SlotsLayout.First
1411 }
1412-
1413 onClicked: PopupUtils.open(displayLanguage)
1414 }
1415
1416- ListItem.Divider {
1417- }
1418-
1419- ListItem.SingleValue {
1420+ SettingsListItems.SingleValueProgression {
1421 text: i18n.tr("Keyboard layouts")
1422 value: plugin.keyboardLayoutsModel.subset.length == 1 ?
1423 plugin.keyboardLayoutsModel.superset[plugin.keyboardLayoutsModel.subset[0]][0] :
1424 plugin.keyboardLayoutsModel.subset.length
1425- progression: true
1426
1427 onClicked: pageStack.push(keyboardLayouts)
1428 }
1429
1430- ListItem.Divider {
1431+ SettingsItemTitle {
1432+ text: i18n.tr("Correction")
1433 }
1434
1435- ListItem.SingleValue {
1436+ SettingsListItems.SingleValueProgression {
1437 visible: showAllUI
1438
1439 text: i18n.tr("Spell checking")
1440 value: plugin.spellCheckingModel.subset.length == 1 ?
1441 plugin.spellCheckingModel.superset[plugin.spellCheckingModel.subset[0]][0] :
1442 plugin.spellCheckingModel.subset.length
1443- progression: true
1444
1445 onClicked: pageStack.push(spellChecking)
1446 }
1447
1448- ListItem.Standard {
1449+ SettingsListItems.Standard {
1450 text: i18n.tr("Spell checking")
1451
1452- control: Switch {
1453+ Switch {
1454 property bool serverChecked: settings.spellChecking
1455 onServerCheckedChanged: checked = serverChecked
1456 Component.onCompleted: checked = serverChecked
1457@@ -150,10 +153,10 @@
1458 }
1459 }
1460
1461- ListItem.Standard {
1462+ SettingsListItems.Standard {
1463 text: i18n.tr("Auto correction")
1464
1465- control: Switch {
1466+ Switch {
1467 property bool serverChecked: settings.autoCompletion
1468 onServerCheckedChanged: checked = serverChecked
1469 Component.onCompleted: checked = serverChecked
1470@@ -161,10 +164,10 @@
1471 }
1472 }
1473
1474- ListItem.Standard {
1475+ SettingsListItems.Standard {
1476 text: i18n.tr("Word suggestions")
1477
1478- control: Switch {
1479+ Switch {
1480 property bool serverChecked: settings.predictiveText
1481 onServerCheckedChanged: checked = serverChecked
1482 Component.onCompleted: checked = serverChecked
1483@@ -172,13 +175,13 @@
1484 }
1485 }
1486
1487- ListItem.Divider {
1488- }
1489-
1490- ListItem.Standard {
1491+ SettingsListItems.Standard {
1492 text: i18n.tr("Auto capitalization")
1493+ layout.summary.text: i18n.tr(
1494+ "Turns on Shift to capitalize the first letter of each sentence."
1495+ )
1496
1497- control: Switch {
1498+ Switch {
1499 property bool serverChecked: settings.autoCapitalization
1500 onServerCheckedChanged: checked = serverChecked
1501 Component.onCompleted: checked = serverChecked
1502@@ -186,17 +189,13 @@
1503 }
1504 }
1505
1506- ListItem.Caption {
1507- text: i18n.tr("Turns on Shift to capitalize the first letter of each sentence.")
1508- }
1509-
1510- ListItem.ThinDivider {
1511- }
1512-
1513- ListItem.Standard {
1514+ SettingsListItems.Standard {
1515 text: i18n.tr("Auto punctuation")
1516
1517- control: Switch {
1518+ /* TODO: update the string to mention quotes/brackets once the osk does that */
1519+ layout.summary.text: i18n.tr("Inserts a period when you tap Space twice.")
1520+
1521+ Switch {
1522 property bool serverChecked: settings.doubleSpaceFullStop
1523 onServerCheckedChanged: checked = serverChecked
1524 Component.onCompleted: checked = serverChecked
1525@@ -204,18 +203,10 @@
1526 }
1527 }
1528
1529- ListItem.Caption {
1530- /* TODO: update the string to mention quotes/brackets once the osk does that */
1531- text: i18n.tr("Inserts a period when you tap Space twice.")
1532- }
1533-
1534- ListItem.ThinDivider {
1535- }
1536-
1537- ListItem.Standard {
1538+ SettingsListItems.Standard {
1539 text: i18n.tr("Keyboard sound")
1540
1541- control: Switch {
1542+ Switch {
1543 property bool serverChecked: settings.keyPressFeedback
1544 onServerCheckedChanged: checked = serverChecked
1545 Component.onCompleted: checked = serverChecked
1546@@ -223,10 +214,10 @@
1547 }
1548 }
1549
1550- ListItem.Standard {
1551+ SettingsListItems.Standard {
1552 text: i18n.tr("Keyboard vibration")
1553
1554- control: Switch {
1555+ Switch {
1556 property bool serverChecked: settings.keyPressHapticFeedback
1557 onServerCheckedChanged: checked = serverChecked
1558 Component.onCompleted: checked = serverChecked
1559
1560=== modified file 'plugins/language/SpellChecking.qml'
1561--- plugins/language/SpellChecking.qml 2015-08-10 13:31:45 +0000
1562+++ plugins/language/SpellChecking.qml 2015-11-23 13:42:19 +0000
1563@@ -21,8 +21,8 @@
1564 import QtQuick 2.4
1565 import GSettings 1.0
1566 import SystemSettings 1.0
1567+import SystemSettings.ListItems 1.0 as SettingsListItems
1568 import Ubuntu.Components 1.3
1569-import Ubuntu.Components.ListItems 1.3 as ListItem
1570 import Ubuntu.SystemSettings.LanguagePlugin 1.0
1571
1572 ItemPage {
1573@@ -38,12 +38,12 @@
1574 schema.id: "com.canonical.keyboard.maliit"
1575 }
1576
1577- ListItem.Standard {
1578+ SettingsListItems.Standard {
1579 id: item
1580
1581 text: i18n.tr("Spell checking")
1582
1583- control: Switch {
1584+ Switch {
1585 property bool serverChecked: settings.spellChecking
1586 onServerCheckedChanged: checked = serverChecked
1587 Component.onCompleted: checked = serverChecked
1588
1589=== modified file 'plugins/language/SubsetView.qml'
1590--- plugins/language/SubsetView.qml 2015-08-10 13:31:45 +0000
1591+++ plugins/language/SubsetView.qml 2015-11-23 13:42:19 +0000
1592@@ -20,8 +20,8 @@
1593
1594 import QtQuick 2.4
1595 import SystemSettings 1.0
1596+import SystemSettings.ListItems 1.0 as SettingsListItems
1597 import Ubuntu.Components 1.3
1598-import Ubuntu.Components.ListItems 1.3 as ListItem
1599
1600 ListView {
1601 id: root
1602@@ -41,13 +41,14 @@
1603 flickableDirection: Flickable.VerticalFlick
1604
1605 section.property: "subset"
1606- section.delegate: ListItem.Standard {
1607+ section.delegate: SettingsItemTitle {
1608 text: section == "true" ? subsetLabel : supersetLabel
1609 }
1610
1611- delegate: ListItem.Standard {
1612+ delegate: SettingsListItems.Standard {
1613 text: model.display
1614- control: CheckBox {
1615+
1616+ CheckBox {
1617 checked: model.checked
1618 onCheckedChanged: {
1619 var element = model.index < root.model.subset.length ?
1620
1621=== modified file 'plugins/orientation-lock/EntryComponent.qml'
1622--- plugins/orientation-lock/EntryComponent.qml 2015-08-10 13:31:45 +0000
1623+++ plugins/orientation-lock/EntryComponent.qml 2015-11-23 13:42:19 +0000
1624@@ -1,7 +1,7 @@
1625 /*
1626 * This file is part of system-settings
1627 *
1628- * Copyright (C) 2013 Canonical Ltd.
1629+ * Copyright (C) 2013-2015 Canonical Ltd.
1630 *
1631 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
1632 *
1633@@ -21,16 +21,16 @@
1634 import GSettings 1.0
1635 import QtQuick 2.4
1636 import QtQuick.Window 2.1
1637+import SystemSettings.ListItems 1.0 as SettingsListItems
1638 import Ubuntu.Components 1.3
1639-import Ubuntu.Components.ListItems 1.3 as ListItem
1640-
1641-
1642-ListItem.Standard {
1643+
1644+
1645+SettingsListItems.Icon {
1646 id: root
1647 iconSource: model.icon
1648- iconFrame: false
1649 text: i18n.tr(model.displayName)
1650- control: Switch {
1651+
1652+ Switch {
1653 id: control
1654 objectName: "orientationLockSwitch"
1655
1656
1657=== modified file 'plugins/phone/CallForwardItem.qml'
1658--- plugins/phone/CallForwardItem.qml 2015-11-06 12:22:09 +0000
1659+++ plugins/phone/CallForwardItem.qml 2015-11-23 13:42:19 +0000
1660@@ -19,8 +19,9 @@
1661 */
1662
1663 import QtQuick 2.4
1664+import SystemSettings.ListItems 1.0 as SettingsListItems
1665 import Ubuntu.Components 1.3
1666-import Ubuntu.Components.ListItems 1.3 as ListItem
1667+import Ubuntu.Components.ListItems 1.0 as ListItems
1668 import Ubuntu.Components.Themes.Ambiance 0.1
1669 import MeeGo.QOfono 0.2
1670 import "callForwardingUtils.js" as Utils
1671@@ -135,12 +136,13 @@
1672 }
1673 ]
1674
1675- ListItem.ThinDivider { anchors { left: parent.left; right: parent.right }}
1676+ ListItems.ThinDivider { anchors { left: parent.left; right: parent.right }}
1677
1678- ListItem.Standard {
1679+ SettingsListItems.Standard {
1680 id: control
1681 onClicked: check.trigger(!check.checked)
1682- control: CheckBox {
1683+
1684+ CheckBox {
1685 id: check
1686 objectName: "check_" + rule
1687 checked: callForwarding[rule] !== ""
1688@@ -149,13 +151,13 @@
1689 }
1690 }
1691
1692- ListItem.Standard {
1693+ SettingsListItems.Standard {
1694 id: input
1695 visible: false
1696- height: visible ? units.gu(6) : 0
1697 /* TRANSLATORS: This string will be truncated on smaller displays. */
1698 text: i18n.tr("Forward to")
1699- control: TextField {
1700+
1701+ TextField {
1702 id: field
1703 objectName: "field_" + rule
1704 horizontalAlignment: TextInput.AlignRight
1705@@ -198,7 +200,7 @@
1706 }
1707 }
1708
1709- ListItem.SingleValue {
1710+ SettingsListItems.SingleValue {
1711 id: current
1712 objectName: "current_" + rule
1713 visible: value
1714
1715=== modified file 'plugins/phone/CallForwarding.qml'
1716--- plugins/phone/CallForwarding.qml 2015-11-05 16:40:24 +0000
1717+++ plugins/phone/CallForwarding.qml 2015-11-23 13:42:19 +0000
1718@@ -1,7 +1,7 @@
1719 /*
1720 * This file is part of system-settings
1721 *
1722- * Copyright (C) 2013 Canonical Ltd.
1723+ * Copyright (C) 2013-2015 Canonical Ltd.
1724 *
1725 * Contact:
1726 * Sebastien Bacher <sebastien.bacher@canonical.com>
1727@@ -164,7 +164,6 @@
1728 SettingsItemTitle {
1729 id: fwdSomeTitle
1730 text: i18n.tr("Forward incoming calls when:")
1731- showDivider: false
1732 }
1733
1734 CallForwardItem {
1735
1736=== modified file 'plugins/phone/CallWaiting.qml'
1737--- plugins/phone/CallWaiting.qml 2015-08-10 13:31:45 +0000
1738+++ plugins/phone/CallWaiting.qml 2015-11-23 13:42:19 +0000
1739@@ -20,8 +20,9 @@
1740
1741 import QtQuick 2.4
1742 import SystemSettings 1.0
1743+import SystemSettings.ListItems 1.0 as SettingsListItems
1744 import Ubuntu.Components 1.3
1745-import Ubuntu.Components.ListItems 1.3 as ListItem
1746+import Ubuntu.Components.ListItems 1.3 as ListItems
1747 import MeeGo.QOfono 0.2
1748
1749 ItemPage {
1750@@ -42,7 +43,7 @@
1751 callWaitingIndicator.running = false;
1752 }
1753 onVoiceCallWaitingComplete: {
1754- //When the property change is complete, the value of checked should always be in sync with serverChecked
1755+ //When the property change is complete, the value of checked should always be in sync with serverChecked
1756 callWaitingSwitch.checked = callWaitingSwitch.serverChecked
1757 /* Log some additional output to help debug when things don't work */
1758 console.warn('callSettings, onVoiceCallWaitingComplete modem: ' + modemPath + ' success: ' + success + ' ' + voiceCallWaiting);
1759@@ -50,54 +51,40 @@
1760 }
1761 }
1762
1763- ActivityIndicator {
1764- id: callWaitingIndicator
1765- running: true
1766- visible: running && attached
1767- }
1768-
1769- Switch {
1770- id: callWaitingSwitch
1771- objectName: "callWaitingSwitch"
1772- visible: !callWaitingIndicator.running
1773- enabled: callSettings.ready && attached
1774- property bool serverChecked: callSettings.voiceCallWaiting !== "disabled"
1775- onServerCheckedChanged: checked = serverChecked
1776- Component.onCompleted: checked = serverChecked
1777- onTriggered: {
1778- callWaitingIndicator.running = true;
1779- if (checked)
1780- callSettings.voiceCallWaiting = "enabled";
1781- else
1782- callSettings.voiceCallWaiting = "disabled";
1783- }
1784- }
1785-
1786 Column {
1787 anchors.fill: parent
1788
1789- ListItem.Standard {
1790+ SettingsListItems.Standard {
1791 id: callWaitingItem
1792 text: i18n.tr("Call waiting")
1793- control: callWaitingIndicator.running ?
1794- callWaitingIndicator : callWaitingSwitch
1795- }
1796
1797- ListItem.Base {
1798- height: textItem.height + units.gu(2)
1799- Label {
1800- id: textItem
1801- anchors {
1802- left: parent.left
1803- right: parent.right
1804- verticalCenter: parent.verticalCenter
1805+ Switch {
1806+ id: callWaitingSwitch
1807+ objectName: "callWaitingSwitch"
1808+ visible: !callWaitingIndicator.running
1809+ enabled: callSettings.ready && attached
1810+ property bool serverChecked: callSettings.voiceCallWaiting !== "disabled"
1811+ onServerCheckedChanged: checked = serverChecked
1812+ Component.onCompleted: checked = serverChecked
1813+ onTriggered: {
1814+ callWaitingIndicator.running = true;
1815+ if (checked)
1816+ callSettings.voiceCallWaiting = "enabled";
1817+ else
1818+ callSettings.voiceCallWaiting = "disabled";
1819 }
1820-
1821- text: i18n.tr("Lets you answer or start a new call while on another call, and switch between them")
1822- horizontalAlignment: Text.AlignHCenter
1823- wrapMode: Text.WordWrap
1824- }
1825- showDivider: false
1826+ }
1827+
1828+ ActivityIndicator {
1829+ id: callWaitingIndicator
1830+ running: callWaitingIndicator.running
1831+ visible: running && attached
1832+ }
1833+
1834+ }
1835+
1836+ ListItems.Caption {
1837+ text: i18n.tr("Lets you answer or start a new call while on another call, and switch between them")
1838 }
1839 }
1840 }
1841
1842=== modified file 'plugins/phone/MultiSim.qml'
1843--- plugins/phone/MultiSim.qml 2015-11-05 16:40:24 +0000
1844+++ plugins/phone/MultiSim.qml 2015-11-23 13:42:19 +0000
1845@@ -1,5 +1,5 @@
1846 /*
1847- * Copyright (C) 2014 Canonical Ltd
1848+ * Copyright (C) 2014-2015 Canonical Ltd
1849 *
1850 * This program is free software: you can redistribute it and/or modify
1851 * it under the terms of the GNU General Public License version 3 as
1852@@ -21,8 +21,8 @@
1853 import QtQuick 2.4
1854 import GSettings 1.0
1855 import SystemSettings 1.0
1856+import SystemSettings.ListItems 1.0 as SettingsListItems
1857 import Ubuntu.Components 1.3
1858-import Ubuntu.Components.ListItems 1.3 as ListItem
1859
1860 Column {
1861
1862@@ -37,20 +37,18 @@
1863
1864 SettingsItemTitle { text: sims[index].title }
1865
1866- ListItem.Standard {
1867+ SettingsListItems.StandardProgression {
1868 objectName: "callWaitSim" + index
1869 text: i18n.tr("Call waiting")
1870- progression: true
1871 onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), {
1872 sim: sims[index],
1873 headerTitle: sims[index].title
1874 })
1875 }
1876
1877- ListItem.SingleValue {
1878+ SettingsListItems.SingleValueProgression {
1879 objectName: "callFwdSim" + index
1880 text: i18n.tr("Call forwarding")
1881- progression: true
1882 value: sims[index].getCallForwardingSummary()
1883 onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {
1884 sim: sims[index],
1885@@ -58,10 +56,9 @@
1886 })
1887 }
1888
1889- ListItem.Standard {
1890+ SettingsListItems.StandardProgression {
1891 objectName: "simServicesSim" + index
1892 text: i18n.tr("Services")
1893- progression: true
1894 enabled: {
1895 var num;
1896 var map = sims[index].simMng.serviceNumbers;
1897@@ -82,10 +79,6 @@
1898 })
1899 }
1900
1901- ListItem.Divider {
1902- visible: index !== (sims.length - 1)
1903- }
1904-
1905 Binding {
1906 target: sims[index]
1907 property: "name"
1908
1909=== modified file 'plugins/phone/NoSims.qml'
1910--- plugins/phone/NoSims.qml 2015-08-10 13:31:45 +0000
1911+++ plugins/phone/NoSims.qml 2015-11-23 13:42:19 +0000
1912@@ -1,5 +1,5 @@
1913 /*
1914- * Copyright (C) 2014 Canonical Ltd
1915+ * Copyright (C) 2014-2015 Canonical Ltd
1916 *
1917 * This program is free software: you can redistribute it and/or modify
1918 * it under the terms of the GNU General Public License version 3 as
1919@@ -19,28 +19,22 @@
1920 *
1921 */
1922 import QtQuick 2.4
1923-import Ubuntu.Components 1.3
1924-import Ubuntu.Components.ListItems 1.3 as ListItem
1925+import SystemSettings.ListItems 1.0 as SettingsListItems
1926
1927 Column {
1928
1929- ListItem.Standard {
1930+ SettingsListItems.StandardProgression {
1931 text: i18n.tr("Call forwarding")
1932- progression: true
1933 enabled: false
1934 }
1935
1936- ListItem.Standard {
1937+ SettingsListItems.StandardProgression {
1938 text: i18n.tr("Call waiting")
1939- progression: true
1940 enabled: false
1941 }
1942
1943- ListItem.Divider {}
1944-
1945- ListItem.Standard {
1946+ SettingsListItems.StandardProgression {
1947 text: i18n.tr("Services")
1948- progression: true
1949 enabled: false
1950 }
1951 }
1952
1953=== modified file 'plugins/phone/PageComponent.qml'
1954--- plugins/phone/PageComponent.qml 2015-08-10 13:31:45 +0000
1955+++ plugins/phone/PageComponent.qml 2015-11-23 13:42:19 +0000
1956@@ -1,7 +1,7 @@
1957 /*
1958 * This file is part of system-settings
1959 *
1960- * Copyright (C) 2013 Canonical Ltd.
1961+ * Copyright (C) 2013-2015 Canonical Ltd.
1962 *
1963 * Contact: Iain Lane <iain.lane@canonical.com>
1964 *
1965@@ -20,8 +20,8 @@
1966
1967 import QtQuick 2.4
1968 import SystemSettings 1.0
1969+import SystemSettings.ListItems 1.0 as SettingsListItems
1970 import Ubuntu.Components 1.3
1971-import Ubuntu.Components.ListItems 1.3 as ListItem
1972 import Ubuntu.SystemSettings.Sound 1.0
1973 import MeeGo.QOfono 0.2
1974 import "sims.js" as Sims
1975@@ -89,10 +89,8 @@
1976 anchors { left: parent.left; right: parent.right }
1977 }
1978
1979- ListItem.Divider {}
1980-
1981- ListItem.Standard {
1982- control: Switch {
1983+ SettingsListItems.Standard {
1984+ Switch {
1985 objectName: "dialpadSounds"
1986 property bool serverChecked: soundPlugin.dialpadSoundsEnabled
1987 onServerCheckedChanged: checked = serverChecked
1988
1989=== modified file 'plugins/phone/ServiceInfo.qml'
1990--- plugins/phone/ServiceInfo.qml 2015-10-16 13:42:50 +0000
1991+++ plugins/phone/ServiceInfo.qml 2015-11-23 13:42:19 +0000
1992@@ -1,7 +1,7 @@
1993 /*
1994 * This file is part of system-settings
1995 *
1996- * Copyright (C) 2013 Canonical Ltd.
1997+ * Copyright (C) 2013-2015 Canonical Ltd.
1998 *
1999 * Contact: Sebastien Bacher <sebastien.bacher@canonical.com>
2000 *
2001@@ -20,8 +20,8 @@
2002
2003 import QtQuick 2.4
2004 import SystemSettings 1.0
2005+import SystemSettings.ListItems 1.0 as SettingsListItems
2006 import Ubuntu.Components 1.3
2007-import Ubuntu.Components.ListItems 1.3 as ListItem
2008 import Ubuntu.History 0.1
2009 import "dateUtils.js" as DateUtils
2010
2011@@ -83,7 +83,7 @@
2012 verticalCenter: parent.verticalCenter
2013 }
2014
2015- ListItem.Base {
2016+ Item {
2017 anchors.left: parent.left
2018 anchors.right: parent.right
2019 height: lastCalledCol.height + units.gu(6)
2020@@ -112,9 +112,10 @@
2021 }
2022 }
2023
2024- ListItem.SingleControl {
2025+ SettingsListItems.SingleControl {
2026 anchors.bottom: parent.bottom
2027- control: Button {
2028+
2029+ Button {
2030 width: parent.width - units.gu(4)
2031 text: i18n.tr("Call")
2032 onClicked: Qt.openUrlExternally("tel:///" + encodeURIComponent(
2033
2034=== modified file 'plugins/phone/Services.qml'
2035--- plugins/phone/Services.qml 2015-08-10 13:31:45 +0000
2036+++ plugins/phone/Services.qml 2015-11-23 13:42:19 +0000
2037@@ -1,7 +1,7 @@
2038 /*
2039 * This file is part of system-settings
2040 *
2041- * Copyright (C) 2013 Canonical Ltd.
2042+ * Copyright (C) 2013-2015 Canonical Ltd.
2043 *
2044 * Contact: Sebastien Bacher <sebastien.bacher@canonical.com>
2045 *
2046@@ -20,8 +20,8 @@
2047
2048 import QtQuick 2.4
2049 import SystemSettings 1.0
2050+import SystemSettings.ListItems 1.0 as SettingsListItems
2051 import Ubuntu.Components 1.3
2052-import Ubuntu.Components.ListItems 1.3 as ListItem
2053
2054 ItemPage {
2055 id: root
2056@@ -60,8 +60,7 @@
2057 Repeater {
2058 model: names
2059
2060- ListItem.Standard {
2061- progression: true
2062+ SettingsListItems.StandardProgression {
2063 text: modelData
2064 onClicked: pageStack.push(Qt.resolvedUrl("ServiceInfo.qml"), {serviceName: modelData, serviceNumber: sim.serviceNumbers[modelData]})
2065 }
2066
2067=== modified file 'plugins/phone/SingleSim.qml'
2068--- plugins/phone/SingleSim.qml 2015-11-05 16:40:24 +0000
2069+++ plugins/phone/SingleSim.qml 2015-11-23 13:42:19 +0000
2070@@ -1,5 +1,5 @@
2071 /*
2072- * Copyright (C) 2014 Canonical Ltd
2073+ * Copyright (C) 2014-2015 Canonical Ltd
2074 *
2075 * This program is free software: you can redistribute it and/or modify
2076 * it under the terms of the GNU General Public License version 3 as
2077@@ -19,8 +19,8 @@
2078 *
2079 */
2080 import QtQuick 2.4
2081+import SystemSettings.ListItems 1.0 as SettingsListItems
2082 import Ubuntu.Components 1.3
2083-import Ubuntu.Components.ListItems 1.3 as ListItem
2084
2085 Column {
2086
2087@@ -29,30 +29,23 @@
2088 property string carrierString: carrierName ? carrierName : i18n.tr("SIM")
2089
2090
2091- ListItem.Standard {
2092+ SettingsListItems.StandardProgression {
2093 objectName: "callWait"
2094 text: i18n.tr("Call waiting")
2095- progression: true
2096 onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), {sim: sim})
2097 }
2098
2099- ListItem.SingleValue {
2100+ SettingsListItems.SingleValueProgression {
2101 objectName: "callFwd"
2102 text: i18n.tr("Call forwarding")
2103- showDivider: false
2104- progression: true
2105 value: sim.getCallForwardingSummary()
2106 onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {sim: sim})
2107 }
2108
2109- ListItem.Divider {}
2110-
2111- ListItem.Standard {
2112+ SettingsListItems.StandardProgression {
2113 objectName: "simServices"
2114 // TRANSLATORS: %1 is the name of the (network) carrier
2115 text: i18n.tr("%1 Services").arg(carrierString)
2116- progression: true
2117- showDivider: false
2118 enabled: {
2119 var num;
2120 var map = sim.simMng.serviceNumbers;
2121
2122=== modified file 'plugins/reset/EntryComponent.qml'
2123--- plugins/reset/EntryComponent.qml 2015-08-10 13:31:45 +0000
2124+++ plugins/reset/EntryComponent.qml 2015-11-23 13:42:19 +0000
2125@@ -19,14 +19,12 @@
2126 */
2127
2128 import QtQuick 2.4
2129+import SystemSettings.ListItems 1.0 as SettingsListItems
2130 import Ubuntu.Components 1.3
2131-import Ubuntu.Components.ListItems 1.3 as ListItem
2132
2133-ListItem.Standard {
2134+SettingsListItems.IconProgression {
2135 id: root
2136 objectName: "entryComponent-reset"
2137 iconSource: model.icon
2138- iconFrame: false
2139 text: i18n.tr(model.displayName)
2140- progression: true
2141 }
2142
2143=== modified file 'plugins/reset/PageComponent.qml'
2144--- plugins/reset/PageComponent.qml 2015-08-10 13:31:45 +0000
2145+++ plugins/reset/PageComponent.qml 2015-11-23 13:42:19 +0000
2146@@ -21,8 +21,8 @@
2147 import GSettings 1.0
2148 import QtQuick 2.4
2149 import SystemSettings 1.0
2150+import SystemSettings.ListItems 1.0 as SettingsListItems
2151 import Ubuntu.Components 1.3
2152-import Ubuntu.Components.ListItems 1.3 as ListItem
2153 import Ubuntu.Components.Popups 1.3
2154 import Ubuntu.SystemSettings.Reset 1.0
2155
2156@@ -66,46 +66,81 @@
2157 anchors.left: parent.left
2158 anchors.right: parent.right
2159
2160- ListItem.SingleControl {
2161- control: Button {
2162+ Label {
2163+ anchors {
2164+ left: parent.left
2165+ right: parent.right
2166+ margins: units.gu(2)
2167+ }
2168+ text: i18n.tr("Reset Launcher")
2169+ color: UbuntuColors.orange
2170+ height: units.gu(6)
2171+ verticalAlignment: Text.AlignVCenter
2172+ }
2173+
2174+ SettingsListItems.Standard {
2175+
2176+ Button {
2177 id: resetLauncherHomeButton
2178 objectName: "resetLauncher"
2179 text: i18n.tr("Reset Launcher")
2180- width: parent.width - units.gu(4)
2181 onClicked: {
2182 buttonActions.source = "ResetLauncherHome.qml";
2183 root.popup = PopupUtils.open(buttonActions.item);
2184 }
2185 }
2186- showDivider: false
2187- }
2188-
2189- ListItem.SingleControl {
2190- visible: false // enabled when backend is ready/useful
2191- control: Button {
2192+ }
2193+
2194+ Label {
2195+ anchors {
2196+ left: parent.left
2197+ right: parent.right
2198+ margins: units.gu(2)
2199+ }
2200+ visible: showAllUI
2201+ text: i18n.tr("Reset all system settings…")
2202+ color: UbuntuColors.orange
2203+ height: units.gu(6)
2204+ verticalAlignment: Text.AlignVCenter
2205+ }
2206+
2207+ SettingsListItems.Standard {
2208+ visible: showAllUI
2209+
2210+ Button {
2211 id: resetAllSettingsButton
2212 text: i18n.tr("Reset all system settings…")
2213- width: parent.width - units.gu(4)
2214 onClicked: {
2215 buttonActions.source = "ResetAllSettings.qml";
2216 root.popup = PopupUtils.open(buttonActions.item);
2217 }
2218 }
2219- showDivider: false
2220- }
2221-
2222- ListItem.SingleControl {
2223- control: Button {
2224+ }
2225+
2226+ Label {
2227+ anchors {
2228+ left: parent.left
2229+ right: parent.right
2230+ margins: units.gu(2)
2231+ }
2232+ text: i18n.tr("Erase & Reset All")
2233+ color: UbuntuColors.orange
2234+ height: units.gu(6)
2235+ verticalAlignment: Text.AlignVCenter
2236+ }
2237+
2238+ SettingsListItems.Standard {
2239+
2240+ Button {
2241 id: eraseEverythingButton
2242 objectName: "factoryReset"
2243- text: i18n.tr("Erase & Reset Everything…")
2244- width: parent.width - units.gu(4)
2245+
2246+ text: i18n.tr("Erase & Reset All")
2247 onClicked: {
2248 buttonActions.source = "EraseEverything.qml";
2249 root.popup = PopupUtils.open(buttonActions.item);
2250 }
2251 }
2252- showDivider: false
2253 }
2254 }
2255 }
2256
2257=== modified file 'plugins/sound/PageComponent.qml'
2258--- plugins/sound/PageComponent.qml 2015-10-23 14:57:26 +0000
2259+++ plugins/sound/PageComponent.qml 2015-11-23 13:42:19 +0000
2260@@ -21,8 +21,8 @@
2261 import GSettings 1.0
2262 import QtQuick 2.4
2263 import Ubuntu.Components 1.3
2264-import Ubuntu.Components.ListItems 1.3 as ListItem
2265 import SystemSettings 1.0
2266+import SystemSettings.ListItems 1.0 as SettingsListItems
2267 import Ubuntu.SystemSettings.Sound 1.0
2268 import Ubuntu.Settings.Menus 0.1 as Menus
2269 import Ubuntu.Settings.Components 0.1 as USC
2270@@ -66,8 +66,10 @@
2271 anchors.left: parent.left
2272 anchors.right: parent.right
2273
2274- ListItem.Standard {
2275- control: Switch {
2276+ SettingsListItems.Standard {
2277+ text: i18n.tr("Silent Mode")
2278+
2279+ Switch {
2280 id: silentModeSwitch
2281 objectName: "silentMode"
2282 property bool serverChecked: soundActionGroup.silentMode.state
2283@@ -81,7 +83,6 @@
2284 onSyncTriggered: soundActionGroup.silentMode.activate()
2285 }
2286 }
2287- text: i18n.tr("Silent Mode")
2288 }
2289
2290 SettingsItemTitle {
2291@@ -123,7 +124,7 @@
2292 }
2293 }
2294
2295- ListItem.Standard {
2296+ SettingsListItems.Standard {
2297 id: highVolumeWarning
2298 visible: soundActionGroup.highVolume.state == true
2299 text: i18n.tr("High volume can damage your hearing.")
2300@@ -133,22 +134,22 @@
2301 text: i18n.tr("Phone calls:")
2302 }
2303
2304- ListItem.SingleValue {
2305+ SettingsListItems.SingleValueProgression {
2306 text: i18n.tr("Ringtone")
2307- value: Utilities.buildDisplayName(
2308- backendInfo.incomingCallSound)
2309- progression: true
2310+ value: Utilities.buildDisplayName(backendInfo.incomingCallSound)
2311+
2312 onClicked: pageStack.push(
2313- Qt.resolvedUrl("SoundsList.qml"),
2314- { title: i18n.tr("Ringtone"),
2315- showStopButton: true,
2316- soundType: 0,
2317- soundsDir:
2318- "/usr/share/sounds/ubuntu/ringtones/" })
2319+ Qt.resolvedUrl("SoundsList.qml"), {
2320+ title: i18n.tr("Ringtone"),
2321+ showStopButton: true,
2322+ soundType: 0,
2323+ soundsDir: "/usr/share/sounds/ubuntu/ringtones/"
2324+ }
2325+ )
2326 }
2327
2328- ListItem.Standard {
2329- control: CheckBox {
2330+ SettingsListItems.Standard {
2331+ CheckBox {
2332 objectName: "callVibrate"
2333 property bool serverChecked: backendInfo.incomingCallVibrate
2334 onServerCheckedChanged: checked = serverChecked
2335@@ -158,8 +159,8 @@
2336 text: i18n.tr("Vibrate on ring")
2337 }
2338
2339- ListItem.Standard {
2340- control: CheckBox {
2341+ SettingsListItems.Standard {
2342+ CheckBox {
2343 objectName: "callVibrateSilentMode"
2344 property bool serverChecked: backendInfo.incomingCallVibrateSilentMode
2345 onServerCheckedChanged: checked = serverChecked
2346@@ -169,8 +170,8 @@
2347 text: i18n.tr("Vibrate in Silent Mode")
2348 }
2349
2350- ListItem.Standard {
2351- control: Switch {
2352+ SettingsListItems.Standard {
2353+ Switch {
2354 objectName: "dialpadSounds"
2355 property bool serverChecked: backendInfo.dialpadSoundsEnabled
2356 onServerCheckedChanged: checked = serverChecked
2357@@ -184,11 +185,10 @@
2358 text: i18n.tr("Messages:")
2359 }
2360
2361- ListItem.SingleValue {
2362+ SettingsListItems.SingleValueProgression {
2363 text: i18n.tr("Message received")
2364 value:Utilities.buildDisplayName(
2365 backendInfo.incomingMessageSound)
2366- progression: true
2367 onClicked: pageStack.push(
2368 Qt.resolvedUrl("SoundsList.qml"),
2369 { title: i18n.tr("Message received"),
2370@@ -197,8 +197,8 @@
2371 "/usr/share/sounds/ubuntu/notifications/" })
2372 }
2373
2374- ListItem.Standard {
2375- control: CheckBox {
2376+ SettingsListItems.Standard {
2377+ CheckBox {
2378 objectName: "messageVibrate"
2379 property bool serverChecked: backendInfo.incomingMessageVibrate
2380 onServerCheckedChanged: checked = serverChecked
2381@@ -208,8 +208,8 @@
2382 text: i18n.tr("Vibrate with message sound")
2383 }
2384
2385- ListItem.Standard {
2386- control: CheckBox {
2387+ SettingsListItems.Standard {
2388+ CheckBox {
2389 objectName: "messageVibrateSilentMode"
2390 property bool serverChecked: backendInfo.incomingMessageVibrateSilentMode
2391 onServerCheckedChanged: checked = serverChecked
2392@@ -223,10 +223,10 @@
2393 text: i18n.tr("Other sounds:")
2394 }
2395
2396- ListItem.Standard {
2397+ SettingsListItems.Standard {
2398 text: i18n.tr("Keyboard sound")
2399
2400- control: Switch {
2401+ Switch {
2402 objectName: "keyboardSoundSwitch"
2403 property bool serverChecked: keyboardSettings.keyPressFeedback
2404 onServerCheckedChanged: checked = serverChecked
2405@@ -235,20 +235,22 @@
2406 }
2407 }
2408
2409- ListItem.Standard {
2410+ SettingsListItems.Standard {
2411 id: lockSound
2412- control: Switch {
2413+
2414+ Switch {
2415 checked: false
2416 }
2417 text: i18n.tr("Lock sound")
2418 visible: showAllUI
2419 }
2420
2421- ListItem.Divider {}
2422+ // FIXME: Add spacing here.
2423
2424- ListItem.Standard {
2425+ SettingsListItems.Standard {
2426 text: i18n.tr("Other vibrations")
2427- control: Switch {
2428+
2429+ Switch {
2430 objectName: "otherVibrateSwitch"
2431 property bool serverChecked: backendInfo.otherVibrate
2432 onServerCheckedChanged: checked = serverChecked
2433
2434=== modified file 'plugins/time-date/ChooseTimeZone.qml'
2435--- plugins/time-date/ChooseTimeZone.qml 2015-10-16 13:42:50 +0000
2436+++ plugins/time-date/ChooseTimeZone.qml 2015-11-23 13:42:19 +0000
2437@@ -20,6 +20,7 @@
2438
2439 import QtQuick 2.4
2440 import SystemSettings 1.0
2441+import SystemSettings.ListItems 1.0 as SettingsListItems
2442 import Ubuntu.Components 1.3
2443 import Ubuntu.Components.ListItems 1.3 as ListItem
2444 import Ubuntu.SystemSettings.TimeDate 1.0
2445@@ -52,7 +53,7 @@
2446 visible: showAllUI
2447 }
2448
2449- ListItem.Standard {
2450+ SettingsListItems.Standard {
2451 anchors.top: setTimeZoneSelector.bottom
2452 text: timeDatePanel.timeZone
2453 enabled: false
2454@@ -96,7 +97,7 @@
2455
2456 model: timeDatePanel.timeZoneModel
2457 visible: setTimeZoneSelector.selectedIndex == 1 && count > 0
2458- delegate: ListItem.Standard {
2459+ delegate: SettingsListItems.Standard {
2460 text: displayName
2461 // If a timezone is manually selected, record which one so that
2462 // we highlight that one only. Usually all cities in that timezone
2463
2464=== modified file 'plugins/time-date/PageComponent.qml'
2465--- plugins/time-date/PageComponent.qml 2015-10-16 13:42:50 +0000
2466+++ plugins/time-date/PageComponent.qml 2015-11-23 13:42:19 +0000
2467@@ -1,7 +1,7 @@
2468 /*
2469 * This file is part of system-settings
2470 *
2471- * Copyright (C) 2013 Canonical Ltd.
2472+ * Copyright (C) 2013-2015 Canonical Ltd.
2473 *
2474 * Contact: Iain Lane <iain.lane@canonical.com>
2475 *
2476@@ -20,8 +20,9 @@
2477
2478 import QtQuick 2.4
2479 import SystemSettings 1.0
2480+import SystemSettings.ListItems 1.0 as SettingsListItems
2481 import Ubuntu.Components 1.3
2482-import Ubuntu.Components.ListItems 1.3 as ListItem
2483+import Ubuntu.Components.ListItems 1.3 as ListItems
2484 import Ubuntu.Components.Popups 1.3
2485 import Ubuntu.SystemSettings.TimeDate 1.0
2486
2487@@ -62,13 +63,12 @@
2488
2489 SettingsItemTitle { text: i18n.tr ("Time zone:") }
2490
2491- ListItem.SingleValue {
2492+ SettingsListItems.SingleValueProgression {
2493 objectName: "timeZone"
2494 id: timeZone
2495 //e.g. America/New_York -> America/New York
2496 text: timeDatePanel.timeZone.replace("_", " ")
2497 value: getUTCOffset()
2498- progression: true
2499 onClicked: pageStack.push(Qt.resolvedUrl("ChooseTimeZone.qml"), {
2500 timeDatePanel: timeDatePanel
2501 })
2502@@ -78,7 +78,7 @@
2503 text: i18n.tr ("Set the time and date:")
2504 }
2505
2506- ListItem.ItemSelector {
2507+ ListItems.ItemSelector {
2508 id: setTimeAutomatically
2509 objectName: "timeItemSelector"
2510 model: [ i18n.tr("Automatically") , i18n.tr("Manually")]
2511@@ -109,11 +109,11 @@
2512 TimePicker {}
2513 }
2514
2515- ListItem.Standard {
2516+ SettingsListItems.StandardProgression {
2517 id: currentTime
2518 objectName: "currentTime"
2519- progression: setTimeAutomatically.selectedIndex === 1 // Manually
2520- enabled: progression
2521+ progressionVisible: setTimeAutomatically.selectedIndex === 1 // Manually
2522+ enabled: progressionVisible
2523 onClicked: {
2524 Qt.inputMethod.hide()
2525 var popupObj = PopupUtils.open(timePicker);
2526
2527=== modified file 'plugins/time-date/Scroller.qml'
2528--- plugins/time-date/Scroller.qml 2015-08-10 13:31:45 +0000
2529+++ plugins/time-date/Scroller.qml 2015-11-23 13:42:19 +0000
2530@@ -1,7 +1,8 @@
2531 /*
2532 * Copyright (C) 2013 Michael Zanetti <michael_zanetti@gmx.net>
2533- * (C) 2013 Canonical Ltd
2534- * Canonical modifications by Iain Lane <iain.lane@canonical.com>
2535+ * (C) 2013-2015 Canonical Ltd
2536+ * Canonical modifications by Iain Lane <iain.lane@canonical.com>,
2537+ * Jonas G. Drange <jonas.drange@canonical.com>
2538 *
2539 * This program is free software; you can redistribute it and/or modify
2540 * it under the terms of the GNU General Public License as published by
2541@@ -17,6 +18,7 @@
2542 */
2543
2544 import QtQuick 2.4
2545+import SystemSettings.ListItems 1.0 as SettingsListItems
2546 import Ubuntu.Components 1.3
2547 import Ubuntu.Components.ListItems 1.3 as ListItems
2548
2549@@ -106,13 +108,10 @@
2550 preferredHighlightEnd: 0.5
2551 clip: true
2552
2553- delegate: ListItems.Standard {
2554+ delegate: SettingsListItems.Standard {
2555 width: parent.width
2556 highlightWhenPressed: false
2557- Label {
2558- anchors.centerIn: parent
2559- text: modelData
2560- }
2561+ text: modelData
2562 showDivider: false
2563 onClicked: listView.currentIndex = index
2564 }
2565
2566=== modified file 'plugins/time-date/TimePicker.qml'
2567--- plugins/time-date/TimePicker.qml 2015-08-10 13:31:45 +0000
2568+++ plugins/time-date/TimePicker.qml 2015-11-23 13:42:19 +0000
2569@@ -18,7 +18,6 @@
2570
2571 import QtQuick 2.4
2572 import Ubuntu.Components 1.3
2573-import Ubuntu.Components.ListItems 1.3 as ListItem
2574 import Ubuntu.Components.Popups 1.3
2575
2576 Dialog {
2577
2578=== modified file 'plugins/wifi/AccessPoint.qml'
2579--- plugins/wifi/AccessPoint.qml 2015-08-10 13:31:45 +0000
2580+++ plugins/wifi/AccessPoint.qml 2015-11-23 13:42:19 +0000
2581@@ -1,5 +1,5 @@
2582 /*
2583- * Copyright 2013 Canonical Ltd.
2584+ * Copyright 2013-2015 Canonical Ltd.
2585 *
2586 * This program is free software; you can redistribute it and/or modify
2587 * it under the terms of the GNU General Public License as published by
2588@@ -28,19 +28,6 @@
2589 property bool secure: false
2590 property bool adHoc: false
2591 property int signalStrength: 0
2592-
2593- signal activate()
2594-
2595- onCheckedChanged: {
2596- // Can't rely on binding. Checked is assigned on click.
2597- checkBoxActive.checked = checked;
2598-
2599- // if stack has NetworkDetailsBrief, pop it
2600- if (pageStack.depth === 3) {
2601- pageStack.pop();
2602- }
2603- }
2604-
2605 iconName: {
2606 var imageName = "nm-signal-100"
2607
2608@@ -61,16 +48,18 @@
2609 }
2610 return imageName;
2611 }
2612-
2613- iconFrame: false
2614- control: CheckBox {
2615- id: checkBoxActive
2616-
2617- onClicked: {
2618- accessPoint.activate();
2619+ layout.subtitle.text: checked ? i18n.tr("Connected") : ""
2620+
2621+ signal activate()
2622+
2623+ onCheckedChanged: {
2624+ // if stack has NetworkDetailsBrief, pop it
2625+ if (pageStack.depth === 3) {
2626+ pageStack.pop();
2627 }
2628 }
2629- progression: checked
2630+
2631+ progressionVisible: checked
2632 onClicked: {
2633 if (checked) {
2634 pageStack.push(Qt.resolvedUrl("NetworkDetailsBrief.qml"),
2635
2636=== modified file 'plugins/wifi/DivMenuItem.qml'
2637--- plugins/wifi/DivMenuItem.qml 2015-08-10 13:31:45 +0000
2638+++ plugins/wifi/DivMenuItem.qml 2015-11-23 13:42:19 +0000
2639@@ -1,5 +1,5 @@
2640 /*
2641- * Copyright 2013 Canonical Ltd.
2642+ * Copyright 2013-2015 Canonical Ltd.
2643 *
2644 * This program is free software; you can redistribute it and/or modify
2645 * it under the terms of the GNU General Public License as published by
2646@@ -18,8 +18,8 @@
2647 */
2648
2649 import QtQuick 2.4
2650-import Ubuntu.Components.ListItems 1.3 as ListItem
2651+import Ubuntu.Components 1.3
2652
2653-ListItem.Empty {
2654+ListItemLayout {
2655 height: units.gu(3)
2656 }
2657
2658=== modified file 'plugins/wifi/FramedMenuItem.qml'
2659--- plugins/wifi/FramedMenuItem.qml 2015-08-10 13:31:45 +0000
2660+++ plugins/wifi/FramedMenuItem.qml 2015-11-23 13:42:19 +0000
2661@@ -1,5 +1,5 @@
2662 /*
2663- * Copyright 2013 Canonical Ltd.
2664+ * Copyright 2013-2015 Canonical Ltd.
2665 *
2666 * This program is free software; you can redistribute it and/or modify
2667 * it under the terms of the GNU General Public License as published by
2668@@ -19,7 +19,11 @@
2669 */
2670
2671 import QtQuick 2.4
2672+import SystemSettings.ListItems 1.0 as SettingsListItems
2673 import Ubuntu.Components 1.3
2674-import Ubuntu.Components.ListItems 1.3 as ListItem
2675
2676-ListItem.Standard {}
2677+SettingsListItems.IconProgression {
2678+ // FIXME: use padding + padding + icon width
2679+ divider.anchors.leftMargin: units.gu(6)
2680+ layout.subtitle.color: UbuntuColors.green
2681+}
2682
2683=== modified file 'plugins/wifi/MenuItemFactory.qml'
2684--- plugins/wifi/MenuItemFactory.qml 2015-08-10 13:31:45 +0000
2685+++ plugins/wifi/MenuItemFactory.qml 2015-11-23 13:42:19 +0000
2686@@ -1,5 +1,5 @@
2687 /*
2688- * Copyright 2013 Canonical Ltd.
2689+ * Copyright 2013-2015 Canonical Ltd.
2690 *
2691 * This program is free software; you can redistribute it and/or modify
2692 * it under the terms of the GNU General Public License as published by
2693@@ -15,7 +15,7 @@
2694 *
2695 * Authors:
2696 * Nick Dedekind <nick.dedekind@canonical.com>
2697- */
2698+ */
2699
2700 import QtQuick 2.4
2701 import QMenuModel 0.1 as QMenuModel
2702@@ -65,7 +65,7 @@
2703 property int menuIndex: -1
2704
2705 text: menu && menu.label ? menu.label : ""
2706- icon: menu ? menu.icon : ""
2707+ iconName: menu ? menu.icon : ""
2708 checkable: menu ? (menu.isCheck || menu.isRadio) : false
2709 checked: checkable ? menu.isToggled : false
2710 enabled: menu ? menu.sensitive : false
2711@@ -106,7 +106,7 @@
2712 property int menuIndex: -1
2713 property var extendedData: menu && menu.ext || undefined
2714 text: menu && menu.label ? menu.label : ""
2715- busy: getExtendedProperty(extendedData, "xCanonicalBusyAction", false)
2716+ busy: getExtendedProperty(extendedData, "xCanonicalBusyAction", false) || true
2717
2718 onMenuModelChanged: {
2719 loadAttributes();
2720@@ -150,7 +150,7 @@
2721 loadAttributes();
2722 }
2723
2724- USC.ServerPropertySynchroniser {
2725+ resources: USC.ServerPropertySynchroniser {
2726 userTarget: apItem
2727 userProperty: "active"
2728 userTrigger: "onActivate"
2729
2730=== modified file 'plugins/wifi/NetworkDetails.qml'
2731--- plugins/wifi/NetworkDetails.qml 2015-08-10 13:31:45 +0000
2732+++ plugins/wifi/NetworkDetails.qml 2015-11-23 13:42:19 +0000
2733@@ -21,8 +21,8 @@
2734 import QtQuick 2.4
2735 import QtQuick.Layouts 1.1
2736 import SystemSettings 1.0
2737+import SystemSettings.ListItems 1.0 as SettingsListItems
2738 import Ubuntu.Components 1.3
2739-import Ubuntu.Components.ListItems 1.3 as ListItem
2740 import Ubuntu.SystemSettings.Wifi 1.0
2741
2742 ItemPage {
2743@@ -53,29 +53,24 @@
2744 anchors.left: parent.left
2745 anchors.right: parent.right
2746
2747- ListItem.Standard {
2748+ SettingsListItems.SingleValue {
2749 text: i18n.tr("Name")
2750- control: Label {
2751- text: networkName
2752- }
2753+ value: networkName
2754 }
2755
2756- ListItem.Standard {
2757+ SettingsListItems.SingleValue {
2758 id: lastLabel
2759 text: i18n.tr("Last connected")
2760- control: Label {
2761- id: lastField
2762-
2763- text: networkDetails.lastUsed.length !== 0 ?
2764- networkDetails.lastUsed : i18n.tr("Never")
2765- }
2766+ value: networkDetails.lastUsed.length !== 0 ?
2767+ networkDetails.lastUsed : i18n.tr("Never")
2768 }
2769
2770- ListItem.Standard {
2771+ SettingsListItems.Standard {
2772 id: passwordLabel
2773 text: i18n.tr("Password")
2774 visible: networkDetails.password.length !== 0
2775- control: TextInput {
2776+
2777+ TextInput {
2778 id: passwordField
2779 readOnly: true
2780 text: networkDetails.password
2781@@ -84,28 +79,30 @@
2782 }
2783 }
2784
2785- ListItem.Standard {
2786+ SettingsListItems.Standard {
2787 id: passwordVisible
2788 text: i18n.tr("Show password")
2789 visible: networkDetails.password.length !== 0
2790- control: Switch {
2791+
2792+ Switch {
2793 id: passwordVisibleSwitch
2794 }
2795 }
2796
2797- ListItem.Divider {}
2798+ SettingsListItems.SingleControl {
2799
2800- Button {
2801- objectName: "forgetNetwork"
2802- text : i18n.tr("Forget this network")
2803- anchors {
2804- left: parent.left
2805- right: parent.right
2806- margins: units.gu(2)
2807- }
2808- onClicked : {
2809- DbusHelper.forgetConnection(dbusPath);
2810- pageStack.pop();
2811+ Button {
2812+ objectName: "forgetNetwork"
2813+ text : i18n.tr("Forget this network")
2814+ anchors {
2815+ left: parent.left
2816+ right: parent.right
2817+ margins: units.gu(2)
2818+ }
2819+ onClicked : {
2820+ DbusHelper.forgetConnection(dbusPath);
2821+ pageStack.pop();
2822+ }
2823 }
2824 }
2825 }
2826
2827=== modified file 'plugins/wifi/NetworkDetailsBrief.qml'
2828--- plugins/wifi/NetworkDetailsBrief.qml 2015-08-10 13:31:45 +0000
2829+++ plugins/wifi/NetworkDetailsBrief.qml 2015-11-23 13:42:19 +0000
2830@@ -21,8 +21,8 @@
2831 import QtQuick 2.4
2832 import QtQuick.Layouts 1.1
2833 import SystemSettings 1.0
2834+import SystemSettings.ListItems 1.0 as SettingsListItems
2835 import Ubuntu.Components 1.3
2836-import Ubuntu.Components.ListItems 1.3 as ListItem
2837 import Ubuntu.SystemSettings.Wifi 1.0
2838
2839 ItemPage {
2840@@ -48,27 +48,28 @@
2841 anchors.left: parent.left
2842 anchors.right: parent.right
2843
2844- ListItem.Divider {}
2845-
2846- Button {
2847- text : i18n.tr("Forget this network")
2848- anchors {
2849- left: parent.left
2850- right: parent.right
2851- margins: units.gu(2)
2852- }
2853- onClicked: {
2854- if (DbusHelper.forgetActiveDevice()) {
2855- accessPoint.checked = false;
2856- accessPoint.checkedChanged(false)
2857+ SettingsListItems.SingleControl {
2858+ Button {
2859+ text : i18n.tr("Forget this network")
2860+ anchors {
2861+ left: parent.left
2862+ right: parent.right
2863+ margins: units.gu(2)
2864+ }
2865+ onClicked: {
2866+ if (DbusHelper.forgetActiveDevice()) {
2867+ accessPoint.checked = false;
2868+ accessPoint.checkedChanged(false)
2869+ }
2870 }
2871 }
2872 }
2873
2874- ListItem.Standard {
2875+ SettingsListItems.Standard {
2876 text: i18n.tr("IP address")
2877 id: addressItem
2878- control: TextField {
2879+
2880+ TextField {
2881 text: DbusHelper.wifiIp4Address
2882 readOnly: true
2883 horizontalAlignment: TextInput.AlignRight
2884
2885=== modified file 'plugins/wifi/PageComponent.qml'
2886--- plugins/wifi/PageComponent.qml 2015-08-10 13:31:45 +0000
2887+++ plugins/wifi/PageComponent.qml 2015-11-23 13:42:19 +0000
2888@@ -16,8 +16,8 @@
2889
2890 import QtQuick 2.4
2891 import SystemSettings 1.0
2892+import SystemSettings.ListItems 1.0 as SettingsListItems
2893 import Ubuntu.Components 1.3
2894-import Ubuntu.Components.ListItems 1.3 as ListItem
2895 import Ubuntu.Components.Popups 1.3
2896 import Ubuntu.SystemSettings.Wifi 1.0
2897 import QMenuModel 0.1
2898@@ -81,7 +81,6 @@
2899 right: parent.right
2900 }
2901 height: loader.height
2902- visible: height > 0
2903
2904 Loader {
2905 id: loader
2906@@ -124,16 +123,7 @@
2907 }
2908 }
2909
2910- ListItem.Divider {}
2911-
2912- ListItem.SingleValue {
2913- objectName: "previousNetwork"
2914- text: i18n.tr("Previous networks")
2915- progression: true
2916- onClicked: pageStack.push(Qt.resolvedUrl("PreviousNetworks.qml"))
2917- }
2918-
2919- ListItem.SingleValue {
2920+ SettingsListItems.Standard {
2921 objectName: "connectToHiddenNetwork"
2922 text: i18n.tr("Connect to hidden network…")
2923 visible : wifibase.wifiEnabled
2924@@ -143,6 +133,12 @@
2925 }
2926 }
2927
2928+ SettingsListItems.StandardProgression {
2929+ objectName: "previousNetwork"
2930+ text: i18n.tr("Previous networks")
2931+ onClicked: pageStack.push(Qt.resolvedUrl("PreviousNetworks.qml"))
2932+ }
2933+
2934 Loader {
2935 id: otherNetworLoader
2936 asynchronous: false
2937
2938=== modified file 'plugins/wifi/PreviousNetworks.qml'
2939--- plugins/wifi/PreviousNetworks.qml 2015-08-10 13:31:45 +0000
2940+++ plugins/wifi/PreviousNetworks.qml 2015-11-23 13:42:19 +0000
2941@@ -16,8 +16,8 @@
2942
2943 import QtQuick 2.4
2944 import SystemSettings 1.0
2945+import SystemSettings.ListItems 1.0 as SettingsListItems
2946 import Ubuntu.Components 1.3
2947-import Ubuntu.Components.ListItems 1.3 as ListItem
2948 import Ubuntu.SystemSettings.Wifi 1.0
2949 import QMenuModel 0.1
2950
2951@@ -54,9 +54,8 @@
2952 duration: UbuntuAnimation.SnapDuration
2953 }
2954 }
2955- delegate: ListItem.Standard {
2956+ delegate: SettingsListItems.StandardProgression {
2957 text: name
2958- progression: true
2959 onClicked: {
2960 pageStack.push(Qt.resolvedUrl("NetworkDetails.qml"),
2961 {networkName : name, password : password, lastUsed : lastUsed,
2962
2963=== modified file 'plugins/wifi/SectionMenuItem.qml'
2964--- plugins/wifi/SectionMenuItem.qml 2015-08-10 13:31:45 +0000
2965+++ plugins/wifi/SectionMenuItem.qml 2015-11-23 13:42:19 +0000
2966@@ -18,37 +18,22 @@
2967 */
2968
2969 import QtQuick 2.4
2970+import SystemSettings 1.0
2971 import Ubuntu.Components 1.3
2972-import Ubuntu.Components.ListItems 1.3 as ListItem
2973-
2974-BaseMenuItem {
2975- id: menuItem
2976- property alias text: header.text
2977- property bool busy: false
2978-
2979- implicitHeight: text !== "" ? header.height : 0
2980-
2981- ListItem.Header {
2982- id: header
2983-
2984- height: units.gu(4)
2985+
2986+SettingsItemTitle {
2987+ property alias busy: indicator.running
2988+
2989+ ActivityIndicator {
2990+ id: indicator
2991 anchors {
2992- left: parent.left
2993+ top: parent.top
2994+ topMargin: units.gu(3)
2995 right: parent.right
2996- top: parent.top
2997- }
2998- visible: text != ""
2999-
3000- ActivityIndicator {
3001- id: indicator
3002- running: busy
3003- anchors {
3004- margins: units.gu(0.5)
3005- right: parent.right
3006- }
3007- height: parent.height - (anchors.margins * 2)
3008- width: height
3009- anchors.verticalCenter: parent.verticalCenter
3010- }
3011+ rightMargin: units.gu(2)
3012+ }
3013+ height: parent.height - (anchors.topMargin * 1.25)
3014+ width: height
3015+ visible: running
3016 }
3017 }
3018
3019=== modified file 'plugins/wifi/StandardMenuItem.qml'
3020--- plugins/wifi/StandardMenuItem.qml 2015-08-10 13:31:45 +0000
3021+++ plugins/wifi/StandardMenuItem.qml 2015-11-23 13:42:19 +0000
3022@@ -28,34 +28,12 @@
3023
3024 signal activate()
3025
3026- onCheckedChanged: {
3027- // Can't rely on binding. Checked is assigned on click.
3028- if (checkable) {
3029- checkbox.checked = checked;
3030- }
3031- }
3032+ layout.subtitle.text: checked ? i18n.tr("Connected") : ""
3033
3034+ progressionVisible: checked
3035 onClicked: {
3036- if (checkable) {
3037- checkbox.clicked();
3038- } else {
3039- menuItem.activate();
3040- }
3041- }
3042-
3043- control: CheckBox {
3044- id: checkbox
3045-
3046- Component.onCompleted: {
3047- checked = menuItem.checked;
3048- }
3049-
3050- // FIXME : should use Checkbox.toggled signal
3051- // lp:~nick-dedekind/ubuntu-ui-toolkit/checkbox.toggled
3052- onClicked: {
3053- menuItem.activate();
3054- }
3055-
3056- visible: checkable
3057+ if (!checked) {
3058+ menuItem.activate();
3059+ }
3060 }
3061 }
3062
3063=== modified file 'plugins/wifi/SwitchMenuItem.qml'
3064--- plugins/wifi/SwitchMenuItem.qml 2015-08-10 13:31:45 +0000
3065+++ plugins/wifi/SwitchMenuItem.qml 2015-11-23 13:42:19 +0000
3066@@ -33,7 +33,7 @@
3067 switcher.checked = checked;
3068 }
3069
3070- control: Switch {
3071+ Switch {
3072 id: switcher
3073
3074 Component.onCompleted: {
3075
3076=== modified file 'src/CMakeLists.txt'
3077--- src/CMakeLists.txt 2014-10-31 14:53:32 +0000
3078+++ src/CMakeLists.txt 2015-11-23 13:42:19 +0000
3079@@ -20,7 +20,7 @@
3080 )
3081
3082 set(QML_SOURCES
3083- qml/CategoryGrid.qml
3084+ qml/CategorySection.qml
3085 qml/EntryComponent.qml
3086 qml/MainWindow.qml
3087 qml/UncategorizedItemsView.qml
3088
3089=== modified file 'src/SystemSettings/qmldir'
3090--- src/SystemSettings/qmldir 2014-10-31 08:45:10 +0000
3091+++ src/SystemSettings/qmldir 2015-11-23 13:42:19 +0000
3092@@ -1,3 +1,4 @@
3093 module SystemSettings
3094+
3095 ItemPage 1.0 ItemPage.qml
3096 SettingsItemTitle 1.0 SettingsItemTitle.qml
3097
3098=== renamed file 'src/qml/CategoryGrid.qml' => 'src/qml/CategorySection.qml'
3099--- src/qml/CategoryGrid.qml 2015-08-10 13:31:45 +0000
3100+++ src/qml/CategorySection.qml 2015-11-23 13:42:19 +0000
3101@@ -1,6 +1,8 @@
3102 import QtQuick 2.4
3103+import SystemSettings 1.0
3104+import SystemSettings.ListItems 1.0 as SettingsListItems
3105 import Ubuntu.Components 1.3
3106-import Ubuntu.Components.ListItems 1.3 as ListItem
3107+
3108
3109 Column {
3110 anchors {
3111@@ -14,32 +16,17 @@
3112
3113 objectName: "categoryGrid-" + category
3114
3115- ListItem.Standard {
3116+ SettingsItemTitle {
3117 id: header
3118-
3119- highlightWhenPressed: false
3120- showDivider: false
3121 text: categoryName
3122 visible: repeater.count > 0
3123 }
3124
3125- Grid {
3126- property int itemWidth: units.gu(12)
3127-
3128- // The amount of whitespace, including column spacing
3129- property int space: parent.width - columns * itemWidth
3130-
3131- // The column spacing is 1/n of the left/right margins
3132- property int n: 4
3133-
3134- columnSpacing: space / ((2 * n) + (columns - 1))
3135- rowSpacing: units.gu(3)
3136- width: (columns * itemWidth) + columnSpacing * (columns - 1)
3137- anchors.horizontalCenter: parent.horizontalCenter
3138- columns: {
3139- var items = Math.floor(parent.width / itemWidth)
3140- var count = repeater.count
3141- return count < items ? count : items
3142+ Column {
3143+ id: col
3144+ anchors {
3145+ left: parent.left
3146+ right: parent.right
3147 }
3148
3149 Repeater {
3150@@ -49,7 +36,10 @@
3151
3152 delegate: Loader {
3153 id: loader
3154- width: parent.itemWidth
3155+ anchors {
3156+ left: col.left
3157+ right: col.right
3158+ }
3159 sourceComponent: model.item.entryComponent
3160 active: model.item.visible
3161 Connections {
3162@@ -66,5 +56,4 @@
3163 }
3164 }
3165 }
3166- ListItem.ThinDivider { visible: header.visible }
3167 }
3168
3169=== modified file 'src/qml/EntryComponent.qml'
3170--- src/qml/EntryComponent.qml 2015-08-10 13:31:45 +0000
3171+++ src/qml/EntryComponent.qml 2015-11-23 13:42:19 +0000
3172@@ -1,7 +1,7 @@
3173 /*
3174 * This file is part of system-settings
3175 *
3176- * Copyright (C) 2013 Canonical Ltd.
3177+ * Copyright (C) 2013-2015 Canonical Ltd.
3178 *
3179 * Contact: Alberto Mardegan <alberto.mardegan@canonical.com>
3180 *
3181@@ -19,58 +19,14 @@
3182 */
3183
3184 import QtQuick 2.4
3185+import SystemSettings.ListItems 1.0 as SettingsListItems
3186 import Ubuntu.Components 1.3
3187-import Ubuntu.Settings.Components 0.1
3188
3189-Item {
3190+SettingsListItems.IconProgression {
3191 id: root
3192
3193- signal clicked
3194-
3195- height: button.height
3196-
3197 objectName: "entryComponent-" + model.item.baseName
3198
3199- AbstractButton {
3200- id: button
3201- anchors.left: parent.left
3202- anchors.right: parent.right
3203- onClicked: root.clicked()
3204-
3205- height: col.height
3206-
3207- Column {
3208- id: col
3209- anchors.left: parent.left
3210- anchors.right: parent.right
3211-
3212- Icon {
3213- id: icon
3214- anchors.horizontalCenter: parent.horizontalCenter
3215- width: height
3216- height: units.gu(4)
3217- source: model.icon
3218- }
3219-
3220- Label {
3221- anchors.horizontalCenter: parent.horizontalCenter
3222- text: i18n.dtr(model.item.translations, model.displayName)
3223- width: col.width
3224- horizontalAlignment: Text.AlignHCenter
3225- fontSize: "small"
3226- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
3227- }
3228- }
3229- }
3230-
3231- UbuntuShape {
3232- z: -1
3233- visible: button.pressed
3234- anchors{
3235- fill: root
3236- margins: -units.gu(0.25)
3237- }
3238- backgroundColor: UbuntuColors.darkGrey
3239- opacity: 0.15
3240- }
3241+ text: i18n.dtr(model.item.translations, model.displayName)
3242+ iconSource: model.icon
3243 }
3244
3245=== modified file 'src/qml/MainWindow.qml'
3246--- src/qml/MainWindow.qml 2015-08-10 13:31:45 +0000
3247+++ src/qml/MainWindow.qml 2015-11-23 13:42:19 +0000
3248@@ -19,8 +19,8 @@
3249 */
3250
3251 import QtQuick 2.4
3252+import SystemSettings.ListItems 1.0 as SettingsListItems
3253 import Ubuntu.Components 1.3
3254-import Ubuntu.Components.ListItems 1.3 as ListItem
3255 import SystemSettings 1.0
3256
3257 MainView {
3258@@ -112,6 +112,16 @@
3259 visible: false
3260 flickable: mainFlickable
3261
3262+ head.actions: [
3263+ Action {
3264+ iconName: "search"
3265+ onTriggered: {
3266+ pluginManager.filter = "";
3267+ search.visible = !search.visible;
3268+ }
3269+ }
3270+ ]
3271+
3272 Flickable {
3273 id: mainFlickable
3274 anchors.fill: parent
3275@@ -125,9 +135,11 @@
3276 anchors.left: parent.left
3277 anchors.right: parent.right
3278
3279- ListItem.SingleControl {
3280+ SettingsListItems.SingleControl {
3281 id: search
3282- control: TextField {
3283+ visible: false
3284+ TextField {
3285+ id: searchField
3286 width: parent.width - units.gu(4)
3287 placeholderText: i18n.tr("Search")
3288 objectName: "searchTextField"
3289@@ -135,23 +147,24 @@
3290 onDisplayTextChanged:
3291 pluginManager.filter = displayText
3292 }
3293+ onVisibleChanged: if (visible) searchField.forceActiveFocus()
3294 }
3295
3296 UncategorizedItemsView {
3297 model: pluginManager.itemModel("uncategorized-top")
3298 }
3299
3300- CategoryGrid {
3301+ CategorySection {
3302 category: "network"
3303 categoryName: i18n.tr("Network")
3304 }
3305
3306- CategoryGrid {
3307+ CategorySection {
3308 category: "personal"
3309 categoryName: i18n.tr("Personal")
3310 }
3311
3312- CategoryGrid {
3313+ CategorySection {
3314 category: "system"
3315 categoryName: i18n.tr("System")
3316 }
3317
3318=== modified file 'src/ui.qrc'
3319--- src/ui.qrc 2014-01-31 15:07:01 +0000
3320+++ src/ui.qrc 2015-11-23 13:42:19 +0000
3321@@ -1,6 +1,6 @@
3322 <!DOCTYPE RCC><RCC version="1.0">
3323 <qresource>
3324- <file>qml/CategoryGrid.qml</file>
3325+ <file>qml/CategorySection.qml</file>
3326 <file>qml/EntryComponent.qml</file>
3327 <file>qml/MainWindow.qml</file>
3328 <file>qml/UncategorizedItemsView.qml</file>
3329
3330=== modified file 'tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py'
3331--- tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py 2015-08-17 15:39:14 +0000
3332+++ tests/autopilot/ubuntu_system_settings/tests/indicatornetwork.py 2015-11-23 13:42:19 +0000
3333@@ -17,6 +17,8 @@
3334 BUS_NAME = 'com.canonical.indicator.network'
3335 MAIN_IFACE = 'org.gtk.Actions'
3336 MAIN_OBJ = '/com/canonical/indicator/network'
3337+MENU_IFACE = 'org.gtk.Menus'
3338+PHONE_WIFI_OBJ = '/com/canonical/indicator/network/phone_wifi_settings'
3339 SYSTEM_BUS = False
3340
3341 NOT_IMPLEMENTED = '''raise dbus.exceptions.DBusException(
3342@@ -41,8 +43,12 @@
3343 return list(self.actions)
3344
3345
3346-def set_state(self, action_name, parameters, platform_data):
3347- eval(NOT_IMPLEMENTED)
3348+def start(self, groups):
3349+ return dbusmock.get_object(MAIN_OBJ).menus
3350+
3351+
3352+def end(self, groups):
3353+ pass
3354
3355
3356 @dbus.service.method(dbusmock.MOCK_IFACE,
3357@@ -62,12 +68,87 @@
3358 mock.describe = describe
3359 mock.describe_all = describe_all
3360 mock.list_actions = list_actions
3361- mock.set_state = set_state
3362
3363 mock.actions = parameters.get('actions', {
3364 'wifi.enable': (True, '', [True]),
3365+ 'accesspoint.0': (True, '', [True]),
3366+ 'accesspoint.0::strength': (True, '', [44]),
3367+ 'accesspoint.1': (True, '', [False]),
3368+ 'accesspoint.1::strength': (True, '', [100]),
3369+ 'accesspoint.2': (True, '', [False]),
3370+ 'accesspoint.2::strength': (True, '', [74]),
3371+ 'accesspoint.3': (False, '', [False]),
3372 })
3373
3374+ mock.menus = parameters.get('menus', dbus.Array([
3375+ (
3376+ dbus.UInt32(0), dbus.UInt32(0),
3377+ [
3378+ {
3379+ 'action': 'indicator.wifi.enable',
3380+ 'x-canonical-type': 'com.canonical.indicator.switch',
3381+ 'label': 'Wi-Fi'
3382+ },
3383+ {
3384+ 'x-canonical-type': 'com.canonical.indicator.section',
3385+ 'label': 'Available Wi-Fi networks'
3386+ },
3387+ {
3388+ ':section': dbus.Struct(
3389+ (dbus.UInt32(0), dbus.UInt32(1)), signature='(uu)'
3390+ )
3391+ }
3392+ ]
3393+ ),
3394+ (
3395+ dbus.UInt32(0), dbus.UInt32(1),
3396+ [
3397+ {
3398+ 'x-canonical-wifi-ap-is-secure': True,
3399+ 'x-canonical-wifi-ap-is-enterprise': False,
3400+ 'label': 'Secure',
3401+ 'x-canonical-type':
3402+ 'unity.widgets.systemsettings.tablet.accesspoint',
3403+ 'x-canonical-wifi-ap-strength-action':
3404+ 'indicator.accesspoint.0::strength',
3405+ 'action': 'indicator.accesspoint.0',
3406+ 'x-canonical-wifi-ap-is-adhoc': False
3407+ },
3408+ {
3409+ 'x-canonical-wifi-ap-is-secure': False,
3410+ 'x-canonical-wifi-ap-is-enterprise': False,
3411+ 'label': 'Insecure',
3412+ 'x-canonical-type':
3413+ 'unity.widgets.systemsettings.tablet.accesspoint',
3414+ 'x-canonical-wifi-ap-strength-action':
3415+ 'indicator.accesspoint.1::strength',
3416+ 'action': 'indicator.accesspoint.1',
3417+ 'x-canonical-wifi-ap-is-adhoc': False
3418+ },
3419+ {
3420+ 'x-canonical-wifi-ap-is-secure': True,
3421+ 'x-canonical-wifi-ap-is-enterprise': True,
3422+ 'label': 'Enterprise',
3423+ 'x-canonical-type':
3424+ 'unity.widgets.systemsettings.tablet.accesspoint',
3425+ 'x-canonical-wifi-ap-strength-action':
3426+ 'indicator.accesspoint.2::strength',
3427+ 'action': 'indicator.accesspoint.2',
3428+ 'x-canonical-wifi-ap-is-adhoc': False
3429+ },
3430+ {
3431+ 'x-canonical-wifi-ap-is-secure': False,
3432+ 'x-canonical-wifi-ap-is-enterprise': False,
3433+ 'label': 'Unknown',
3434+ 'x-canonical-type':
3435+ 'unknown-type',
3436+ 'action': 'indicator.accesspoint.3',
3437+ 'x-canonical-wifi-ap-is-adhoc': False
3438+ }
3439+ ]
3440+ )
3441+ ], signature='a(uuaa{sv})'))
3442+
3443 mock.AddMethods(
3444 MAIN_IFACE,
3445 [
3446@@ -85,9 +166,23 @@
3447 (
3448 'List', '', 'as',
3449 'ret = self.list_actions(self)'
3450- ),
3451- (
3452- 'SetState', 'sva{sv}', '',
3453- 'self.set_state(self, args[0], args[1], args[2])'
3454 )
3455 ])
3456+
3457+ mock.AddObject(
3458+ PHONE_WIFI_OBJ,
3459+ MENU_IFACE, {}, [
3460+ (
3461+ 'Start', 'au', 'a(uuaa{sv})',
3462+ 'ret = self.start(self, args[0])'
3463+ ),
3464+ (
3465+ 'End', 'au', '',
3466+ 'ret = self.end(self, args[0])'
3467+ )
3468+ ]
3469+ )
3470+
3471+ phone_wifi_obj = dbusmock.get_object(PHONE_WIFI_OBJ)
3472+ phone_wifi_obj.start = start
3473+ phone_wifi_obj.end = end

Subscribers

People subscribed via source and target branches