Merge lp:~jonas-drange/ubuntu-system-settings/apl into lp:ubuntu-system-settings
- apl
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~jonas-drange/ubuntu-system-settings/apl |
Merge into: | lp:ubuntu-system-settings |
Diff against target: |
2857 lines (+1060/-543) 70 files modified
plugins/about/DevMode.qml (+3/-1) plugins/about/EntryComponent.qml (+5/-19) plugins/about/PageComponent.qml (+6/-6) plugins/about/Software.qml (+3/-1) plugins/background/MainPage.qml (+10/-8) plugins/battery/PageComponent.qml (+6/-6) plugins/bluetooth/DevicePage.qml (+10/-5) plugins/bluetooth/PageComponent.qml (+11/-3) plugins/brightness/PageComponent.qml (+3/-2) plugins/brightness/WifiDisplays.qml (+1/-0) plugins/cellular/Components/MultiSim.qml (+3/-4) plugins/cellular/Components/SingleSim.qml (+2/-3) plugins/cellular/PageApnEditor.qml (+1/-2) plugins/cellular/PageCarrierAndApn.qml (+6/-3) plugins/cellular/PageCarriersAndApns.qml (+6/-3) plugins/cellular/PageChooseApn.qml (+9/-6) plugins/cellular/PageChooseCarrier.qml (+1/-1) plugins/cellular/PageComponent.qml (+1/-0) plugins/flight-mode/EntryComponent.qml (+22/-31) plugins/hotspot/PageComponent.qml (+1/-0) plugins/language/KeyboardLayouts.qml (+1/-0) plugins/language/PageComponent.qml (+15/-27) plugins/language/PageHardwareKeyboard.qml (+6/-4) plugins/language/SpellChecking.qml (+2/-0) plugins/notifications/PageComponent.qml (+11/-8) plugins/orientation-lock/EntryComponent.qml (+18/-29) plugins/phone/CallForwarding.qml (+1/-1) plugins/phone/MultiSim.qml (+19/-13) plugins/phone/Services.qml (+6/-1) plugins/phone/SingleSim.qml (+7/-4) plugins/security-privacy/AppAccess.qml (+20/-13) plugins/security-privacy/AppAccessControl.qml (+2/-0) plugins/security-privacy/Location.qml (+1/-1) plugins/security-privacy/PageComponent.qml (+28/-40) plugins/security-privacy/PhoneLocking.qml (+5/-2) plugins/security-privacy/SimPin.qml (+2/-0) plugins/security-privacy/here-terms.qml (+1/-0) plugins/sound/PageComponent.qml (+8/-7) plugins/sound/SoundsList.qml (+3/-5) plugins/system-update/EntryComponent.qml (+5/-2) plugins/system-update/PageComponent.qml (+2/-1) plugins/time-date/ChooseTimeZone.qml (+1/-1) plugins/time-date/PageComponent.qml (+5/-3) plugins/vpn/PageComponent.qml (+1/-1) plugins/wifi/AccessPoint.qml (+3/-9) plugins/wifi/PageComponent.qml (+4/-2) plugins/wifi/PreviousNetworks.qml (+7/-5) src/CMakeLists.txt (+0/-1) src/SystemSettings/ItemPage.qml (+21/-2) src/qml/CategoryGrid.qml (+0/-90) src/qml/CategorySection.qml (+14/-2) src/qml/EntryComponent.qml (+5/-49) src/qml/MainWindow.qml (+103/-44) src/qml/UncategorizedItemsView.qml (+13/-4) src/ui.qrc (+0/-1) tests/CMakeLists.txt (+2/-0) tests/autopilot/ubuntu_system_settings/__init__.py (+0/-7) tests/autopilot/ubuntu_system_settings/tests/__init__.py (+1/-0) tests/autopilot/ubuntu_system_settings/tests/test_search.py (+0/-55) tests/mocks/CMakeLists.txt (+1/-0) tests/mocks/SystemSettings/CMakeLists.txt (+20/-0) tests/mocks/SystemSettings/ListItems/qmldir (+9/-0) tests/mocks/SystemSettings/MockPluginManager.cpp (+159/-0) tests/mocks/SystemSettings/MockPluginManager.h (+102/-0) tests/mocks/SystemSettings/plugin.cpp (+28/-0) tests/mocks/SystemSettings/plugin.h (+32/-0) tests/mocks/SystemSettings/qmldir (+8/-0) tests/plugins/CMakeLists.txt (+8/-2) tests/plugins/main/tst_MainWindow.qml (+236/-0) tests/plugins/system-update/tst_systemupdate_entrycomponent.qml (+4/-3) |
To merge this branch: | bzr merge lp:~jonas-drange/ubuntu-system-settings/apl |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
system-apps-ci-bot | continuous-integration | Needs Fixing | |
Ubuntu Touch System Settings | Pending | ||
Review via email: mp+312583@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-12-09.
Commit message
migrates uss to apl
Description of the change
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
- 1752. By Jonas G. Drange
-
fixes accesspoint
- 1753. By Jonas G. Drange
-
migrates phone to APL
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:1753
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 1754. By Jonas G. Drange
-
eod
- 1755. By Jonas G. Drange
-
adds test
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:1755
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 1756. By Jonas G. Drange
-
placeholder plugin
- 1757. By Jonas G. Drange
-
wait for stuff to be complete before triggering layout changes on column changes
- 1758. By Jonas G. Drange
-
fix test issue on vivid
- 1759. By Jonas G. Drange
-
harden test
- 1760. By Jonas G. Drange
-
adds sync apl ability, and fixes unity8 resize + placeholder bug
- 1761. By Jonas G. Drange
-
merge prereq
- 1762. By Jonas G. Drange
-
fixes vpn and fingerprint issues, as far as USS can fix them
- 1763. By Jonas G. Drange
-
sets flickable on storage page correctly
- 1764. By Jonas G. Drange
-
fixes broken itempage in hw kbd
- 1765. By Jonas G. Drange
-
fixes copyright date
- 1766. By Jonas G. Drange
-
merges trunk
- 1767. By Jonas G. Drange
-
merge prereq lp1644268
- 1768. By Jonas G. Drange
-
completes migration to apl for background panel
- 1769. By Jonas G. Drange
-
finalizes migration to apl for bluetooth devicepage
Unmerged revisions
Preview Diff
1 | === modified file 'plugins/about/DevMode.qml' |
2 | --- plugins/about/DevMode.qml 2016-02-04 15:28:51 +0000 |
3 | +++ plugins/about/DevMode.qml 2016-12-09 15:19:40 +0000 |
4 | @@ -115,7 +115,9 @@ |
5 | objectName: "lockSecurityItem" |
6 | text: i18n.tr("Lock security") |
7 | progression: true |
8 | - onClicked: pageStack.push(Qt.resolvedUrl("../security-privacy/LockSecurity.qml")) |
9 | + onClicked: pageStack.addPageToNextColumn( |
10 | + devModePage, Qt.resolvedUrl("../security-privacy/LockSecurity.qml") |
11 | + ) |
12 | } |
13 | } |
14 | } |
15 | |
16 | === modified file 'plugins/about/EntryComponent.qml' |
17 | --- plugins/about/EntryComponent.qml 2016-07-14 13:51:56 +0000 |
18 | +++ plugins/about/EntryComponent.qml 2016-12-09 15:19:40 +0000 |
19 | @@ -19,23 +19,9 @@ |
20 | */ |
21 | |
22 | import QtQuick 2.4 |
23 | -import Ubuntu.Components 1.3 |
24 | - |
25 | -ListItem { |
26 | - id: root |
27 | - |
28 | - objectName: "entryComponent-about" |
29 | - height: layout.height |
30 | - |
31 | - ListItemLayout { |
32 | - id: layout |
33 | - title.text: i18n.tr(model.displayName) |
34 | - Icon { |
35 | - SlotsLayout.position: SlotsLayout.Leading; |
36 | - SlotsLayout.padding { top: 0; bottom: 0 } |
37 | - source: Qt.resolvedUrl(model.icon) |
38 | - height: units.gu(5) |
39 | - } |
40 | - ProgressionSlot {} |
41 | - } |
42 | +import SystemSettings.ListItems 1.0 as SettingsListItems |
43 | + |
44 | +SettingsListItems.IconProgression { |
45 | + text: i18n.tr(model.displayName) |
46 | + iconSource: model.icon |
47 | } |
48 | |
49 | === modified file 'plugins/about/PageComponent.qml' |
50 | --- plugins/about/PageComponent.qml 2016-11-29 11:12:13 +0000 |
51 | +++ plugins/about/PageComponent.qml 2016-12-09 15:19:40 +0000 |
52 | @@ -150,7 +150,7 @@ |
53 | text: i18n.tr("Storage") |
54 | /* TRANSLATORS: that's the free disk space, indicated in the most appropriate storage unit */ |
55 | value: i18n.tr("%1 free").arg(Utilities.formatSize(backendInfos.getFreeSpace("/home"))) |
56 | - onClicked: pageStack.push(Qt.resolvedUrl("Storage.qml")) |
57 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("Storage.qml")) |
58 | } |
59 | |
60 | SettingsItemTitle { |
61 | @@ -173,7 +173,7 @@ |
62 | value: "Ubuntu %1%2" |
63 | .arg(deviceInfos.version(DeviceInfo.Os)) |
64 | .arg(versionIdentifier ? " (%1)".arg(versionIdentifier) : "") |
65 | - onClicked: pageStack.push(Qt.resolvedUrl("Version.qml"), { |
66 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("Version.qml"), { |
67 | version: versionIdentifier |
68 | }) |
69 | } |
70 | @@ -199,7 +199,7 @@ |
71 | var updatePage = upPlugin.pageComponent |
72 | var updatePageItem; |
73 | if (updatePage) { |
74 | - updatePageItem = pageStack.push(updatePage, { |
75 | + updatePageItem = pageStack.addPageToNextColumn(root, updatePage, { |
76 | plugin: upPlugin, pluginManager: pluginManager |
77 | }); |
78 | updatePageItem.check(true); // Force a check. |
79 | @@ -222,7 +222,7 @@ |
80 | SettingsListItems.StandardProgression { |
81 | objectName: "licenseItem" |
82 | text: i18n.tr("Software licenses") |
83 | - onClicked: pageStack.push(Qt.resolvedUrl("Software.qml")) |
84 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("Software.qml")) |
85 | } |
86 | |
87 | SettingsListItems.StandardProgression { |
88 | @@ -230,14 +230,14 @@ |
89 | pluginManager.getByName("regulatory-information") |
90 | text: i18n.tr("Regulatory info") |
91 | visible: regulatoryInfo |
92 | - onClicked: pageStack.push(regulatoryInfo.pageComponent) |
93 | + onClicked: pageStack.addPageToNextColumn(root, regulatoryInfo.pageComponent) |
94 | } |
95 | |
96 | SettingsListItems.SingleValueProgression { |
97 | objectName: "devmodeItem" |
98 | text: i18n.tr("Developer mode") |
99 | visible: !isSnap && backendInfos.developerModeCapable || showAllUI |
100 | - onClicked: pageStack.push(Qt.resolvedUrl("DevMode.qml")) |
101 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("DevMode.qml")) |
102 | } |
103 | } |
104 | } |
105 | |
106 | === modified file 'plugins/about/Software.qml' |
107 | --- plugins/about/Software.qml 2016-11-28 13:27:33 +0000 |
108 | +++ plugins/about/Software.qml 2016-12-09 15:19:40 +0000 |
109 | @@ -30,7 +30,9 @@ |
110 | delegate: ListItem.Standard { |
111 | text: fileName |
112 | progression: true |
113 | - onClicked: pageStack.push(Qt.resolvedUrl("License.qml"), {binary: fileName}) |
114 | + onClicked: pageStack.addPageToNextColumn( |
115 | + licensesPage, Qt.resolvedUrl("License.qml"), {binary: fileName} |
116 | + ) |
117 | } |
118 | |
119 | } |
120 | |
121 | === modified file 'plugins/background/MainPage.qml' |
122 | --- plugins/background/MainPage.qml 2016-09-26 20:00:30 +0000 |
123 | +++ plugins/background/MainPage.qml 2016-12-09 15:19:40 +0000 |
124 | @@ -44,9 +44,7 @@ |
125 | Action { |
126 | id: selectPeer |
127 | // when action has been activated, push the picker on the stack |
128 | - onTriggered: { |
129 | - pageStack.push(picker); |
130 | - } |
131 | + onTriggered: pageStack.addPageToNextColumn(mainPage, picker) |
132 | } |
133 | |
134 | // qml bindings for background stuff |
135 | @@ -82,7 +80,8 @@ |
136 | title: i18n.tr("Ubuntu Art") |
137 | current: welcomeBackground |
138 | onSelected: { |
139 | - pageStack.push(Qt.resolvedUrl("Preview.qml"), {uri: uri}); |
140 | + pageStack.addPageToNextColumn(mainPage, |
141 | + Qt.resolvedUrl("Preview.qml"), {uri: uri}); |
142 | selectedItemConnection.target = pageStack.currentPage; |
143 | } |
144 | } |
145 | @@ -100,7 +99,8 @@ |
146 | editable: true |
147 | isCustom: true |
148 | onSelected: { |
149 | - pageStack.push(Qt.resolvedUrl("Preview.qml"), {uri: uri}); |
150 | + pageStack.addPageToNextColumn(mainPage, |
151 | + Qt.resolvedUrl("Preview.qml"), {uri: uri}); |
152 | selectedItemConnection.target = pageStack.currentPage |
153 | } |
154 | } |
155 | @@ -186,9 +186,11 @@ |
156 | // when peer has been selected, request a transfer, providing |
157 | // a callback that pushes the preview stack |
158 | startContentTransfer(function(uri) { |
159 | - pageStack.push(Qt.resolvedUrl("Preview.qml"), { |
160 | - uri: uri, imported: true |
161 | - }); |
162 | + pageStack.addPageToNextColumn(mainPage, |
163 | + Qt.resolvedUrl("Preview.qml"), { |
164 | + uri: uri, imported: true |
165 | + } |
166 | + ); |
167 | // set Connection target |
168 | selectedItemConnection.target = pageStack.currentPage; |
169 | }); |
170 | |
171 | === modified file 'plugins/battery/PageComponent.qml' |
172 | --- plugins/battery/PageComponent.qml 2016-11-21 14:47:12 +0000 |
173 | +++ plugins/battery/PageComponent.qml 2016-12-09 15:19:40 +0000 |
174 | @@ -297,9 +297,9 @@ |
175 | onClicked: { |
176 | var brightnessPlugin = pluginManager.getByName("brightness"); |
177 | if (brightnessPlugin) { |
178 | - pageStack.push(brightnessPlugin.pageComponent, { |
179 | - plugin: brightnessPlugin, pluginManager: pluginManager |
180 | - }); |
181 | + pageStack.addPageToNextColumn(root, |
182 | + brightnessPlugin.pageComponent, { |
183 | + plugin: brightnessPlugin, pluginManager: pluginManager}); |
184 | } else { |
185 | console.warn("Failed to get brightness plugin instance"); |
186 | } |
187 | @@ -344,9 +344,9 @@ |
188 | SlotsLayout.position: SlotsLayout.First |
189 | } |
190 | |
191 | - onClicked: pageStack.push( |
192 | - Qt.resolvedUrl("SleepValues.qml"), |
193 | - { title: text, lockOnSuspend: lockOnSuspend }) |
194 | + onClicked: pageStack.addPageToNextColumn(root, |
195 | + Qt.resolvedUrl("SleepValues.qml"),{ |
196 | + title: text, lockOnSuspend: lockOnSuspend }) |
197 | visible: !isSnap || showAllUI |
198 | } |
199 | |
200 | |
201 | === modified file 'plugins/bluetooth/DevicePage.qml' |
202 | --- plugins/bluetooth/DevicePage.qml 2016-07-14 13:51:56 +0000 |
203 | +++ plugins/bluetooth/DevicePage.qml 2016-12-09 15:19:40 +0000 |
204 | @@ -74,14 +74,19 @@ |
205 | } |
206 | } |
207 | |
208 | - title: backend.selectedDevice ? |
209 | - backend.selectedDevice.name.length > 0 ? |
210 | - backend.selectedDevice.name : |
211 | - backend.selectedDevice.address |
212 | - : i18n.tr("None") |
213 | + header: PageHeader { |
214 | + title: backend.selectedDevice ? |
215 | + backend.selectedDevice.name.length > 0 ? |
216 | + backend.selectedDevice.name : |
217 | + backend.selectedDevice.address |
218 | + : i18n.tr("None") |
219 | + flickable: scrollWidget |
220 | + } |
221 | + |
222 | visible: false |
223 | |
224 | Flickable { |
225 | + id: scrollWidget |
226 | anchors.fill: parent |
227 | contentHeight: contentItem.childrenRect.height |
228 | boundsBehavior: (contentHeight > root.height) ? |
229 | |
230 | === modified file 'plugins/bluetooth/PageComponent.qml' |
231 | --- plugins/bluetooth/PageComponent.qml 2016-07-14 13:51:56 +0000 |
232 | +++ plugins/bluetooth/PageComponent.qml 2016-12-09 15:19:40 +0000 |
233 | @@ -31,6 +31,7 @@ |
234 | ItemPage { |
235 | id: root |
236 | title: i18n.tr("Bluetooth") |
237 | + flickable: scrollWidget |
238 | objectName: "bluetoothPage" |
239 | |
240 | property var dialogPopupId |
241 | @@ -205,6 +206,7 @@ |
242 | } |
243 | |
244 | Flickable { |
245 | + id: scrollWidget |
246 | anchors.fill: parent |
247 | contentHeight: contentItem.childrenRect.height |
248 | boundsBehavior: (contentHeight > root.height) ? |
249 | @@ -299,7 +301,9 @@ |
250 | } |
251 | onClicked: { |
252 | backend.setSelectedDevice(addressName); |
253 | - pageStack.push(Qt.resolvedUrl("DevicePage.qml"), {backend: backend, root: root}); |
254 | + pageStack.addPageToNextColumn(root, |
255 | + Qt.resolvedUrl("DevicePage.qml"), |
256 | + {backend: backend, root: root}); |
257 | } |
258 | } |
259 | } |
260 | @@ -341,7 +345,9 @@ |
261 | text: getDisplayName(type, displayName) |
262 | onClicked: { |
263 | backend.setSelectedDevice(addressName); |
264 | - pageStack.push(Qt.resolvedUrl("DevicePage.qml"), {backend: backend, root: root}); |
265 | + pageStack.addPageToNextColumn(root, |
266 | + Qt.resolvedUrl("DevicePage.qml"), |
267 | + {backend: backend, root: root}); |
268 | } |
269 | } |
270 | } |
271 | @@ -375,7 +381,9 @@ |
272 | text: getDisplayName(type, displayName) |
273 | onClicked: { |
274 | backend.setSelectedDevice(addressName); |
275 | - pageStack.push(Qt.resolvedUrl("DevicePage.qml"), {backend: backend, root: root}); |
276 | + pageStack.addPageToNextColumn(root, |
277 | + Qt.resolvedUrl("DevicePage.qml"), |
278 | + {backend: backend, root: root}); |
279 | } |
280 | } |
281 | } |
282 | |
283 | === modified file 'plugins/brightness/PageComponent.qml' |
284 | --- plugins/brightness/PageComponent.qml 2016-07-06 15:38:55 +0000 |
285 | +++ plugins/brightness/PageComponent.qml 2016-12-09 15:19:40 +0000 |
286 | @@ -43,7 +43,7 @@ |
287 | AethercastDisplays { |
288 | id: aethercastDisplays |
289 | onEnabledChanged: { |
290 | - /* This is a hack to ensure the aethercast enabled switch stays |
291 | + /* This is a hack to ensure the aethercast enabled switch stays |
292 | * in sync with the enabled property |
293 | */ |
294 | enabledCheck.serverChecked = enabled; |
295 | @@ -158,7 +158,8 @@ |
296 | text: i18n.tr("Wireless display") |
297 | value: aethercastDisplays.state === "connected" ? i18n.tr("Connected") : i18n.tr("Not connected") |
298 | progression: true |
299 | - onClicked: pageStack.push(Qt.resolvedUrl("WifiDisplays.qml")) |
300 | + onClicked: pageStack.addPageToNextColumn( |
301 | + root, Qt.resolvedUrl("WifiDisplays.qml")) |
302 | } |
303 | } |
304 | } |
305 | |
306 | === modified file 'plugins/brightness/WifiDisplays.qml' |
307 | --- plugins/brightness/WifiDisplays.qml 2016-07-14 08:31:08 +0000 |
308 | +++ plugins/brightness/WifiDisplays.qml 2016-12-09 15:19:40 +0000 |
309 | @@ -25,6 +25,7 @@ |
310 | id: wifiDisplays |
311 | objectName: "wifiDisplays" |
312 | title: i18n.tr("Wireless Display") |
313 | + flickable: pageFlickable |
314 | |
315 | Component.onCompleted: { |
316 | if (!displays.scanning) |
317 | |
318 | === modified file 'plugins/cellular/Components/MultiSim.qml' |
319 | --- plugins/cellular/Components/MultiSim.qml 2016-07-30 01:55:39 +0000 |
320 | +++ plugins/cellular/Components/MultiSim.qml 2016-12-09 15:19:40 +0000 |
321 | @@ -26,8 +26,8 @@ |
322 | import Ubuntu.Components.ListItems 1.3 as ListItems |
323 | |
324 | Column { |
325 | + id: multiSim |
326 | objectName: "multiSim" |
327 | - |
328 | property var sims |
329 | property var poweredSim: { |
330 | var s = null; |
331 | @@ -63,9 +63,8 @@ |
332 | progressionVisible: enabled |
333 | showDivider: false |
334 | onClicked: { |
335 | - pageStack.push(Qt.resolvedUrl("../PageCarriersAndApns.qml"), { |
336 | - sims: sims |
337 | - }); |
338 | + pageStack.addPageToNextColumn(multiSim, |
339 | + Qt.resolvedUrl("../PageCarriersAndApns.qml"), { sims: sims }); |
340 | } |
341 | } |
342 | |
343 | |
344 | === modified file 'plugins/cellular/Components/SingleSim.qml' |
345 | --- plugins/cellular/Components/SingleSim.qml 2016-07-14 13:51:56 +0000 |
346 | +++ plugins/cellular/Components/SingleSim.qml 2016-12-09 15:19:40 +0000 |
347 | @@ -111,9 +111,8 @@ |
348 | id: chooseCarrier |
349 | objectName: "carrierApnEntry" |
350 | value: sim.netReg.name || "" |
351 | - onClicked: pageStack.push(Qt.resolvedUrl("../PageCarrierAndApn.qml"), { |
352 | - sim: sim |
353 | - }) |
354 | + onClicked: pageStack.addPageToNextColumn(singlesim, |
355 | + Qt.resolvedUrl("../PageCarrierAndApn.qml"), { sim: sim }) |
356 | } |
357 | |
358 | RadioSingleSim { |
359 | |
360 | === modified file 'plugins/cellular/PageApnEditor.qml' |
361 | --- plugins/cellular/PageApnEditor.qml 2016-04-01 15:13:06 +0000 |
362 | +++ plugins/cellular/PageApnEditor.qml 2016-12-09 15:19:40 +0000 |
363 | @@ -67,7 +67,7 @@ |
364 | signal canceled () |
365 | |
366 | title: contextQML ? i18n.tr("Edit") : i18n.tr("New APN") |
367 | - |
368 | + flickable: scrollArea |
369 | state: "default" |
370 | states: [ |
371 | PageHeadState { |
372 | @@ -124,7 +124,6 @@ |
373 | value: false |
374 | } |
375 | |
376 | - flickable: null |
377 | Flickable { |
378 | id: scrollArea |
379 | objectName: "scrollArea" |
380 | |
381 | === modified file 'plugins/cellular/PageCarrierAndApn.qml' |
382 | --- plugins/cellular/PageCarrierAndApn.qml 2016-07-14 13:51:56 +0000 |
383 | +++ plugins/cellular/PageCarrierAndApn.qml 2016-12-09 15:19:40 +0000 |
384 | @@ -26,11 +26,12 @@ |
385 | id: root |
386 | title: i18n.tr("Carrier & APN") |
387 | objectName: "carrierApnPage" |
388 | - flickable: null |
389 | + flickable: scrollWidget |
390 | |
391 | property var sim |
392 | |
393 | Flickable { |
394 | + id: scrollWidget |
395 | anchors.fill: parent |
396 | contentWidth: parent.width |
397 | contentHeight: contentItem.childrenRect.height |
398 | @@ -47,7 +48,8 @@ |
399 | enabled: (sim.netReg.status !== "") && |
400 | (sim.netReg.mode !== "auto-only") |
401 | progressionVisible: enabled |
402 | - onClicked: pageStack.push(Qt.resolvedUrl("PageChooseCarrier.qml"), { |
403 | + onClicked: pageStack.addPageToNextColumn(root, |
404 | + Qt.resolvedUrl("PageChooseCarrier.qml"), { |
405 | sim: sim, |
406 | title: i18n.tr("Carrier") |
407 | }) |
408 | @@ -57,7 +59,8 @@ |
409 | text: i18n.tr("APN") |
410 | objectName: "apn" |
411 | progressionVisible: enabled |
412 | - onClicked: pageStack.push(Qt.resolvedUrl("PageChooseApn.qml"), { |
413 | + onClicked: pageStack.addPageToNextColumn(root, |
414 | + Qt.resolvedUrl("PageChooseApn.qml"), { |
415 | sim: sim |
416 | }) |
417 | } |
418 | |
419 | === modified file 'plugins/cellular/PageCarriersAndApns.qml' |
420 | --- plugins/cellular/PageCarriersAndApns.qml 2016-07-14 13:51:56 +0000 |
421 | +++ plugins/cellular/PageCarriersAndApns.qml 2016-12-09 15:19:40 +0000 |
422 | @@ -26,11 +26,12 @@ |
423 | id: root |
424 | title: i18n.tr("Carriers & APNs") |
425 | objectName: "carrierApnPage" |
426 | - flickable: null |
427 | + flickable: scrollWidget |
428 | |
429 | property var sims |
430 | |
431 | Flickable { |
432 | + id: scrollWidget |
433 | anchors.fill: parent |
434 | contentWidth: parent.width |
435 | contentHeight: contentItem.childrenRect.height |
436 | @@ -59,7 +60,8 @@ |
437 | enabled: (sims[index].netReg.status !== "") && |
438 | (sims[index].netReg.mode !== "auto-only") |
439 | progressionVisible: enabled |
440 | - onClicked: pageStack.push(Qt.resolvedUrl("PageChooseCarrier.qml"), { |
441 | + onClicked: pageStack.addPageToNextColumn(root, |
442 | + Qt.resolvedUrl("PageChooseCarrier.qml"), { |
443 | sim: sims[index], |
444 | title: sims[index].title |
445 | }) |
446 | @@ -68,7 +70,8 @@ |
447 | SettingsListItems.StandardProgression { |
448 | text: i18n.tr("APN") |
449 | progressionVisible: enabled |
450 | - onClicked: pageStack.push(Qt.resolvedUrl("PageChooseApn.qml"), { |
451 | + onClicked: pageStack.addPageToNextColumn(root, |
452 | + Qt.resolvedUrl("PageChooseApn.qml"), { |
453 | sim: sims[index] |
454 | }) |
455 | } |
456 | |
457 | === modified file 'plugins/cellular/PageChooseApn.qml' |
458 | --- plugins/cellular/PageChooseApn.qml 2016-07-14 13:51:56 +0000 |
459 | +++ plugins/cellular/PageChooseApn.qml 2016-12-09 15:19:40 +0000 |
460 | @@ -35,6 +35,7 @@ |
461 | ItemPage { |
462 | id: root |
463 | title: i18n.tr("APN") |
464 | + flickable: scrollWidget |
465 | objectName: "apnPage" |
466 | |
467 | property var sim |
468 | @@ -106,11 +107,13 @@ |
469 | iconName: "add" |
470 | objectName: "newApn" |
471 | onTriggered: { |
472 | - editor = pageStack.push(pageApnEditor, { |
473 | - mmsModel: mmsContexts, |
474 | - internetModel: internetContexts, |
475 | - iaModel: iaContexts |
476 | - }); |
477 | + editor = pageStack.addPageToNextColumn(root, |
478 | + pageApnEditor, { |
479 | + mmsModel: mmsContexts, |
480 | + internetModel: internetContexts, |
481 | + iaModel: iaContexts |
482 | + } |
483 | + ); |
484 | } |
485 | } |
486 | ] |
487 | @@ -306,7 +309,7 @@ |
488 | } |
489 | |
490 | onClicked: { |
491 | - editor = pageStack.push(pageApnEditor, { |
492 | + editor = pageStack.addPageToNextColumn(root, pageApnEditor, { |
493 | contextQML: qml, |
494 | mmsModel: mmsContexts, |
495 | internetModel: internetContexts, |
496 | |
497 | === modified file 'plugins/cellular/PageChooseCarrier.qml' |
498 | --- plugins/cellular/PageChooseCarrier.qml 2015-11-13 13:37:40 +0000 |
499 | +++ plugins/cellular/PageChooseCarrier.qml 2016-12-09 15:19:40 +0000 |
500 | @@ -31,7 +31,7 @@ |
501 | id: root |
502 | title: i18n.tr("Carrier") |
503 | objectName: "chooseCarrierPage" |
504 | - flickable: null |
505 | + flickable: scrollWidget |
506 | |
507 | property var sim |
508 | property bool scanning: true |
509 | |
510 | === modified file 'plugins/cellular/PageComponent.qml' |
511 | --- plugins/cellular/PageComponent.qml 2016-07-14 13:51:56 +0000 |
512 | +++ plugins/cellular/PageComponent.qml 2016-12-09 15:19:40 +0000 |
513 | @@ -30,6 +30,7 @@ |
514 | ItemPage { |
515 | id: root |
516 | title: i18n.tr("Cellular") |
517 | + flickable: flick |
518 | objectName: "cellularPage" |
519 | |
520 | property var modemsSorted: [] |
521 | |
522 | === modified file 'plugins/flight-mode/EntryComponent.qml' |
523 | --- plugins/flight-mode/EntryComponent.qml 2016-07-14 13:51:56 +0000 |
524 | +++ plugins/flight-mode/EntryComponent.qml 2016-12-09 15:19:40 +0000 |
525 | @@ -19,40 +19,31 @@ |
526 | */ |
527 | |
528 | import QtQuick 2.4 |
529 | +import SystemSettings.ListItems 1.0 as SettingsListItems |
530 | import Ubuntu.Components 1.3 |
531 | import Ubuntu.SystemSettings.FlightMode 1.0 as FlightMode |
532 | import Ubuntu.Settings.Components 0.1 as USC |
533 | |
534 | -ListItem { |
535 | - id: root |
536 | - height: layout.height |
537 | - |
538 | - ListItemLayout { |
539 | - id: layout |
540 | - title.text: i18n.tr(model.displayName) |
541 | - |
542 | - Switch { |
543 | - id: switchItem |
544 | - |
545 | - SlotsLayout.position: SlotsLayout.Trailing |
546 | - USC.ServerPropertySynchroniser { |
547 | - userTarget: switchItem |
548 | - userProperty: "checked" |
549 | - serverTarget: helper |
550 | - serverProperty: "inFlightMode" |
551 | - |
552 | - onSyncTriggered: helper.setFlightMode(value) |
553 | - } |
554 | - } |
555 | - Icon { |
556 | - SlotsLayout.position: SlotsLayout.Leading; |
557 | - SlotsLayout.padding { top: 0; bottom: 0 } |
558 | - source: model.icon |
559 | - height: units.gu(5) |
560 | - } |
561 | - } |
562 | - |
563 | - FlightMode.Helper { |
564 | - id: helper |
565 | + |
566 | +SettingsListItems.Icon { |
567 | + text: i18n.tr(model.displayName) |
568 | + iconSource: model.icon |
569 | + |
570 | + Switch { |
571 | + id: switchItem |
572 | + |
573 | + SlotsLayout.position: SlotsLayout.Trailing |
574 | + USC.ServerPropertySynchroniser { |
575 | + userTarget: switchItem |
576 | + userProperty: "checked" |
577 | + serverTarget: helper |
578 | + serverProperty: "inFlightMode" |
579 | + |
580 | + onSyncTriggered: helper.setFlightMode(value) |
581 | + } |
582 | + |
583 | + FlightMode.Helper { |
584 | + id: helper |
585 | + } |
586 | } |
587 | } |
588 | |
589 | === modified file 'plugins/hotspot/PageComponent.qml' |
590 | --- plugins/hotspot/PageComponent.qml 2016-08-17 12:39:39 +0000 |
591 | +++ plugins/hotspot/PageComponent.qml 2016-12-09 15:19:40 +0000 |
592 | @@ -31,6 +31,7 @@ |
593 | id: root |
594 | objectName: "hotspotPage" |
595 | title: i18n.tr("Hotspot") |
596 | + flickable: flick |
597 | |
598 | states: [ |
599 | State { |
600 | |
601 | === modified file 'plugins/language/KeyboardLayouts.qml' |
602 | --- plugins/language/KeyboardLayouts.qml 2016-01-27 15:32:11 +0000 |
603 | +++ plugins/language/KeyboardLayouts.qml 2016-12-09 15:19:40 +0000 |
604 | @@ -27,6 +27,7 @@ |
605 | ItemPage { |
606 | id: root |
607 | title: i18n.tr("Keyboard layouts") |
608 | + flickable: subsetView |
609 | |
610 | property var plugin |
611 | property bool currentLayoutsDraggable: false |
612 | |
613 | === modified file 'plugins/language/PageComponent.qml' |
614 | --- plugins/language/PageComponent.qml 2016-11-29 11:12:13 +0000 |
615 | +++ plugins/language/PageComponent.qml 2016-12-09 15:19:40 +0000 |
616 | @@ -33,6 +33,7 @@ |
617 | objectName: "languagePage" |
618 | |
619 | title: i18n.tr("Language & Text") |
620 | + flickable: scrollWidget |
621 | |
622 | InputDeviceManager { |
623 | id: keyboardsModel |
624 | @@ -41,30 +42,16 @@ |
625 | |
626 | property bool externalKeyboardPresent: keyboardsModel.count > 0 |
627 | |
628 | - property var pluginOptions |
629 | - Connections { |
630 | - target: pageStack |
631 | - onCurrentPageChanged: { |
632 | - // If we are called with subpage=foo, push foo on the stack. |
633 | - // |
634 | - // We need to wait until the PageComponent has been pushed to the stack |
635 | - // before pushing the subpages, otherwise they will be pushed below the |
636 | - // PageComponent. |
637 | - if (pageStack.currentPage === root) { |
638 | - if (pluginOptions && pluginOptions['subpage']) { |
639 | - switch (pluginOptions['subpage']) { |
640 | - case 'hw-keyboard-layouts': |
641 | - pageStack.push(Qt.resolvedUrl("KeyboardLayouts.qml"), { |
642 | - plugin: hwKeyboardPlugin, |
643 | - currentLayoutsDraggable: true |
644 | - }) |
645 | - break; |
646 | - } |
647 | - } |
648 | - |
649 | - // Once done, disable this Connections, so that if the user navigates |
650 | - // back to the root we won't push the subpages again |
651 | - target = null |
652 | + onPushedOntoStack: { |
653 | + if (pluginOptions && pluginOptions['subpage']) { |
654 | + switch (pluginOptions['subpage']) { |
655 | + case 'hw-keyboard-layouts': |
656 | + pageStack.addPageToNextColumn( |
657 | + root, Qt.resolvedUrl('KeyboardLayouts.qml'), { |
658 | + plugin: hwKeyboardPlugin, |
659 | + currentLayoutsDraggable: true |
660 | + }); |
661 | + break; |
662 | } |
663 | } |
664 | } |
665 | @@ -121,6 +108,7 @@ |
666 | } |
667 | |
668 | Flickable { |
669 | + id: scrollWidget |
670 | anchors.fill: parent |
671 | contentHeight: contentItem.childrenRect.height |
672 | boundsBehavior: contentHeight > root.height ? |
673 | @@ -158,7 +146,7 @@ |
674 | value: oskPlugin.keyboardLayoutsModel.subset.length == 1 ? |
675 | oskPlugin.keyboardLayoutsModel.superset[oskPlugin.keyboardLayoutsModel.subset[0]][0] : |
676 | oskPlugin.keyboardLayoutsModel.subset.length |
677 | - onClicked: pageStack.push(Qt.resolvedUrl("KeyboardLayouts.qml"), { |
678 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("KeyboardLayouts.qml"), { |
679 | plugin: oskPlugin |
680 | }) |
681 | } |
682 | @@ -167,7 +155,7 @@ |
683 | text: i18n.tr("External keyboard") |
684 | progression: true |
685 | showDivider: false |
686 | - onClicked: pageStack.push(Qt.resolvedUrl("PageHardwareKeyboard.qml")) |
687 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("PageHardwareKeyboard.qml")) |
688 | /* Hidden due to lp:1644268, i.e. no layout sources are |
689 | enumerated by the current code due to hard coded paths. */ |
690 | visible: (externalKeyboardPresent && !isSnap) || showAllUI |
691 | @@ -184,7 +172,7 @@ |
692 | plugin.spellCheckingModel.subset.length |
693 | progression: true |
694 | |
695 | - onClicked: pageStack.push(spellChecking) |
696 | + onClicked: pageStack.addPageToNextColumn(root, spellChecking) |
697 | } |
698 | |
699 | ListItem.Standard { |
700 | |
701 | === modified file 'plugins/language/PageHardwareKeyboard.qml' |
702 | --- plugins/language/PageHardwareKeyboard.qml 2016-11-15 13:19:23 +0000 |
703 | +++ plugins/language/PageHardwareKeyboard.qml 2016-12-09 15:19:40 +0000 |
704 | @@ -64,10 +64,12 @@ |
705 | plugin.keyboardLayoutsModel.subset.length |
706 | progression: true |
707 | |
708 | - onClicked: pageStack.push(Qt.resolvedUrl("KeyboardLayouts.qml"), { |
709 | - plugin: plugin, |
710 | - currentLayoutsDraggable: true |
711 | - }) |
712 | + onClicked: pageStack.addPageToNextColumn(root, |
713 | + Qt.resolvedUrl("KeyboardLayouts.qml"), { |
714 | + plugin: plugin, |
715 | + currentLayoutsDraggable: true |
716 | + } |
717 | + ) |
718 | } |
719 | } |
720 | } |
721 | |
722 | === modified file 'plugins/language/SpellChecking.qml' |
723 | --- plugins/language/SpellChecking.qml 2016-07-12 16:40:18 +0000 |
724 | +++ plugins/language/SpellChecking.qml 2016-12-09 15:19:40 +0000 |
725 | @@ -27,6 +27,7 @@ |
726 | |
727 | ItemPage { |
728 | title: i18n.tr("Spell checking") |
729 | + flickable: scrollWidget |
730 | |
731 | UbuntuLanguagePlugin { |
732 | id: plugin |
733 | @@ -52,6 +53,7 @@ |
734 | } |
735 | |
736 | SubsetView { |
737 | + id: scrollWidget |
738 | clip: true |
739 | |
740 | anchors.top: item.bottom |
741 | |
742 | === modified file 'plugins/notifications/PageComponent.qml' |
743 | --- plugins/notifications/PageComponent.qml 2016-07-08 22:13:26 +0000 |
744 | +++ plugins/notifications/PageComponent.qml 2016-12-09 15:19:40 +0000 |
745 | @@ -27,6 +27,7 @@ |
746 | objectName: "systemNotificationsPage" |
747 | |
748 | title: i18n.tr("Notifications") |
749 | + flickable: notificationsList |
750 | |
751 | onActiveChanged: { |
752 | if (active) { |
753 | @@ -66,7 +67,7 @@ |
754 | left: parent.left |
755 | right: parent.right |
756 | } |
757 | - |
758 | + |
759 | ListItems.Base { |
760 | height: labelSubtitle.height + units.gu(2) |
761 | Label { |
762 | @@ -105,8 +106,9 @@ |
763 | return |
764 | } |
765 | |
766 | - pageStack.push(Qt.resolvedUrl("ClickAppsSoundsNotify.qml"), |
767 | - { model: clickAppsSoundsNotifyModel }) |
768 | + pageStack.addPageToNextColumn( |
769 | + root, Qt.resolvedUrl("ClickAppsSoundsNotify.qml"), |
770 | + { model: clickAppsSoundsNotifyModel }) |
771 | } |
772 | } |
773 | |
774 | @@ -130,8 +132,9 @@ |
775 | return |
776 | } |
777 | |
778 | - pageStack.push(Qt.resolvedUrl("ClickAppsVibrationsNotify.qml"), |
779 | - { model: clickAppsVibrationsNotifyModel }) |
780 | + pageStack.addPageToNextColumn( |
781 | + root, Qt.resolvedUrl("ClickAppsVibrationsNotify.qml"), |
782 | + { model: clickAppsVibrationsNotifyModel }) |
783 | } |
784 | } |
785 | |
786 | @@ -147,9 +150,9 @@ |
787 | delegate: ListItem { |
788 | height: layout.height + (divider.visible ? divider.height : 0) |
789 | |
790 | - onClicked: pageStack.push(Qt.resolvedUrl("ClickAppNotifications.qml"), |
791 | - { entry: model, |
792 | - entryIndex: index }) |
793 | + onClicked: pageStack.addPageToNextColumn( |
794 | + root, Qt.resolvedUrl("ClickAppNotifications.qml"), |
795 | + { entry: model, entryIndex: index }) |
796 | |
797 | ListItemLayout { |
798 | id: layout |
799 | |
800 | === modified file 'plugins/orientation-lock/EntryComponent.qml' |
801 | --- plugins/orientation-lock/EntryComponent.qml 2016-07-14 13:51:56 +0000 |
802 | +++ plugins/orientation-lock/EntryComponent.qml 2016-12-09 15:19:40 +0000 |
803 | @@ -20,37 +20,26 @@ |
804 | |
805 | import GSettings 1.0 |
806 | import QtQuick 2.4 |
807 | -import QtQuick.Window 2.1 |
808 | +import SystemSettings.ListItems 1.0 as SettingsListItems |
809 | import Ubuntu.Components 1.3 |
810 | |
811 | - |
812 | -ListItem { |
813 | - id: root |
814 | - height: layout.height |
815 | - |
816 | - ListItemLayout { |
817 | - id: layout |
818 | - title.text: i18n.tr(model.displayName) |
819 | - Switch { |
820 | - id: control |
821 | - objectName: "orientationLockSwitch" |
822 | - |
823 | - SlotsLayout.position: SlotsLayout.Trailing |
824 | - property bool serverChecked: systemSettings.rotationLock |
825 | - onServerCheckedChanged: checked = serverChecked |
826 | - Component.onCompleted: checked = serverChecked |
827 | - onTriggered: systemSettings.rotationLock = checked |
828 | - |
829 | - GSettings { |
830 | - id: systemSettings |
831 | - schema.id: "com.ubuntu.touch.system" |
832 | - } |
833 | - } |
834 | - Icon { |
835 | - SlotsLayout.position: SlotsLayout.Leading; |
836 | - SlotsLayout.padding { top: 0; bottom: 0 } |
837 | - source: model.icon |
838 | - height: units.gu(5) |
839 | +SettingsListItems.Icon { |
840 | + text: i18n.tr(model.displayName) |
841 | + iconSource: model.icon |
842 | + |
843 | + Switch { |
844 | + id: control |
845 | + objectName: "orientationLockSwitch" |
846 | + |
847 | + SlotsLayout.position: SlotsLayout.Trailing |
848 | + property bool serverChecked: systemSettings.rotationLock |
849 | + onServerCheckedChanged: checked = serverChecked |
850 | + Component.onCompleted: checked = serverChecked |
851 | + onTriggered: systemSettings.rotationLock = checked |
852 | + |
853 | + GSettings { |
854 | + id: systemSettings |
855 | + schema.id: "com.ubuntu.touch.system" |
856 | } |
857 | } |
858 | } |
859 | |
860 | === modified file 'plugins/phone/CallForwarding.qml' |
861 | --- plugins/phone/CallForwarding.qml 2016-07-14 13:51:56 +0000 |
862 | +++ plugins/phone/CallForwarding.qml 2016-12-09 15:19:40 +0000 |
863 | @@ -100,7 +100,7 @@ |
864 | value: false |
865 | } |
866 | |
867 | - flickable: null |
868 | + flickable: flick |
869 | Flickable { |
870 | id: flick |
871 | |
872 | |
873 | === modified file 'plugins/phone/MultiSim.qml' |
874 | --- plugins/phone/MultiSim.qml 2016-07-12 16:41:13 +0000 |
875 | +++ plugins/phone/MultiSim.qml 2016-12-09 15:19:40 +0000 |
876 | @@ -41,10 +41,12 @@ |
877 | objectName: "callWaitSim" + index |
878 | text: i18n.tr("Call waiting") |
879 | progression: true |
880 | - onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), { |
881 | - sim: sims[index], |
882 | - headerTitle: sims[index].title |
883 | - }) |
884 | + onClicked: pageStack.addPageToNextColumn(root, |
885 | + Qt.resolvedUrl("CallWaiting.qml"), { |
886 | + sim: sims[index], |
887 | + headerTitle: sims[index].title |
888 | + } |
889 | + ) |
890 | } |
891 | |
892 | ListItem.SingleValue { |
893 | @@ -52,10 +54,12 @@ |
894 | text: i18n.tr("Call forwarding") |
895 | progression: true |
896 | value: sims[index].getCallForwardingSummary() |
897 | - onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), { |
898 | - sim: sims[index], |
899 | - headerTitle: sims[index].title |
900 | - }) |
901 | + onClicked: pageStack.addPageToNextColumn(root, |
902 | + Qt.resolvedUrl("CallForwarding.qml"), { |
903 | + sim: sims[index], |
904 | + headerTitle: sims[index].title |
905 | + } |
906 | + ) |
907 | } |
908 | |
909 | ListItem.Standard { |
910 | @@ -75,11 +79,13 @@ |
911 | return sims[index].simMng.present && nums; |
912 | } |
913 | showDivider: false |
914 | - onClicked: pageStack.push(Qt.resolvedUrl("Services.qml"), { |
915 | - carrierString: sims[index].netReg.name, |
916 | - sim: sims[index].simMng, |
917 | - headerTitle: sims[index].title |
918 | - }) |
919 | + onClicked: pageStack.addPageToNextColumn(root, |
920 | + Qt.resolvedUrl("Services.qml"), { |
921 | + carrierString: sims[index].netReg.name, |
922 | + sim: sims[index].simMng, |
923 | + headerTitle: sims[index].title |
924 | + } |
925 | + ) |
926 | } |
927 | |
928 | ListItem.Divider { |
929 | |
930 | === modified file 'plugins/phone/Services.qml' |
931 | --- plugins/phone/Services.qml 2016-07-12 16:41:13 +0000 |
932 | +++ plugins/phone/Services.qml 2016-12-09 15:19:40 +0000 |
933 | @@ -27,6 +27,7 @@ |
934 | id: root |
935 | objectName: "servicesPage" |
936 | title: headerTitle |
937 | + flickable: scrollWidget |
938 | property string carrierString |
939 | property variant sim |
940 | property var names: [] |
941 | @@ -44,6 +45,7 @@ |
942 | } |
943 | |
944 | Flickable { |
945 | + id: scrollWidget |
946 | anchors.fill: parent |
947 | contentHeight: contentItem.childrenRect.height |
948 | boundsBehavior: (contentHeight > root.height) ? |
949 | @@ -63,7 +65,10 @@ |
950 | ListItem.Standard { |
951 | progression: true |
952 | text: modelData |
953 | - onClicked: pageStack.push(Qt.resolvedUrl("ServiceInfo.qml"), {serviceName: modelData, serviceNumber: sim.serviceNumbers[modelData]}) |
954 | + onClicked: pageStack.addPageToNextColumn(root, |
955 | + Qt.resolvedUrl("ServiceInfo.qml"), { |
956 | + serviceName: modelData, |
957 | + serviceNumber: sim.serviceNumbers[modelData]}) |
958 | } |
959 | } |
960 | } |
961 | |
962 | === modified file 'plugins/phone/SingleSim.qml' |
963 | --- plugins/phone/SingleSim.qml 2016-07-12 16:41:13 +0000 |
964 | +++ plugins/phone/SingleSim.qml 2016-12-09 15:19:40 +0000 |
965 | @@ -33,7 +33,8 @@ |
966 | objectName: "callWait" |
967 | text: i18n.tr("Call waiting") |
968 | progression: true |
969 | - onClicked: pageStack.push(Qt.resolvedUrl("CallWaiting.qml"), {sim: sim}) |
970 | + onClicked: pageStack.addPageToNextColumn(root, |
971 | + Qt.resolvedUrl("CallWaiting.qml"), {sim: sim}) |
972 | } |
973 | |
974 | ListItem.SingleValue { |
975 | @@ -42,7 +43,8 @@ |
976 | showDivider: false |
977 | progression: true |
978 | value: sim.getCallForwardingSummary() |
979 | - onClicked: pageStack.push(Qt.resolvedUrl("CallForwarding.qml"), {sim: sim}) |
980 | + onClicked: pageStack.addPageToNextColumn(root, |
981 | + Qt.resolvedUrl("CallForwarding.qml"), {sim: sim}) |
982 | } |
983 | |
984 | ListItem.Divider {} |
985 | @@ -65,7 +67,8 @@ |
986 | } |
987 | return sim.simMng.present && nums; |
988 | } |
989 | - onClicked: pageStack.push(Qt.resolvedUrl("Services.qml"), |
990 | - {carrierString: carrierString, sim: sim.simMng}) |
991 | + onClicked: pageStack.addPageToNextColumn(root, |
992 | + Qt.resolvedUrl("Services.qml"), |
993 | + {carrierString: carrierString, sim: sim.simMng}) |
994 | } |
995 | } |
996 | |
997 | === modified file 'plugins/security-privacy/AppAccess.qml' |
998 | --- plugins/security-privacy/AppAccess.qml 2016-07-14 13:51:56 +0000 |
999 | +++ plugins/security-privacy/AppAccess.qml 2016-12-09 15:19:40 +0000 |
1000 | @@ -27,23 +27,30 @@ |
1001 | ItemPage { |
1002 | id: root |
1003 | title: i18n.tr("App permissions") |
1004 | + flickable: scrollWidget |
1005 | |
1006 | - function openService(service) { |
1007 | - for (var i = 0; i < appsModel.count; i++) { |
1008 | - var item = appsModel.get(i) |
1009 | - if (item.service === service) { |
1010 | - var model = trustStoreModelComponent.createObject(null, { serviceName: item.trustStoreService }) |
1011 | - pageStack.push(Qt.resolvedUrl("AppAccessControl.qml"), { |
1012 | - "title": i18n.tr(item.name), |
1013 | - "caption": i18n.tr(item.caption), |
1014 | - "model": model |
1015 | - }) |
1016 | - return; |
1017 | + onPushedOntoStack: { |
1018 | + var service; |
1019 | + if (pluginOptions && pluginOptions['service']) { |
1020 | + service = pluginOptions['service']; |
1021 | + for (var i = 0; i < appsModel.count; i++) { |
1022 | + var item = appsModel.get(i) |
1023 | + if (item.service === service) { |
1024 | + var model = trustStoreModelComponent.createObject(null, { serviceName: item.trustStoreService }) |
1025 | + pageStack.addPageToNextColumn( |
1026 | + root, Qt.resolvedUrl("AppAccessControl.qml"), { |
1027 | + "title": i18n.tr(item.name), |
1028 | + "caption": i18n.tr(item.caption), |
1029 | + "model": model, |
1030 | + }); |
1031 | + return; |
1032 | + } |
1033 | } |
1034 | } |
1035 | } |
1036 | |
1037 | Flickable { |
1038 | + id: scrollWidget |
1039 | anchors.fill: parent |
1040 | contentHeight: contentItem.childrenRect.height |
1041 | boundsBehavior: (contentHeight > root.height) ? |
1042 | @@ -99,7 +106,7 @@ |
1043 | value: trustStoreModel.count > 0 ? |
1044 | i18n.tr("%1/%2").arg(trustStoreModel.grantedCount).arg(trustStoreModel.count) : |
1045 | i18n.tr("0") |
1046 | - onClicked: pageStack.push(Qt.resolvedUrl("AppAccessControl.qml"), { |
1047 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("AppAccessControl.qml"), { |
1048 | "title": i18n.tr(model.name), |
1049 | "caption": i18n.tr(model.caption), |
1050 | "model": trustStoreModel, |
1051 | @@ -125,7 +132,7 @@ |
1052 | if (oaPlugin) { |
1053 | var accountsPage = oaPlugin.pageComponent |
1054 | if (accountsPage) |
1055 | - pageStack.push(accountsPage, {plugin: oaPlugin, pluginManager: pluginManager}) |
1056 | + pageStack.addPageToNextColumn(root, accountsPage, {plugin: oaPlugin, pluginManager: pluginManager}) |
1057 | else |
1058 | console.warn("online-accounts") |
1059 | } else { |
1060 | |
1061 | === modified file 'plugins/security-privacy/AppAccessControl.qml' |
1062 | --- plugins/security-privacy/AppAccessControl.qml 2016-07-14 13:51:56 +0000 |
1063 | +++ plugins/security-privacy/AppAccessControl.qml 2016-12-09 15:19:40 +0000 |
1064 | @@ -25,11 +25,13 @@ |
1065 | |
1066 | ItemPage { |
1067 | id: root |
1068 | + flickable: scrollWidget |
1069 | |
1070 | property alias model: repeater.model |
1071 | property alias caption: captionLabel.text |
1072 | |
1073 | Flickable { |
1074 | + id: scrollWidget |
1075 | anchors.fill: parent |
1076 | contentHeight: contentItem.childrenRect.height |
1077 | boundsBehavior: (contentHeight > root.height) ? |
1078 | |
1079 | === modified file 'plugins/security-privacy/Location.qml' |
1080 | --- plugins/security-privacy/Location.qml 2016-07-14 13:51:56 +0000 |
1081 | +++ plugins/security-privacy/Location.qml 2016-12-09 15:19:40 +0000 |
1082 | @@ -153,7 +153,7 @@ |
1083 | verticalAlignment: Text.AlignVCenter |
1084 | height: contentHeight + units.gu(4) |
1085 | onLinkActivated: { |
1086 | - pageStack.push(Qt.resolvedUrl(link)) |
1087 | + pageStack.addPageToNextColumn(locationPage, Qt.resolvedUrl(link)) |
1088 | } |
1089 | onLineLaidOut: { |
1090 | dlgt.height = label.height |
1091 | |
1092 | === modified file 'plugins/security-privacy/PageComponent.qml' |
1093 | --- plugins/security-privacy/PageComponent.qml 2016-11-21 14:47:12 +0000 |
1094 | +++ plugins/security-privacy/PageComponent.qml 2016-12-09 15:19:40 +0000 |
1095 | @@ -56,40 +56,28 @@ |
1096 | }); |
1097 | return t; |
1098 | } |
1099 | - property var pluginOptions |
1100 | - Connections { |
1101 | - target: pageStack |
1102 | - onCurrentPageChanged: { |
1103 | - // If we are called with subpage=foo, push foo on the stack. |
1104 | - // |
1105 | - // We need to wait until the PageComponent has been pushed to the stack |
1106 | - // before pushing the subpages, otherwise they will be pushed below the |
1107 | - // PageComponent. |
1108 | - if (pageStack.currentPage === root) { |
1109 | - if (pluginOptions && pluginOptions['subpage']) { |
1110 | - switch (pluginOptions['subpage']) { |
1111 | - case 'location': |
1112 | - pageStack.push(Qt.resolvedUrl("Location.qml")); |
1113 | - break; |
1114 | - case 'permissions': |
1115 | - var page = pageStack.push(Qt.resolvedUrl("AppAccess.qml"), {pluginManager: pluginManager}) |
1116 | - if (pluginOptions['service']) { |
1117 | - page.openService(pluginOptions['service']) |
1118 | - } |
1119 | - break; |
1120 | - } |
1121 | - } else if (pluginOptions && pluginOptions['service']) { |
1122 | - // This whole else if branch will be removed once the |
1123 | - // camera app asks for [1] as described in lp:1545733. |
1124 | - // [1] settings:///system/permissions?service=camera |
1125 | - var page = pageStack.push(Qt.resolvedUrl("AppAccess.qml"), {pluginManager: pluginManager}) |
1126 | - page.openService(pluginOptions['service']) |
1127 | - } |
1128 | |
1129 | - // Once done, disable this Connections, so that if the user navigates |
1130 | - // back to the root we won't push the subpages again |
1131 | - target = null |
1132 | + onPushedOntoStack: { |
1133 | + var page; |
1134 | + var opts = { |
1135 | + pluginManager: pluginManager, pluginOptions: pluginOptions,}; |
1136 | + if (pluginOptions && pluginOptions['subpage']) { |
1137 | + switch (pluginOptions['subpage']) { |
1138 | + case 'location': |
1139 | + page = Qt.resolvedUrl("Location.qml"); |
1140 | + break; |
1141 | + case 'permissions': |
1142 | + page = Qt.resolvedUrl("AppAccess.qml") |
1143 | + break; |
1144 | } |
1145 | + } else if (pluginOptions && pluginOptions['service']) { |
1146 | + // This whole else if branch will be removed once the |
1147 | + // camera app asks for [1] as described in lp:1545733. |
1148 | + // [1] settings:///system/permissions?service=camera |
1149 | + page = Qt.resolvedUrl("AppAccess.qml"); |
1150 | + } |
1151 | + if (page) { |
1152 | + pageStack.addPageToNextColumn(root, page, opts); |
1153 | } |
1154 | } |
1155 | |
1156 | @@ -158,7 +146,7 @@ |
1157 | id: fingerprintControl |
1158 | objectName: "fingerprintControl" |
1159 | text: i18n.tr("Fingerprint ID") |
1160 | - onClicked: pageStack.push(fingeprintPage, { |
1161 | + onClicked: pageStack.addPageToNextColumn(root, fingeprintPage, { |
1162 | passcodeSet: securityPrivacy.securityType !== UbuntuSecurityPrivacyPanel.Swipe |
1163 | }) |
1164 | visible: Biometryd.available |
1165 | @@ -168,8 +156,8 @@ |
1166 | id: fingeprintPage |
1167 | Fingerprints { |
1168 | onRequestPasscode: { |
1169 | - pageStack.pop(); |
1170 | - pageStack.push(Qt.resolvedUrl("LockSecurity.qml")); |
1171 | + pageStack.removePages(root); |
1172 | + pageStack.addPageToNextColumn(root, Qt.resolvedUrl("LockSecurity.qml")); |
1173 | } |
1174 | } |
1175 | } |
1176 | @@ -178,7 +166,7 @@ |
1177 | id: lockingControl |
1178 | objectName: "lockingControl" |
1179 | text: i18n.tr("Locking and unlocking") |
1180 | - onClicked: pageStack.push(Qt.resolvedUrl("PhoneLocking.qml"), { |
1181 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("PhoneLocking.qml"), { |
1182 | usePowerd: usePowerd, |
1183 | powerSettings: powerSettings |
1184 | }) |
1185 | @@ -198,7 +186,7 @@ |
1186 | return i18n.tr("Off"); |
1187 | } |
1188 | visible: simsPresent > 0 |
1189 | - onClicked: pageStack.push(Qt.resolvedUrl("SimPin.qml"), { sims: sims }) |
1190 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("SimPin.qml"), { sims: sims }) |
1191 | } |
1192 | |
1193 | SettingsListItems.Standard { |
1194 | @@ -257,7 +245,7 @@ |
1195 | objectName: "locationItem" |
1196 | text: i18n.tr("Location") |
1197 | value: "" |
1198 | - onClicked: pageStack.push(Qt.resolvedUrl("Location.qml")) |
1199 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("Location.qml")) |
1200 | visible: true |
1201 | enabled: true |
1202 | property variant locationEnabled |
1203 | @@ -275,7 +263,7 @@ |
1204 | |
1205 | SettingsListItems.SingleValueProgression { |
1206 | text: i18n.tr("App permissions") |
1207 | - onClicked: pageStack.push(Qt.resolvedUrl("AppAccess.qml"), {pluginManager: pluginManager}) |
1208 | + onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("AppAccess.qml"), {pluginManager: pluginManager}) |
1209 | } |
1210 | |
1211 | SettingsListItems.SingleValueProgression { |
1212 | @@ -289,7 +277,7 @@ |
1213 | i18n.tr("Not sent") |
1214 | onClicked: { |
1215 | var path = "../diagnostics/PageComponent.qml"; |
1216 | - pageStack.push(Qt.resolvedUrl(path)); |
1217 | + pageStack.addPageToNextColumn(root, Qt.resolvedUrl(path)); |
1218 | } |
1219 | } |
1220 | } |
1221 | |
1222 | === modified file 'plugins/security-privacy/PhoneLocking.qml' |
1223 | --- plugins/security-privacy/PhoneLocking.qml 2016-07-14 13:51:56 +0000 |
1224 | +++ plugins/security-privacy/PhoneLocking.qml 2016-12-09 15:19:40 +0000 |
1225 | @@ -30,6 +30,7 @@ |
1226 | id: root |
1227 | objectName: "phoneLockingPage" |
1228 | title: i18n.tr("Locking and unlocking") |
1229 | + flickable: scrollWidget |
1230 | |
1231 | property bool usePowerd |
1232 | property var powerSettings |
1233 | @@ -39,6 +40,7 @@ |
1234 | } |
1235 | |
1236 | Flickable { |
1237 | + id: scrollWidget |
1238 | anchors.fill: parent |
1239 | contentHeight: contentItem.childrenRect.height |
1240 | boundsBehavior: (contentHeight > root.height) ? |
1241 | @@ -75,7 +77,8 @@ |
1242 | return fingerprint |
1243 | } |
1244 | } |
1245 | - onClicked: pageStack.push(Qt.resolvedUrl("LockSecurity.qml")) |
1246 | + onClicked: pageStack.addPageToNextColumn( |
1247 | + root, Qt.resolvedUrl("LockSecurity.qml")) |
1248 | } |
1249 | |
1250 | SettingsListItems.SingleValueProgression { |
1251 | @@ -110,7 +113,7 @@ |
1252 | } |
1253 | } |
1254 | onClicked: |
1255 | - pageStack.push( |
1256 | + pageStack.addPageToNextColumn(root, |
1257 | Qt.resolvedUrl("../battery/SleepValues.qml"), |
1258 | { title: text, lockOnSuspend: lockOnSuspend } ) |
1259 | } |
1260 | |
1261 | === modified file 'plugins/security-privacy/SimPin.qml' |
1262 | --- plugins/security-privacy/SimPin.qml 2016-07-14 13:51:56 +0000 |
1263 | +++ plugins/security-privacy/SimPin.qml 2016-12-09 15:19:40 +0000 |
1264 | @@ -35,6 +35,7 @@ |
1265 | id: root |
1266 | objectName: "simPinPage" |
1267 | title: i18n.tr("SIM PIN") |
1268 | + flickable: scrollWidget |
1269 | |
1270 | property var sims |
1271 | property var curSim |
1272 | @@ -345,6 +346,7 @@ |
1273 | } |
1274 | |
1275 | Flickable { |
1276 | + id: scrollWidget |
1277 | anchors.fill: parent |
1278 | contentHeight: contentItem.childrenRect.height |
1279 | boundsBehavior: (contentHeight > root.height) ? |
1280 | |
1281 | === modified file 'plugins/security-privacy/here-terms.qml' |
1282 | --- plugins/security-privacy/here-terms.qml 2015-08-10 13:31:45 +0000 |
1283 | +++ plugins/security-privacy/here-terms.qml 2016-12-09 15:19:40 +0000 |
1284 | @@ -22,6 +22,7 @@ |
1285 | |
1286 | ItemPage { |
1287 | title: i18n.tr("Nokia HERE") |
1288 | + flickable: scrollWidget |
1289 | id: termsPage |
1290 | |
1291 | UbuntuSecurityPrivacyPanel { |
1292 | |
1293 | === modified file 'plugins/sound/PageComponent.qml' |
1294 | --- plugins/sound/PageComponent.qml 2016-11-21 15:23:50 +0000 |
1295 | +++ plugins/sound/PageComponent.qml 2016-12-09 15:19:40 +0000 |
1296 | @@ -149,7 +149,7 @@ |
1297 | text: i18n.tr("Ringtone") |
1298 | value: Utilities.buildDisplayName(backendInfo.incomingCallSound) |
1299 | |
1300 | - onClicked: pageStack.push( |
1301 | + onClicked: pageStack.addPageToNextColumn(root, |
1302 | Qt.resolvedUrl("SoundsList.qml"), { |
1303 | title: i18n.tr("Ringtone"), |
1304 | showStopButton: true, |
1305 | @@ -209,12 +209,13 @@ |
1306 | text: i18n.tr("Message received") |
1307 | value:Utilities.buildDisplayName( |
1308 | backendInfo.incomingMessageSound) |
1309 | - onClicked: pageStack.push( |
1310 | - Qt.resolvedUrl("SoundsList.qml"), |
1311 | - { title: i18n.tr("Message received"), |
1312 | - soundType: 1, |
1313 | - soundsDir: |
1314 | - "sounds/ubuntu/notifications/" }) |
1315 | + onClicked: pageStack.addPageToNextColumn(root, |
1316 | + Qt.resolvedUrl("SoundsList.qml"), { |
1317 | + title: i18n.tr("Message received"), |
1318 | + soundType: 1, |
1319 | + soundsDir: "sounds/ubuntu/notifications/" |
1320 | + } |
1321 | + ) |
1322 | } |
1323 | |
1324 | SettingsListItems.Standard { |
1325 | |
1326 | === modified file 'plugins/sound/SoundsList.qml' |
1327 | --- plugins/sound/SoundsList.qml 2016-09-19 14:53:19 +0000 |
1328 | +++ plugins/sound/SoundsList.qml 2016-12-09 15:19:40 +0000 |
1329 | @@ -128,9 +128,7 @@ |
1330 | text: i18n.tr("Custom Ringtone") |
1331 | visible: soundType === 0 |
1332 | progression: true |
1333 | - onClicked: { |
1334 | - pageStack.push(picker); |
1335 | - } |
1336 | + onClicked: pageStack.addPageToNextColumn(soundsPage, picker) |
1337 | } |
1338 | } |
1339 | } |
1340 | @@ -215,7 +213,7 @@ |
1341 | showTitle: false |
1342 | |
1343 | onPeerSelected: { |
1344 | - pageStack.pop(); |
1345 | + pageStack.removePages(soundsPage); |
1346 | // requests an active transfer from peer |
1347 | function startContentTransfer(callback) { |
1348 | if (callback) |
1349 | @@ -231,7 +229,7 @@ |
1350 | }); |
1351 | } |
1352 | |
1353 | - onCancelPressed: pageStack.pop(); |
1354 | + onCancelPressed: pageStack.removePages(soundsPage); |
1355 | } |
1356 | } |
1357 | |
1358 | |
1359 | === modified file 'plugins/system-update/EntryComponent.qml' |
1360 | --- plugins/system-update/EntryComponent.qml 2016-08-11 13:05:45 +0000 |
1361 | +++ plugins/system-update/EntryComponent.qml 2016-12-09 15:19:40 +0000 |
1362 | @@ -30,8 +30,11 @@ |
1363 | var imageUpdateCount = SystemImage.checkTarget() ? 1 : 0; |
1364 | return updatesRep.count + imageUpdateCount; |
1365 | } |
1366 | - height: updatesAvailable > 0 ? layout.height : 0 |
1367 | + height: (updatesAvailable > 0) || showAllUI ? layout.height : 0 |
1368 | onClicked: main.loadPluginByName("system-update"); |
1369 | + divider.colorFrom: "#EEEEEE" |
1370 | + divider.colorTo: "#EEEEEE" |
1371 | + divider.height: units.dp(1) |
1372 | |
1373 | ListItemLayout { |
1374 | id: layout |
1375 | @@ -40,7 +43,7 @@ |
1376 | SlotsLayout.position: SlotsLayout.Leading; |
1377 | SlotsLayout.padding { top: 0; bottom: 0 } |
1378 | source: model.icon |
1379 | - height: units.gu(5) |
1380 | + height: units.gu(2.5) |
1381 | } |
1382 | Label { |
1383 | text: updatesAvailable > 0 ? updatesAvailable : "" |
1384 | |
1385 | === modified file 'plugins/system-update/PageComponent.qml' |
1386 | --- plugins/system-update/PageComponent.qml 2016-08-23 11:48:49 +0000 |
1387 | +++ plugins/system-update/PageComponent.qml 2016-12-09 15:19:40 +0000 |
1388 | @@ -421,7 +421,8 @@ |
1389 | return i18n.tr("Unknown") |
1390 | } |
1391 | progression: true |
1392 | - onClicked: pageStack.push(Qt.resolvedUrl("Configuration.qml")) |
1393 | + onClicked: pageStack.addPageToNextColumn( |
1394 | + root, Qt.resolvedUrl("Configuration.qml")) |
1395 | } |
1396 | } |
1397 | |
1398 | |
1399 | === modified file 'plugins/time-date/ChooseTimeZone.qml' |
1400 | --- plugins/time-date/ChooseTimeZone.qml 2016-07-14 13:51:56 +0000 |
1401 | +++ plugins/time-date/ChooseTimeZone.qml 2016-12-09 15:19:40 +0000 |
1402 | @@ -27,7 +27,7 @@ |
1403 | |
1404 | ItemPage { |
1405 | title: i18n.tr("Time zone") |
1406 | - |
1407 | + flickable: locationsListView |
1408 | property UbuntuTimeDatePanel timeDatePanel |
1409 | |
1410 | Timer { |
1411 | |
1412 | === modified file 'plugins/time-date/PageComponent.qml' |
1413 | --- plugins/time-date/PageComponent.qml 2016-07-14 13:51:56 +0000 |
1414 | +++ plugins/time-date/PageComponent.qml 2016-12-09 15:19:40 +0000 |
1415 | @@ -68,9 +68,11 @@ |
1416 | id: timeZone |
1417 | text: timeDatePanel.timeZoneName |
1418 | value: getUTCOffset() |
1419 | - onClicked: pageStack.push(Qt.resolvedUrl("ChooseTimeZone.qml"), { |
1420 | - timeDatePanel: timeDatePanel |
1421 | - }) |
1422 | + onClicked: pageStack.addPageToNextColumn(root, |
1423 | + Qt.resolvedUrl("ChooseTimeZone.qml"), { |
1424 | + timeDatePanel: timeDatePanel |
1425 | + } |
1426 | + ) |
1427 | } |
1428 | |
1429 | SettingsItemTitle { |
1430 | |
1431 | === modified file 'plugins/vpn/PageComponent.qml' |
1432 | --- plugins/vpn/PageComponent.qml 2016-03-14 12:15:41 +0000 |
1433 | +++ plugins/vpn/PageComponent.qml 2016-12-09 15:19:40 +0000 |
1434 | @@ -35,7 +35,7 @@ |
1435 | property var diag |
1436 | |
1437 | function openConnection(connection, isNew) { |
1438 | - pageStack.push(vpnEditorDialog, { |
1439 | + pageStack.addPageToNextColumn(root, vpnEditorDialog, { |
1440 | "connection": connection, |
1441 | "isNew": isNew |
1442 | }); |
1443 | |
1444 | === modified file 'plugins/wifi/AccessPoint.qml' |
1445 | --- plugins/wifi/AccessPoint.qml 2016-07-14 13:51:56 +0000 |
1446 | +++ plugins/wifi/AccessPoint.qml 2016-12-09 15:19:40 +0000 |
1447 | @@ -52,18 +52,12 @@ |
1448 | |
1449 | signal activate() |
1450 | |
1451 | - onCheckedChanged: { |
1452 | - // if stack has NetworkDetailsBrief, pop it |
1453 | - if (pageStack.depth === 3) { |
1454 | - pageStack.pop(); |
1455 | - } |
1456 | - } |
1457 | - |
1458 | progressionVisible: checked |
1459 | onClicked: { |
1460 | if (checked) { |
1461 | - pageStack.push(Qt.resolvedUrl("NetworkDetailsBrief.qml"), |
1462 | - {networkName : text, accessPoint: accessPoint}) |
1463 | + pageStack.addPageToNextColumn(wifibase, |
1464 | + Qt.resolvedUrl("NetworkDetailsBrief.qml"), |
1465 | + {networkName : text, accessPoint: accessPoint}) |
1466 | } else { |
1467 | accessPoint.activate(); |
1468 | } |
1469 | |
1470 | === modified file 'plugins/wifi/PageComponent.qml' |
1471 | --- plugins/wifi/PageComponent.qml 2016-09-27 13:41:19 +0000 |
1472 | +++ plugins/wifi/PageComponent.qml 2016-12-09 15:19:40 +0000 |
1473 | @@ -26,9 +26,10 @@ |
1474 | id: wifibase |
1475 | objectName: "wifiPage" |
1476 | title: i18n.tr("Wi-Fi") |
1477 | + flickable: pageFlickable |
1478 | + |
1479 | property bool wifiEnabled: actionGroup.actionObject.valid ? |
1480 | actionGroup.actionObject.state : false |
1481 | - property var pluginOptions |
1482 | |
1483 | UnityMenuModel { |
1484 | id: menuModel |
1485 | @@ -136,7 +137,8 @@ |
1486 | SettingsListItems.StandardProgression { |
1487 | objectName: "previousNetwork" |
1488 | text: i18n.tr("Previous networks") |
1489 | - onClicked: pageStack.push(Qt.resolvedUrl("PreviousNetworks.qml")) |
1490 | + onClicked: pageStack.addPageToNextColumn(wifibase, |
1491 | + Qt.resolvedUrl("PreviousNetworks.qml")) |
1492 | } |
1493 | |
1494 | Loader { |
1495 | |
1496 | === modified file 'plugins/wifi/PreviousNetworks.qml' |
1497 | --- plugins/wifi/PreviousNetworks.qml 2016-07-14 13:51:56 +0000 |
1498 | +++ plugins/wifi/PreviousNetworks.qml 2016-12-09 15:19:40 +0000 |
1499 | @@ -25,6 +25,7 @@ |
1500 | id: previousNetworks |
1501 | objectName: "previousNetworksPage" |
1502 | title: i18n.tr("Previous networks") |
1503 | + flickable: networkList |
1504 | |
1505 | PreviousNetworkModel { |
1506 | id: pnmodel |
1507 | @@ -56,11 +57,12 @@ |
1508 | } |
1509 | delegate: SettingsListItems.StandardProgression { |
1510 | text: name |
1511 | - onClicked: { |
1512 | - pageStack.push(Qt.resolvedUrl("NetworkDetails.qml"), |
1513 | - {networkName : name, password : password, lastUsed : lastUsed, |
1514 | - dbusPath : objectPath}); |
1515 | - } |
1516 | + onClicked: pageStack.addPageToNextColumn(previousNetworks, |
1517 | + Qt.resolvedUrl("NetworkDetails.qml"), { |
1518 | + networkName : name, password : password, |
1519 | + lastUsed : lastUsed, dbusPath : objectPath |
1520 | + } |
1521 | + ) |
1522 | } |
1523 | } |
1524 | } |
1525 | |
1526 | === modified file 'src/CMakeLists.txt' |
1527 | --- src/CMakeLists.txt 2016-11-14 15:37:20 +0000 |
1528 | +++ src/CMakeLists.txt 2016-12-09 15:19:40 +0000 |
1529 | @@ -23,7 +23,6 @@ |
1530 | ) |
1531 | |
1532 | set(QML_SOURCES |
1533 | - qml/CategoryGrid.qml |
1534 | qml/CategorySection.qml |
1535 | qml/EntryComponent.qml |
1536 | qml/MainWindow.qml |
1537 | |
1538 | === modified file 'src/SystemSettings/ItemPage.qml' |
1539 | --- src/SystemSettings/ItemPage.qml 2015-08-10 13:31:45 +0000 |
1540 | +++ src/SystemSettings/ItemPage.qml 2016-12-09 15:19:40 +0000 |
1541 | @@ -24,8 +24,27 @@ |
1542 | Page { |
1543 | id: root |
1544 | |
1545 | + property alias title: pageHeader.title |
1546 | + property alias flickable: pageHeader.flickable |
1547 | + |
1548 | + header: PageHeader { |
1549 | + id: pageHeader |
1550 | + title: i18n.dtr(plugin.translations, plugin.displayName) |
1551 | + } |
1552 | + |
1553 | property variant plugin |
1554 | property variant pluginManager |
1555 | - |
1556 | - title: i18n.dtr(plugin.translations, plugin.displayName) |
1557 | + property variant pluginOptions |
1558 | + |
1559 | + signal pushedOntoStack() |
1560 | + |
1561 | + Connections { |
1562 | + target: root |
1563 | + onVisibleChanged: { |
1564 | + if (visible) { |
1565 | + pushedOntoStack(); |
1566 | + target = null; |
1567 | + } |
1568 | + } |
1569 | + } |
1570 | } |
1571 | |
1572 | === removed file 'src/qml/CategoryGrid.qml' |
1573 | --- src/qml/CategoryGrid.qml 2016-07-14 13:51:56 +0000 |
1574 | +++ src/qml/CategoryGrid.qml 1970-01-01 00:00:00 +0000 |
1575 | @@ -1,90 +0,0 @@ |
1576 | -/* |
1577 | - * This file is part of system-settings |
1578 | - * |
1579 | - * Copyright (C) 2013-2016 Canonical Ltd. |
1580 | - * |
1581 | - * Contact: Ken VanDine <ken.vandine@canonical.com> |
1582 | - * |
1583 | - * This program is free software: you can redistribute it and/or modify it |
1584 | - * under the terms of the GNU General Public License version 3, as published |
1585 | - * by the Free Software Foundation. |
1586 | - * |
1587 | - * This program is distributed in the hope that it will be useful, but |
1588 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
1589 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
1590 | - * PURPOSE. See the GNU General Public License for more details. |
1591 | - * |
1592 | - * You should have received a copy of the GNU General Public License along |
1593 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
1594 | - */ |
1595 | - |
1596 | -import QtQuick 2.4 |
1597 | -import Ubuntu.Components 1.3 |
1598 | -import Ubuntu.Components.ListItems 1.3 as ListItem |
1599 | - |
1600 | -Column { |
1601 | - anchors { |
1602 | - left: parent.left |
1603 | - right: parent.right |
1604 | - } |
1605 | - spacing: units.gu(1) |
1606 | - |
1607 | - property string category |
1608 | - property string categoryName |
1609 | - |
1610 | - objectName: "categoryGrid-" + category |
1611 | - |
1612 | - ListItem.Standard { |
1613 | - id: header |
1614 | - |
1615 | - highlightWhenPressed: false |
1616 | - showDivider: false |
1617 | - text: categoryName |
1618 | - visible: repeater.count > 0 |
1619 | - } |
1620 | - |
1621 | - Grid { |
1622 | - property int itemWidth: units.gu(12) |
1623 | - |
1624 | - // The amount of whitespace, including column spacing |
1625 | - property int space: parent.width - columns * itemWidth |
1626 | - |
1627 | - // The column spacing is 1/n of the left/right margins |
1628 | - property int n: 4 |
1629 | - |
1630 | - columnSpacing: space / ((2 * n) + (columns - 1)) |
1631 | - rowSpacing: units.gu(3) |
1632 | - width: (columns * itemWidth) + columnSpacing * (columns - 1) |
1633 | - anchors.horizontalCenter: parent.horizontalCenter |
1634 | - columns: { |
1635 | - var items = Math.floor(parent.width / itemWidth) |
1636 | - var count = repeater.count |
1637 | - return count < items ? count : items |
1638 | - } |
1639 | - |
1640 | - Repeater { |
1641 | - id: repeater |
1642 | - |
1643 | - model: pluginManager.itemModel(category) |
1644 | - |
1645 | - delegate: Loader { |
1646 | - id: loader |
1647 | - width: parent.itemWidth |
1648 | - sourceComponent: model.item.entryComponent |
1649 | - active: model.item.visible |
1650 | - Connections { |
1651 | - ignoreUnknownSignals: true |
1652 | - target: loader.item |
1653 | - onClicked: { |
1654 | - var pageComponent = model.item.pageComponent |
1655 | - if (pageComponent) { |
1656 | - pageStack.push(model.item.pageComponent, |
1657 | - { plugin: model.item, pluginManager: pluginManager }) |
1658 | - } |
1659 | - } |
1660 | - } |
1661 | - } |
1662 | - } |
1663 | - } |
1664 | - ListItem.ThinDivider { visible: header.visible } |
1665 | -} |
1666 | |
1667 | === modified file 'src/qml/CategorySection.qml' |
1668 | --- src/qml/CategorySection.qml 2016-07-14 13:51:56 +0000 |
1669 | +++ src/qml/CategorySection.qml 2016-12-09 15:19:40 +0000 |
1670 | @@ -68,11 +68,23 @@ |
1671 | onClicked: { |
1672 | var pageComponent = model.item.pageComponent |
1673 | if (pageComponent) { |
1674 | - pageStack.push(model.item.pageComponent, |
1675 | - { plugin: model.item, pluginManager: pluginManager }) |
1676 | + Haptics.play(); |
1677 | + loadPluginByName(model.item.baseName); |
1678 | } |
1679 | } |
1680 | } |
1681 | + Binding { |
1682 | + target: loader.item |
1683 | + property: "color" |
1684 | + value: theme.palette.highlighted.background |
1685 | + when: currentPlugin == model.item.baseName && apl.columns > 1 |
1686 | + } |
1687 | + Binding { |
1688 | + target: loader.item |
1689 | + property: "color" |
1690 | + value: "transparent" |
1691 | + when: currentPlugin != model.item.baseName || apl.columns == 1 |
1692 | + } |
1693 | } |
1694 | } |
1695 | } |
1696 | |
1697 | === modified file 'src/qml/EntryComponent.qml' |
1698 | --- src/qml/EntryComponent.qml 2016-07-06 15:40:02 +0000 |
1699 | +++ src/qml/EntryComponent.qml 2016-12-09 15:19:40 +0000 |
1700 | @@ -1,7 +1,7 @@ |
1701 | /* |
1702 | * This file is part of system-settings |
1703 | * |
1704 | - * Copyright (C) 2013 Canonical Ltd. |
1705 | + * Copyright (C) 2013-2016 Canonical Ltd. |
1706 | * |
1707 | * Contact: Alberto Mardegan <alberto.mardegan@canonical.com> |
1708 | * |
1709 | @@ -19,58 +19,14 @@ |
1710 | */ |
1711 | |
1712 | import QtQuick 2.4 |
1713 | +import SystemSettings.ListItems 1.0 as SettingsListItems |
1714 | import Ubuntu.Components 1.3 |
1715 | -import Ubuntu.Settings.Components 0.1 |
1716 | |
1717 | -Item { |
1718 | +SettingsListItems.IconProgression { |
1719 | id: root |
1720 | |
1721 | - signal clicked |
1722 | - |
1723 | - height: button.height |
1724 | - |
1725 | objectName: "entryComponent-" + model.item.baseName |
1726 | |
1727 | - AbstractButton { |
1728 | - id: button |
1729 | - anchors.left: parent.left |
1730 | - anchors.right: parent.right |
1731 | - onClicked: root.clicked() |
1732 | - |
1733 | - height: col.height |
1734 | - |
1735 | - Column { |
1736 | - id: col |
1737 | - anchors.left: parent.left |
1738 | - anchors.right: parent.right |
1739 | - |
1740 | - Icon { |
1741 | - id: icon |
1742 | - anchors.horizontalCenter: parent.horizontalCenter |
1743 | - width: height |
1744 | - height: units.gu(4) |
1745 | - source: model.icon |
1746 | - } |
1747 | - |
1748 | - Label { |
1749 | - anchors.horizontalCenter: parent.horizontalCenter |
1750 | - text: i18n.dtr(model.item.translations, model.displayName) |
1751 | - width: col.width |
1752 | - horizontalAlignment: Text.AlignHCenter |
1753 | - fontSize: "small" |
1754 | - wrapMode: Text.WrapAtWordBoundaryOrAnywhere |
1755 | - } |
1756 | - } |
1757 | - } |
1758 | - |
1759 | - UbuntuShape { |
1760 | - z: -1 |
1761 | - visible: button.pressed |
1762 | - anchors{ |
1763 | - fill: root |
1764 | - margins: -units.gu(0.25) |
1765 | - } |
1766 | - backgroundColor: UbuntuColors.darkGrey |
1767 | - opacity: 0.15 |
1768 | - } |
1769 | + text: i18n.dtr(model.item.translations, model.displayName) |
1770 | + iconSource: model.icon |
1771 | } |
1772 | |
1773 | === modified file 'src/qml/MainWindow.qml' |
1774 | --- src/qml/MainWindow.qml 2016-07-14 13:51:56 +0000 |
1775 | +++ src/qml/MainWindow.qml 2016-12-09 15:19:40 +0000 |
1776 | @@ -19,18 +19,20 @@ |
1777 | */ |
1778 | |
1779 | import QtQuick 2.4 |
1780 | +import SystemSettings 1.0 |
1781 | import SystemSettings.ListItems 1.0 as SettingsListItems |
1782 | import Ubuntu.Components 1.3 |
1783 | -import SystemSettings 1.0 |
1784 | |
1785 | MainView { |
1786 | id: main |
1787 | - implicitWidth: units.gu(50) |
1788 | + implicitWidth: units.gu(140) |
1789 | implicitHeight: units.gu(90) |
1790 | applicationName: "ubuntu-system-settings" |
1791 | objectName: "systemSettingsMainView" |
1792 | automaticOrientation: true |
1793 | anchorToKeyboard: true |
1794 | + property string currentPlugin: "" |
1795 | + property var pluginManager: PluginManager {} |
1796 | |
1797 | function loadPluginByName(pluginName, pluginOptions) { |
1798 | var plugin = pluginManager.getByName(pluginName) |
1799 | @@ -43,10 +45,24 @@ |
1800 | if (plugin) { |
1801 | // Got a valid plugin name - load it |
1802 | var pageComponent = plugin.pageComponent |
1803 | + var incubator; |
1804 | if (pageComponent) { |
1805 | - while (pageStack.depth > 1) |
1806 | - pageStack.pop() |
1807 | - pageStack.push(pageComponent, opts) |
1808 | + apl.removePages(apl.primaryPage); |
1809 | + incubator = apl.addPageToNextColumn(apl.primaryPage, |
1810 | + pageComponent, opts); |
1811 | + if (incubator && incubator.status == Component.Loading) { |
1812 | + incubator.onStatusChanged = function(status) { |
1813 | + if (status == Component.Ready) { |
1814 | + incubator.object.Component.destruction.connect(function() { |
1815 | + if (currentPlugin == this.baseName) { |
1816 | + currentPlugin = ""; |
1817 | + } |
1818 | + |
1819 | + }.bind(this)); |
1820 | + currentPlugin = this.baseName; |
1821 | + } |
1822 | + }.bind(plugin); |
1823 | + } |
1824 | } |
1825 | return true |
1826 | } else { |
1827 | @@ -59,7 +75,6 @@ |
1828 | Component.onCompleted: { |
1829 | i18n.domain = "ubuntu-system-settings" |
1830 | i18n.bindtextdomain("ubuntu-system-settings", i18nDirectory) |
1831 | - pageStack.push(mainPage) |
1832 | if (defaultPlugin) { |
1833 | if (!loadPluginByName(defaultPlugin, pluginOptions)) |
1834 | Qt.quit() |
1835 | @@ -67,7 +82,7 @@ |
1836 | |
1837 | // when running in windowed mode, constrain width |
1838 | view.minimumWidth = Qt.binding( function() { return units.gu(40) } ) |
1839 | - view.maximumWidth = Qt.binding( function() { return units.gu(50) } ) |
1840 | + view.maximumWidth = Qt.binding( function() { return units.gu(140) } ) |
1841 | } |
1842 | |
1843 | Connections { |
1844 | @@ -99,34 +114,93 @@ |
1845 | } else { |
1846 | loadPluginByName(panel) |
1847 | } |
1848 | - |
1849 | } |
1850 | } |
1851 | |
1852 | - PluginManager { |
1853 | - id: pluginManager |
1854 | - } |
1855 | - |
1856 | - PageStack { |
1857 | - id: pageStack |
1858 | + AdaptivePageLayout { |
1859 | + id: apl |
1860 | + objectName: "apl" |
1861 | + anchors.fill: parent |
1862 | + primaryPage: mainPage |
1863 | + layouts: [ |
1864 | + PageColumnsLayout { |
1865 | + when: width >= units.gu(90) |
1866 | + PageColumn { |
1867 | + minimumWidth: units.gu(40) |
1868 | + maximumWidth: units.gu(50) |
1869 | + preferredWidth: units.gu(50) |
1870 | + } |
1871 | + PageColumn { |
1872 | + fillWidth: true |
1873 | + } |
1874 | + }, |
1875 | + PageColumnsLayout { |
1876 | + when: true |
1877 | + PageColumn { |
1878 | + fillWidth: true |
1879 | + minimumWidth: units.gu(40) |
1880 | + } |
1881 | + } |
1882 | + ] |
1883 | |
1884 | Page { |
1885 | id: mainPage |
1886 | objectName: "systemSettingsPage" |
1887 | - title: i18n.tr("System Settings") |
1888 | visible: false |
1889 | - flickable: mainFlickable |
1890 | - |
1891 | - head.actions: [ |
1892 | - Action { |
1893 | - objectName: "searchAction" |
1894 | - iconName: "find" |
1895 | - onTriggered: { |
1896 | - pluginManager.filter = ""; |
1897 | - search.visible = !search.visible; |
1898 | - } |
1899 | + header: standardHeader |
1900 | + |
1901 | + PageHeader { |
1902 | + id: standardHeader |
1903 | + objectName: "standardHeader" |
1904 | + visible: mainPage.header === standardHeader |
1905 | + title: i18n.tr("System Settings") |
1906 | + flickable: mainFlickable |
1907 | + trailingActionBar.actions: [ |
1908 | + Action { |
1909 | + objectName: "searchAction" |
1910 | + iconName: "find" |
1911 | + shortcut: StandardKey.Find |
1912 | + onTriggered: { |
1913 | + pluginManager.filter = ""; |
1914 | + mainPage.header = searchHeader; |
1915 | + } |
1916 | + } |
1917 | + ] |
1918 | + } |
1919 | + |
1920 | + PageHeader { |
1921 | + id: searchHeader |
1922 | + objectName: "searchHeader" |
1923 | + visible: mainPage.header === searchHeader |
1924 | + flickable: mainFlickable |
1925 | + contents: TextField { |
1926 | + id: searchField |
1927 | + objectName: "searchField" |
1928 | + anchors { |
1929 | + left: parent.left |
1930 | + right: parent.right |
1931 | + verticalCenter: parent.verticalCenter |
1932 | + } |
1933 | + inputMethodHints: Qt.ImhNoPredictiveText |
1934 | + onDisplayTextChanged: pluginManager.filter = displayText |
1935 | + placeholderText: i18n.tr("Search") |
1936 | + hasClearButton: false |
1937 | } |
1938 | - ] |
1939 | + onVisibleChanged: if (visible) searchField.forceActiveFocus() |
1940 | + trailingActionBar.actions: [ |
1941 | + Action { |
1942 | + objectName: "searchCancel" |
1943 | + iconName: "close" |
1944 | + shortcut: StandardKey.Cancel |
1945 | + onTriggered: { |
1946 | + pluginManager.filter = ""; |
1947 | + searchField.text = ""; |
1948 | + mainPage.header = standardHeader; |
1949 | + } |
1950 | + } |
1951 | + ] |
1952 | + z: 1 |
1953 | + } |
1954 | |
1955 | Flickable { |
1956 | id: mainFlickable |
1957 | @@ -141,36 +215,21 @@ |
1958 | anchors.left: parent.left |
1959 | anchors.right: parent.right |
1960 | |
1961 | - SettingsListItems.SingleControl { |
1962 | - id: search |
1963 | - visible: false |
1964 | - TextField { |
1965 | - id: searchField |
1966 | - width: parent.width - units.gu(4) |
1967 | - placeholderText: i18n.tr("Search") |
1968 | - objectName: "searchTextField" |
1969 | - inputMethodHints: Qt.ImhNoPredictiveText |
1970 | - onDisplayTextChanged: |
1971 | - pluginManager.filter = displayText |
1972 | - } |
1973 | - onVisibleChanged: if (visible) searchField.forceActiveFocus() |
1974 | - } |
1975 | - |
1976 | UncategorizedItemsView { |
1977 | model: pluginManager.itemModel("uncategorized-top") |
1978 | } |
1979 | |
1980 | - CategoryGrid { |
1981 | + CategorySection { |
1982 | category: "network" |
1983 | categoryName: i18n.tr("Network") |
1984 | } |
1985 | |
1986 | - CategoryGrid { |
1987 | + CategorySection { |
1988 | category: "personal" |
1989 | categoryName: i18n.tr("Personal") |
1990 | } |
1991 | |
1992 | - CategoryGrid { |
1993 | + CategorySection { |
1994 | category: "system" |
1995 | categoryName: i18n.tr("System") |
1996 | } |
1997 | |
1998 | === modified file 'src/qml/UncategorizedItemsView.qml' |
1999 | --- src/qml/UncategorizedItemsView.qml 2016-05-06 01:55:01 +0000 |
2000 | +++ src/qml/UncategorizedItemsView.qml 2016-12-09 15:19:40 +0000 |
2001 | @@ -33,7 +33,6 @@ |
2002 | |
2003 | Repeater { |
2004 | id: repeater |
2005 | - |
2006 | Column { |
2007 | anchors.left: parent.left |
2008 | anchors.right: parent.right |
2009 | @@ -51,12 +50,22 @@ |
2010 | var pageComponent = model.item.pageComponent |
2011 | if (pageComponent) { |
2012 | Haptics.play(); |
2013 | - pageStack.push(model.item.pageComponent, |
2014 | - { plugin: model.item, |
2015 | - pluginManager: pluginManager }) |
2016 | + loadPluginByName(model.item.baseName); |
2017 | } |
2018 | } |
2019 | } |
2020 | + Binding { |
2021 | + target: loader.item |
2022 | + property: "color" |
2023 | + value: theme.palette.highlighted.background |
2024 | + when: currentPlugin == model.item.baseName && apl.columns > 1 |
2025 | + } |
2026 | + Binding { |
2027 | + target: loader.item |
2028 | + property: "color" |
2029 | + value: "transparent" |
2030 | + when: currentPlugin != model.item.baseName || apl.columns == 1 |
2031 | + } |
2032 | } |
2033 | } |
2034 | } |
2035 | |
2036 | === modified file 'src/ui.qrc' |
2037 | --- src/ui.qrc 2016-07-06 15:40:02 +0000 |
2038 | +++ src/ui.qrc 2016-12-09 15:19:40 +0000 |
2039 | @@ -1,6 +1,5 @@ |
2040 | <!DOCTYPE RCC><RCC version="1.0"> |
2041 | <qresource> |
2042 | - <file>qml/CategoryGrid.qml</file> |
2043 | <file>qml/CategorySection.qml</file> |
2044 | <file>qml/EntryComponent.qml</file> |
2045 | <file>qml/MainWindow.qml</file> |
2046 | |
2047 | === modified file 'tests/CMakeLists.txt' |
2048 | --- tests/CMakeLists.txt 2016-10-27 10:29:59 +0000 |
2049 | +++ tests/CMakeLists.txt 2016-12-09 15:19:40 +0000 |
2050 | @@ -13,9 +13,11 @@ |
2051 | add_definitions(-DPLUGIN_MODULE_DIR="${CMAKE_CURRENT_BINARY_DIR}") |
2052 | add_definitions(-DMANIFEST_DIR="data") |
2053 | add_definitions(-DPLUGIN_MANIFEST_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data") |
2054 | +add_definitions(-DQML_TEST_DIR="${CMAKE_CURRENT_SOURCE_DIR}") |
2055 | add_definitions(-DQML_DIR="${CMAKE_CURRENT_BINARY_DIR}") |
2056 | add_definitions(-DPLUGIN_QML_DIR="${CMAKE_CURRENT_BINARY_DIR}") |
2057 | add_definitions(-DSYSTEM_IMAGE_DBUS_TEMPLATE="${CMAKE_SOURCE_DIR}/tests/autopilot/ubuntu_system_settings/tests/systemimage.py") |
2058 | +add_definitions(-DI18N_DOMAIN="ubuntu-system-settings") |
2059 | |
2060 | add_library(test-plugin SHARED test-plugin.cpp test-plugin.h) |
2061 | target_link_librarieS(test-plugin SystemSettings) |
2062 | |
2063 | === modified file 'tests/autopilot/ubuntu_system_settings/__init__.py' |
2064 | --- tests/autopilot/ubuntu_system_settings/__init__.py 2016-08-19 12:49:41 +0000 |
2065 | +++ tests/autopilot/ubuntu_system_settings/__init__.py 2016-12-09 15:19:40 +0000 |
2066 | @@ -155,13 +155,6 @@ |
2067 | self.scroll_to(obj) |
2068 | self.pointing_device.click_object(obj) |
2069 | |
2070 | - def click_header_action(self, action): |
2071 | - """Click the action 'action' on the header""" |
2072 | - main_view = self.get_root_instance().select_single( |
2073 | - objectName='systemSettingsMainView') |
2074 | - header = main_view.select_single('AppHeader') |
2075 | - header.click_action_button(action) |
2076 | - |
2077 | @property |
2078 | def system_settings_page(self): |
2079 | return self.select_single(objectName='systemSettingsPage') |
2080 | |
2081 | === modified file 'tests/autopilot/ubuntu_system_settings/tests/__init__.py' |
2082 | --- tests/autopilot/ubuntu_system_settings/tests/__init__.py 2016-09-27 13:41:19 +0000 |
2083 | +++ tests/autopilot/ubuntu_system_settings/tests/__init__.py 2016-12-09 15:19:40 +0000 |
2084 | @@ -612,6 +612,7 @@ |
2085 | class PhoneOfonoBaseTestCase(UbuntuSystemSettingsOfonoTestCase): |
2086 | def setUp(self): |
2087 | """ Go to Phone page """ |
2088 | + self.useFixture(EnvironmentVariable("USS_SHOW_ALL_UI", "1")) |
2089 | super(PhoneOfonoBaseTestCase, self).setUp() |
2090 | self.phone_page = self.main_view.go_to_phone_page() |
2091 | |
2092 | |
2093 | === removed file 'tests/autopilot/ubuntu_system_settings/tests/test_search.py' |
2094 | --- tests/autopilot/ubuntu_system_settings/tests/test_search.py 2016-07-14 13:51:56 +0000 |
2095 | +++ tests/autopilot/ubuntu_system_settings/tests/test_search.py 1970-01-01 00:00:00 +0000 |
2096 | @@ -1,55 +0,0 @@ |
2097 | -# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
2098 | -# Copyright 2013-2016 Canonical |
2099 | -# |
2100 | -# This program is free software: you can redistribute it and/or modify it |
2101 | -# under the terms of the GNU General Public License version 3, as published |
2102 | -# by the Free Software Foundation. |
2103 | - |
2104 | -from testtools.matchers import Equals |
2105 | -from autopilot.matchers import Eventually |
2106 | - |
2107 | -from ubuntu_system_settings.tests import UbuntuSystemSettingsTestCase |
2108 | -from ubuntu_system_settings.utils.i18n import ugettext as _ |
2109 | - |
2110 | - |
2111 | -""" Tests for Ubuntu System Settings """ |
2112 | - |
2113 | - |
2114 | -class SearchTestCases(UbuntuSystemSettingsTestCase): |
2115 | - """ Tests for Search """ |
2116 | - |
2117 | - def setUp(self): |
2118 | - super(SearchTestCases, self).setUp() |
2119 | - |
2120 | - def _get_entry_component(self, name): |
2121 | - return self.main_view.wait_select_single( |
2122 | - objectName='entryComponent-' + name |
2123 | - ) |
2124 | - |
2125 | - def _get_all_entry_components(self): |
2126 | - return self.main_view.select_many( |
2127 | - 'EntryComponent') |
2128 | - |
2129 | - def _type_into_search_box(self, text): |
2130 | - self.main_view.click_header_action('searchAction') |
2131 | - search_box = self.main_view.select_single( |
2132 | - objectName='searchTextField' |
2133 | - ) |
2134 | - self.main_view.scroll_to_and_click(search_box) |
2135 | - search_box.write(_(text)) |
2136 | - self.assertThat(search_box.text, Eventually(Equals(text))) |
2137 | - |
2138 | - def test_search_filter_results(self): |
2139 | - """ Checks whether Search box actually filters the results """ |
2140 | - self._type_into_search_box('WiFi') |
2141 | - wifi_icon = self._get_entry_component('wifi') |
2142 | - |
2143 | - self.assertThat(wifi_icon.visible, Eventually(Equals(True))) |
2144 | - self.assertThat( |
2145 | - lambda: len(self._get_all_entry_components()), |
2146 | - Eventually(Equals(1))) |
2147 | - |
2148 | - def test_search_filter_no_matches(self): |
2149 | - """ Checks that no results are returned if nothing matches """ |
2150 | - self._type_into_search_box('foobar') |
2151 | - self.assertEquals(len(self._get_all_entry_components()), 0) |
2152 | |
2153 | === modified file 'tests/mocks/CMakeLists.txt' |
2154 | --- tests/mocks/CMakeLists.txt 2016-11-11 15:20:42 +0000 |
2155 | +++ tests/mocks/CMakeLists.txt 2016-12-09 15:19:40 +0000 |
2156 | @@ -33,4 +33,5 @@ |
2157 | |
2158 | add_subdirectory(GSettings.1.0) |
2159 | add_subdirectory(QMenuModel) |
2160 | +add_subdirectory(SystemSettings) |
2161 | add_subdirectory(Ubuntu) |
2162 | |
2163 | === added directory 'tests/mocks/SystemSettings' |
2164 | === added file 'tests/mocks/SystemSettings/CMakeLists.txt' |
2165 | --- tests/mocks/SystemSettings/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
2166 | +++ tests/mocks/SystemSettings/CMakeLists.txt 2016-12-09 15:19:40 +0000 |
2167 | @@ -0,0 +1,20 @@ |
2168 | +include_directories( |
2169 | + ${CMAKE_CURRENT_BINARY_DIR} |
2170 | + ${Qt5Core_INCLUDE_DIRS} |
2171 | + ${Qt5Qml_INCLUDE_DIRS} |
2172 | +) |
2173 | + |
2174 | +set(USS_SOURCES |
2175 | + MockPluginManager.h |
2176 | + MockPluginManager.cpp |
2177 | + plugin.cpp |
2178 | +) |
2179 | + |
2180 | +add_library(MockSystemSettings SHARED ${USS_SOURCES}) |
2181 | +target_link_libraries(MockSystemSettings ${Qt5Core_LIBRARIES} ${Qt5Qml_LIBRARIES}) |
2182 | + |
2183 | +execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}) |
2184 | +configure_file(qmldir ${CMAKE_CURRENT_BINARY_DIR}/qmldir) |
2185 | + |
2186 | +execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/ListItems) |
2187 | +configure_file(ListItems/qmldir ${CMAKE_CURRENT_BINARY_DIR}/ListItems/qmldir) |
2188 | |
2189 | === added directory 'tests/mocks/SystemSettings/ListItems' |
2190 | === added file 'tests/mocks/SystemSettings/ListItems/qmldir' |
2191 | --- tests/mocks/SystemSettings/ListItems/qmldir 1970-01-01 00:00:00 +0000 |
2192 | +++ tests/mocks/SystemSettings/ListItems/qmldir 2016-12-09 15:19:40 +0000 |
2193 | @@ -0,0 +1,9 @@ |
2194 | +module SystemSettings.ListItems |
2195 | + |
2196 | +Icon 1.0 file://${CMAKE_SOURCE_DIR}/src/SystemSettings/ListItems/Icon.qml |
2197 | +IconProgression 1.0 file://${CMAKE_SOURCE_DIR}/src/SystemSettings/ListItems/IconProgression.qml |
2198 | +SingleControl 1.0 file://${CMAKE_SOURCE_DIR}/src/SystemSettings/ListItems/SingleControl.qml |
2199 | +SingleValue 1.0 file://${CMAKE_SOURCE_DIR}/src/SystemSettings/ListItems/SingleValue.qml |
2200 | +SingleValueProgression 1.0 file://${CMAKE_SOURCE_DIR}/src/SystemSettings/ListItems/SingleValueProgression.qml |
2201 | +Standard 1.0 file://${CMAKE_SOURCE_DIR}/src/SystemSettings/ListItems/Standard.qml |
2202 | +StandardProgression 1.0 file://${CMAKE_SOURCE_DIR}/src/SystemSettings/ListItems/StandardProgression.qml |
2203 | |
2204 | === added file 'tests/mocks/SystemSettings/MockPluginManager.cpp' |
2205 | --- tests/mocks/SystemSettings/MockPluginManager.cpp 1970-01-01 00:00:00 +0000 |
2206 | +++ tests/mocks/SystemSettings/MockPluginManager.cpp 2016-12-09 15:19:40 +0000 |
2207 | @@ -0,0 +1,159 @@ |
2208 | +/* |
2209 | + * This file is part of system-settings |
2210 | + * |
2211 | + * Copyright (C) 2016 Canonical Ltd. |
2212 | + * |
2213 | + * This program is free software: you can redistribute it and/or modify it |
2214 | + * under the terms of the GNU General Public License version 3, as published |
2215 | + * by the Free Software Foundation. |
2216 | + * |
2217 | + * This program is distributed in the hope that it will be useful, but |
2218 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
2219 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2220 | + * PURPOSE. See the GNU General Public License for more details. |
2221 | + * |
2222 | + * You should have received a copy of the GNU General Public License along |
2223 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
2224 | + */ |
2225 | + |
2226 | +#include "MockPluginManager.h" |
2227 | + |
2228 | +#include <QDebug> |
2229 | +#include <QQmlEngine> |
2230 | + |
2231 | +MockPluginManager::MockPluginManager(QObject *parent) : QObject(parent) |
2232 | +{ |
2233 | +} |
2234 | + |
2235 | +QObject* MockPluginManager::getByName(const QString &name) const |
2236 | +{ |
2237 | + MockItem* p = m_plugins.value(name); |
2238 | + QQmlEngine::setObjectOwnership(p, QQmlEngine::CppOwnership); |
2239 | + return p; |
2240 | +} |
2241 | + |
2242 | +QAbstractItemModel* MockPluginManager::itemModel(const QString &category) |
2243 | +{ |
2244 | + QAbstractItemModel* m = m_models.value(category); |
2245 | + QQmlEngine::setObjectOwnership(m, QQmlEngine::CppOwnership); |
2246 | + return m; |
2247 | +} |
2248 | + |
2249 | +void MockPluginManager::resetPlugins() |
2250 | +{ |
2251 | +} |
2252 | + |
2253 | +QString MockPluginManager::getFilter() |
2254 | +{ |
2255 | + return m_filter; |
2256 | +} |
2257 | + |
2258 | +void MockPluginManager::setFilter(const QString &filter) |
2259 | +{ |
2260 | + m_filter = filter; |
2261 | + Q_EMIT filterChanged(); |
2262 | +} |
2263 | + |
2264 | +void MockPluginManager::addPlugin(const QString &name, QQmlComponent *entry, |
2265 | + QQmlComponent *page, const QString &category) |
2266 | +{ |
2267 | + MockItemModel *model = nullptr; |
2268 | + if (m_models.contains(category)) { |
2269 | + model = (MockItemModel*) m_models.value(category); |
2270 | + } else { |
2271 | + model = new MockItemModel(this); |
2272 | + m_models.insert(category, model); |
2273 | + } |
2274 | + |
2275 | + MockItem* item = new MockItem(this); |
2276 | + item->setBaseName(name); |
2277 | + item->setEntryComponent(entry); |
2278 | + item->setPageComponent(page); |
2279 | + model->addPlugin(item); |
2280 | + m_plugins.insert(name, item); |
2281 | +} |
2282 | + |
2283 | +bool MockItem::visible() const |
2284 | +{ |
2285 | + return true; |
2286 | +} |
2287 | + |
2288 | +QString MockItem::baseName() const |
2289 | +{ |
2290 | + return m_baseName; |
2291 | +} |
2292 | + |
2293 | +void MockItem::setBaseName(const QString &baseName) |
2294 | +{ |
2295 | + m_baseName = baseName; |
2296 | +} |
2297 | + |
2298 | +QQmlComponent* MockItem::entryComponent() |
2299 | +{ |
2300 | + QQmlEngine::setObjectOwnership(m_entry, QQmlEngine::CppOwnership); |
2301 | + return m_entry; |
2302 | +} |
2303 | +QQmlComponent* MockItem::pageComponent() |
2304 | +{ |
2305 | + QQmlEngine::setObjectOwnership(m_page, QQmlEngine::CppOwnership); |
2306 | + return m_page; |
2307 | +} |
2308 | + |
2309 | +void MockItem::setEntryComponent(QQmlComponent* c) |
2310 | +{ |
2311 | + m_entry = c; |
2312 | +} |
2313 | + |
2314 | +void MockItem::setPageComponent(QQmlComponent* c) |
2315 | +{ |
2316 | + m_page = c; |
2317 | +} |
2318 | + |
2319 | +MockItemModel::MockItemModel(QObject *parent) : QAbstractListModel(parent) |
2320 | +{ |
2321 | +} |
2322 | + |
2323 | +void MockItemModel::addPlugin(MockItem *plugin) |
2324 | +{ |
2325 | + int row = m_plugins.size(); |
2326 | + beginInsertRows(QModelIndex(), row, row); |
2327 | + m_plugins.append(plugin); |
2328 | + endInsertRows(); |
2329 | +} |
2330 | + |
2331 | +int MockItemModel::rowCount(const QModelIndex &parent) const |
2332 | +{ |
2333 | + Q_UNUSED(parent); |
2334 | + return m_plugins.count(); |
2335 | +} |
2336 | + |
2337 | +QVariant MockItemModel::data(const QModelIndex &index, int role) const |
2338 | +{ |
2339 | + if (index.row() >= m_plugins.count()) return QVariant(); |
2340 | + |
2341 | + const MockItem *item = m_plugins.at(index.row()); |
2342 | + QVariant ret; |
2343 | + |
2344 | + switch (role) { |
2345 | + case Qt::DisplayRole: |
2346 | + ret = item->baseName(); |
2347 | + break; |
2348 | + case ItemRole: |
2349 | + ret = QVariant::fromValue<QObject*>(const_cast<MockItem*>(item)); |
2350 | + break; |
2351 | + } |
2352 | + |
2353 | + return ret; |
2354 | +} |
2355 | + |
2356 | +QHash<int, QByteArray> MockItemModel::roleNames() const |
2357 | +{ |
2358 | + static QHash<int,QByteArray> names; |
2359 | + if (Q_UNLIKELY(names.empty())) { |
2360 | + names[Qt::DisplayRole] = "displayName"; |
2361 | + names[MockItemModel::ItemRole] = "item"; |
2362 | + } |
2363 | + return names; |
2364 | +} |
2365 | + |
2366 | +// Q_DECLARE_METATYPE(MockItem*) |
2367 | |
2368 | === added file 'tests/mocks/SystemSettings/MockPluginManager.h' |
2369 | --- tests/mocks/SystemSettings/MockPluginManager.h 1970-01-01 00:00:00 +0000 |
2370 | +++ tests/mocks/SystemSettings/MockPluginManager.h 2016-12-09 15:19:40 +0000 |
2371 | @@ -0,0 +1,102 @@ |
2372 | +/* |
2373 | + * This file is part of system-settings |
2374 | + * |
2375 | + * Copyright (C) 2016 Canonical Ltd. |
2376 | + * |
2377 | + * This program is free software: you can redistribute it and/or modify it |
2378 | + * under the terms of the GNU General Public License version 3, as published |
2379 | + * by the Free Software Foundation. |
2380 | + * |
2381 | + * This program is distributed in the hope that it will be useful, but |
2382 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
2383 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2384 | + * PURPOSE. See the GNU General Public License for more details. |
2385 | + * |
2386 | + * You should have received a copy of the GNU General Public License along |
2387 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
2388 | + */ |
2389 | + |
2390 | +#ifndef MOCK_PLUGIN_MANAGER_H |
2391 | +#define MOCK_PLUGIN_MANAGER_H |
2392 | + |
2393 | +#include <QAbstractItemModel> |
2394 | +#include <QObject> |
2395 | +#include <QString> |
2396 | +#include <QQmlComponent> |
2397 | + |
2398 | +class MockItem; |
2399 | +class MockItemModel; |
2400 | +class MockPluginManager : public QObject |
2401 | +{ |
2402 | + Q_OBJECT |
2403 | + Q_PROPERTY (QString filter READ getFilter WRITE setFilter |
2404 | + NOTIFY filterChanged) |
2405 | + |
2406 | +public: |
2407 | + explicit MockPluginManager(QObject *parent = nullptr); |
2408 | + ~MockPluginManager() {}; |
2409 | + |
2410 | +public Q_SLOTS: |
2411 | + QObject* getByName(const QString &name) const; |
2412 | + QAbstractItemModel* itemModel(const QString &category); |
2413 | + void resetPlugins(); |
2414 | + QString getFilter(); |
2415 | + void setFilter(const QString &filter); |
2416 | + void addPlugin(const QString &name, |
2417 | + QQmlComponent *entry, |
2418 | + QQmlComponent *page, |
2419 | + const QString &category = "uncategorized-bottom"); |
2420 | + |
2421 | +Q_SIGNALS: |
2422 | + void filterChanged(); |
2423 | + |
2424 | +private: |
2425 | + QString m_filter = QString::null; |
2426 | + QMap<QString, MockItemModel*> m_models; |
2427 | + QMap<QString, MockItem*> m_plugins; |
2428 | +}; |
2429 | + |
2430 | +class MockItem : public QObject |
2431 | +{ |
2432 | + Q_OBJECT |
2433 | + Q_PROPERTY(QQmlComponent *entryComponent READ entryComponent CONSTANT) |
2434 | + Q_PROPERTY(QQmlComponent *pageComponent READ pageComponent CONSTANT) |
2435 | + Q_PROPERTY(bool visible READ visible CONSTANT) |
2436 | + Q_PROPERTY(QString baseName READ baseName CONSTANT) |
2437 | +public: |
2438 | + explicit MockItem(QObject *parent = 0) : QObject(parent) {}; |
2439 | + ~MockItem() {}; |
2440 | + QQmlComponent* entryComponent(); |
2441 | + void setEntryComponent(QQmlComponent* c); |
2442 | + QQmlComponent* pageComponent(); |
2443 | + void setPageComponent(QQmlComponent* c); |
2444 | + bool visible() const; |
2445 | + QString baseName() const; |
2446 | + void setBaseName(const QString &baseName); |
2447 | +private: |
2448 | + QQmlComponent* m_entry; |
2449 | + QQmlComponent* m_page; |
2450 | + QString m_baseName; |
2451 | +}; |
2452 | + |
2453 | +class MockItemModel : public QAbstractListModel |
2454 | +{ |
2455 | + Q_OBJECT |
2456 | +public: |
2457 | + explicit MockItemModel(QObject *parent = 0); |
2458 | + ~MockItemModel() {}; |
2459 | + |
2460 | + enum Roles { |
2461 | + IconRole = Qt::UserRole + 1, |
2462 | + ItemRole, |
2463 | + }; |
2464 | + void addPlugin(MockItem *plugin); |
2465 | + int rowCount(const QModelIndex &parent = QModelIndex()) const; |
2466 | + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; |
2467 | + QHash<int, QByteArray> roleNames() const; |
2468 | + |
2469 | +private: |
2470 | + QList<MockItem*> m_plugins; |
2471 | +}; |
2472 | + |
2473 | +#endif // MOCK_PLUGIN_MANAGER_H |
2474 | |
2475 | === added file 'tests/mocks/SystemSettings/plugin.cpp' |
2476 | --- tests/mocks/SystemSettings/plugin.cpp 1970-01-01 00:00:00 +0000 |
2477 | +++ tests/mocks/SystemSettings/plugin.cpp 2016-12-09 15:19:40 +0000 |
2478 | @@ -0,0 +1,28 @@ |
2479 | +/* |
2480 | + * This file is part of system-settings |
2481 | + * |
2482 | + * Copyright (C) 2016 Canonical Ltd. |
2483 | + * |
2484 | + * This program is free software: you can redistribute it and/or modify it |
2485 | + * under the terms of the GNU General Public License version 3, as published |
2486 | + * by the Free Software Foundation. |
2487 | + * |
2488 | + * This program is distributed in the hope that it will be useful, but |
2489 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
2490 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2491 | + * PURPOSE. See the GNU General Public License for more details. |
2492 | + * |
2493 | + * You should have received a copy of the GNU General Public License along |
2494 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
2495 | + */ |
2496 | + |
2497 | +#include "plugin.h" |
2498 | +#include "MockPluginManager.h" |
2499 | + |
2500 | +#include <QtQml> |
2501 | + |
2502 | +void BackendPlugin::registerTypes(const char *uri) |
2503 | +{ |
2504 | + Q_ASSERT(uri == QLatin1String("SystemSettings")); |
2505 | + qmlRegisterType<MockPluginManager>(uri, 1, 0, "PluginManager"); |
2506 | +} |
2507 | |
2508 | === added file 'tests/mocks/SystemSettings/plugin.h' |
2509 | --- tests/mocks/SystemSettings/plugin.h 1970-01-01 00:00:00 +0000 |
2510 | +++ tests/mocks/SystemSettings/plugin.h 2016-12-09 15:19:40 +0000 |
2511 | @@ -0,0 +1,32 @@ |
2512 | +/* |
2513 | + * This file is part of system-settings |
2514 | + * |
2515 | + * Copyright (C) 2016 Canonical Ltd. |
2516 | + * |
2517 | + * This program is free software: you can redistribute it and/or modify it |
2518 | + * under the terms of the GNU General Public License version 3, as published |
2519 | + * by the Free Software Foundation. |
2520 | + * |
2521 | + * This program is distributed in the hope that it will be useful, but |
2522 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
2523 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2524 | + * PURPOSE. See the GNU General Public License for more details. |
2525 | + * |
2526 | + * You should have received a copy of the GNU General Public License along |
2527 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
2528 | + */ |
2529 | + |
2530 | +#ifndef MOCK_SYSTEMSETTINGS_PLUGIN_H |
2531 | +#define MOCK_SYSTEMSETTINGS_PLUGIN_H |
2532 | + |
2533 | +#include <QQmlExtensionPlugin> |
2534 | + |
2535 | +class BackendPlugin : public QQmlExtensionPlugin |
2536 | +{ |
2537 | + Q_OBJECT |
2538 | + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") |
2539 | +public: |
2540 | + void registerTypes(const char *uri) override; |
2541 | +}; |
2542 | + |
2543 | +#endif // MOCK_SYSTEMSETTINGS_PLUGIN_H |
2544 | |
2545 | === added file 'tests/mocks/SystemSettings/qmldir' |
2546 | --- tests/mocks/SystemSettings/qmldir 1970-01-01 00:00:00 +0000 |
2547 | +++ tests/mocks/SystemSettings/qmldir 2016-12-09 15:19:40 +0000 |
2548 | @@ -0,0 +1,8 @@ |
2549 | +module SystemSettings |
2550 | +plugin MockSystemSettings |
2551 | + |
2552 | +ItemPage 1.0 file://${CMAKE_SOURCE_DIR}/src/SystemSettings/ItemPage.qml |
2553 | +SettingsItemTitle 1.0 file://${CMAKE_SOURCE_DIR}/src/SystemSettings/SettingsItemTitle.qml |
2554 | +CategorySection 1.0 file://${CMAKE_SOURCE_DIR}/src/qml/CategorySection.qml |
2555 | +UncategorizedItemsView.qml 1.0 file://${CMAKE_SOURCE_DIR}/src/qml/UncategorizedItemsView.qml.qml |
2556 | +MainWindow 1.0 file://${CMAKE_SOURCE_DIR}/src/qml/MainWindow.qml |
2557 | |
2558 | === modified file 'tests/plugins/CMakeLists.txt' |
2559 | --- tests/plugins/CMakeLists.txt 2016-11-21 12:47:19 +0000 |
2560 | +++ tests/plugins/CMakeLists.txt 2016-12-09 15:19:40 +0000 |
2561 | @@ -56,10 +56,16 @@ |
2562 | IMPORT_PATHS ${SYSTEMUPDATE_IMPORT_PATHS} |
2563 | ) |
2564 | |
2565 | +add_qml_test(main MainWindow |
2566 | + IMPORT_PATHS |
2567 | + ${CMAKE_BINARY_DIR}/tests/mocks/ |
2568 | + ${CMAKE_SOURCE_DIR}/tests/plugins/main |
2569 | + ${qmltest_DEFAULT_IMPORT_PATHS} |
2570 | +) |
2571 | + |
2572 | set(LAUNCHER_IMPORT_PATHS |
2573 | - ${CMAKE_SOURCE_DIR}/src |
2574 | - ${CMAKE_BINARY_DIR}/tests/utils/modules |
2575 | ${CMAKE_BINARY_DIR}/tests/mocks/ |
2576 | ${CMAKE_SOURCE_DIR}/tests/plugins/launcher |
2577 | + ${qmltest_DEFAULT_IMPORT_PATHS} |
2578 | ) |
2579 | add_qml_test(launcher LauncherPageComponent IMPORT_PATHS ${LAUNCHER_IMPORT_PATHS}) |
2580 | |
2581 | === added directory 'tests/plugins/main' |
2582 | === added file 'tests/plugins/main/tst_MainWindow.qml' |
2583 | --- tests/plugins/main/tst_MainWindow.qml 1970-01-01 00:00:00 +0000 |
2584 | +++ tests/plugins/main/tst_MainWindow.qml 2016-12-09 15:19:40 +0000 |
2585 | @@ -0,0 +1,236 @@ |
2586 | +/* |
2587 | + * This file is part of system-settings |
2588 | + * |
2589 | + * Copyright (C) 2016 Canonical Ltd. |
2590 | + * |
2591 | + * This program is free software: you can redistribute it and/or modify it |
2592 | + * under the terms of the GNU General Public License version 3, as published |
2593 | + * by the Free Software Foundation. |
2594 | + * |
2595 | + * This program is distributed in the hope that it will be useful, but |
2596 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
2597 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
2598 | + * PURPOSE. See the GNU General Public License for more details. |
2599 | + * |
2600 | + * You should have received a copy of the GNU General Public License along |
2601 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
2602 | + */ |
2603 | + |
2604 | +import QtQuick 2.4 |
2605 | +import QtTest 1.0 |
2606 | +import SystemSettings 1.0 |
2607 | +import SystemSettings.ListItems 1.0 as SettingsListItems |
2608 | +import Ubuntu.Components 1.3 |
2609 | +import Ubuntu.Test 0.1 |
2610 | + |
2611 | +Item { |
2612 | + id: testRoot |
2613 | + width: units.gu(50) |
2614 | + height: units.gu(90) |
2615 | + |
2616 | + Component { |
2617 | + id: mainWindowComponent |
2618 | + MainWindow { |
2619 | + id: mainWindow |
2620 | + anchors.fill: parent |
2621 | + |
2622 | + property string i18nDirectory: "" |
2623 | + property string defaultPlugin: "" |
2624 | + property var pluginOptions: ({}) |
2625 | + property var view: ({ |
2626 | + minimumWidth: 0, |
2627 | + maximumWidth: 0, |
2628 | + }) |
2629 | + } |
2630 | + } |
2631 | + |
2632 | + UbuntuTestCase { |
2633 | + name: "DefaultPluginMainWindowTest" |
2634 | + when: windowShown |
2635 | + |
2636 | + function test_default_plugin () { |
2637 | + mainWindowComponent.createObject(testRoot, {}); |
2638 | + } |
2639 | + } |
2640 | + |
2641 | + UbuntuTestCase { |
2642 | + name: "MainWindowTests" |
2643 | + when: windowShown |
2644 | + |
2645 | + property var instance |
2646 | + |
2647 | + function init() { |
2648 | + instance = mainWindowComponent.createObject(testRoot, {}); |
2649 | + } |
2650 | + |
2651 | + function cleanup() { |
2652 | + instance.destroy(); |
2653 | + } |
2654 | + |
2655 | + function test_search_filter_results() { |
2656 | + var standardHeader = findChild(instance, "standardHeader"); |
2657 | + var search = findChild(instance, "searchField"); |
2658 | + standardHeader.trailingActionBar.actions[0].trigger(); |
2659 | + search.text = "blue"; |
2660 | + compare(instance.pluginManager.filter, search.text) |
2661 | + } |
2662 | + |
2663 | + function test_search_cleared_clears_filter() { |
2664 | + var standardHeader = findChild(instance, "standardHeader"); |
2665 | + var searchHeader = findChild(instance, "searchHeader"); |
2666 | + var search = findChild(instance, "searchField"); |
2667 | + standardHeader.trailingActionBar.actions[0].trigger(); |
2668 | + search.text = "blue"; |
2669 | + searchHeader.trailingActionBar.actions[0].trigger(); |
2670 | + compare(instance.pluginManager.filter, ""); |
2671 | + } |
2672 | + } |
2673 | + |
2674 | + UbuntuTestCase { |
2675 | + name: "MainWindowAPLTests" |
2676 | + when: windowShown |
2677 | + |
2678 | + Component { |
2679 | + id: testPersonalEntry |
2680 | + SettingsListItems.IconProgression { |
2681 | + objectName: "testPersonalEntry" |
2682 | + text: "Test" |
2683 | + iconName: "system-users-symbolic" |
2684 | + } |
2685 | + } |
2686 | + |
2687 | + Component { |
2688 | + id: testUncategorizedEntry |
2689 | + SettingsListItems.IconProgression { |
2690 | + objectName: "testUncategorizedEntry" |
2691 | + text: "Test 2" |
2692 | + iconName: "phone-smartphone-symbolic" |
2693 | + } |
2694 | + } |
2695 | + |
2696 | + Component { |
2697 | + id: testPageComponent |
2698 | + Page { |
2699 | + objectName: "testPage" |
2700 | + visible: false |
2701 | + property var pluginManager |
2702 | + header: testHeader |
2703 | + PageHeader { |
2704 | + id: testHeader |
2705 | + title: i18n.tr("Test PageComponent") |
2706 | + flickable: testFlickable |
2707 | + } |
2708 | + Flickable { |
2709 | + id: testFlickable |
2710 | + anchors.fill: parent |
2711 | + contentHeight: contentItem.childrenRect.height |
2712 | + Column { |
2713 | + anchors.left: parent.left |
2714 | + anchors.right: parent.right |
2715 | + |
2716 | + Label { |
2717 | + text: "Test Content" |
2718 | + } |
2719 | + } |
2720 | + } |
2721 | + } |
2722 | + } |
2723 | + |
2724 | + Component { |
2725 | + id: pluginManagerComponent |
2726 | + PluginManager {} |
2727 | + } |
2728 | + |
2729 | + function waitForPage(page) { |
2730 | + tryCompareFunction(function () { |
2731 | + return !!findChild(testRoot, page); |
2732 | + }, true); |
2733 | + return findChild(testRoot, page); |
2734 | + } |
2735 | + |
2736 | + function waitForPageDestruction(page) { |
2737 | + tryCompareFunction(function () { |
2738 | + return !!findChild(testRoot, page); |
2739 | + }, false); |
2740 | + } |
2741 | + |
2742 | + property var instance |
2743 | + property var personalEntry |
2744 | + property var uncategorizedEntry |
2745 | + property var page |
2746 | + property var manager |
2747 | + |
2748 | + function init() { |
2749 | + manager = pluginManagerComponent.createObject(testRoot); |
2750 | + personalEntry = testPersonalEntry; |
2751 | + uncategorizedEntry = testUncategorizedEntry; |
2752 | + page = testPageComponent; |
2753 | + |
2754 | + manager.addPlugin("Test", personalEntry, page, "personal"); |
2755 | + manager.addPlugin("Phone", uncategorizedEntry, page, "uncategorized-bottom"); |
2756 | + } |
2757 | + |
2758 | + function cleanup() { |
2759 | + instance && instance.destroy(); |
2760 | + } |
2761 | + |
2762 | + function test_go_to_panel_data() { |
2763 | + return [ |
2764 | + { tag: "one column, categorized", width: units.gu(50), entry: "testPersonalEntry" }, |
2765 | + { tag: "one column, uncategorized", width: units.gu(50), entry: "testUncategorizedEntry" }, |
2766 | + { tag: "two column, categorized", width: units.gu(110), entry: "testPersonalEntry" }, |
2767 | + { tag: "two column, uncategorized", width: units.gu(110), entry: "testUncategorizedEntry" }, |
2768 | + ]; |
2769 | + } |
2770 | + function test_go_to_panel(data) { |
2771 | + instance = mainWindowComponent.createObject(testRoot, { |
2772 | + pluginManager: manager |
2773 | + }); |
2774 | + testRoot.width = data.width; |
2775 | + var entry = findChild(instance, data.entry); |
2776 | + mouseClick(entry, entry.width / 2, entry.height / 2); |
2777 | + waitForPage("testPage"); |
2778 | + var page = waitForPage("testPage"); |
2779 | + tryCompare(page, "visible", true); |
2780 | + } |
2781 | + |
2782 | + function test_default_plugin_data() { |
2783 | + return [ |
2784 | + { tag: "no default", default: "", pageObjectName: "" }, |
2785 | + { tag: "default", default: "Test", pageObjectName: "testPage" }, |
2786 | + ]; |
2787 | + } |
2788 | + |
2789 | + function test_default_plugin(data) { |
2790 | + instance = mainWindowComponent.createObject(testRoot, { |
2791 | + pluginManager: manager, defaultPlugin: data.default |
2792 | + }); |
2793 | + if (data.pageObjectName) { |
2794 | + var page = waitForPage(data.pageObjectName); |
2795 | + tryCompare(page, "visible", true); |
2796 | + } |
2797 | + } |
2798 | + |
2799 | + function test_current_plugin_property() { |
2800 | + var apl; |
2801 | + var entry; |
2802 | + |
2803 | + instance = mainWindowComponent.createObject(testRoot, { |
2804 | + pluginManager: manager |
2805 | + }); |
2806 | + waitForRendering(instance); |
2807 | + apl = findInvisibleChild(instance, "apl"); |
2808 | + |
2809 | + // Base case |
2810 | + compare(instance.currentPlugin, ""); |
2811 | + |
2812 | + // Push a page |
2813 | + instance.loadPluginByName("Test"); |
2814 | + tryCompare(instance, "currentPlugin", "Test"); |
2815 | + |
2816 | + // Pop a page |
2817 | + apl.removePages(apl.primaryPage); |
2818 | + tryCompare(instance, "currentPlugin", ""); |
2819 | + } |
2820 | + } |
2821 | +} |
2822 | |
2823 | === modified file 'tests/plugins/system-update/tst_systemupdate_entrycomponent.qml' |
2824 | --- tests/plugins/system-update/tst_systemupdate_entrycomponent.qml 2016-08-11 13:05:45 +0000 |
2825 | +++ tests/plugins/system-update/tst_systemupdate_entrycomponent.qml 2016-12-09 15:19:40 +0000 |
2826 | @@ -36,6 +36,7 @@ |
2827 | |
2828 | EntryComponent { |
2829 | property var model |
2830 | + property bool showAllUI: false |
2831 | width: testRoot.width |
2832 | } |
2833 | } |
2834 | @@ -69,7 +70,7 @@ |
2835 | |
2836 | function test_clickUpdates() { |
2837 | UpdateManager.model.mockAddUpdate("app" + 0, 0, Update.KindClick); |
2838 | - tryCompare(instance, "height", units.gu(7), 5000, "item did not have the correct height when we had click updates"); |
2839 | + tryCompare(instance, "height", units.gu(6.5), 5000, "item did not have the correct height when we had click updates"); |
2840 | } |
2841 | } |
2842 | |
2843 | @@ -97,12 +98,12 @@ |
2844 | } |
2845 | |
2846 | function test_visibleWhenImageUpdate() { |
2847 | - tryCompare(instance, "height", units.gu(7), 5000, "item did not have the correct height when we had image updates"); |
2848 | + tryCompare(instance, "height", units.gu(6.5), 5000, "item did not have the correct height when we had image updates"); |
2849 | } |
2850 | |
2851 | function test_clickUpdates() { |
2852 | UpdateManager.model.mockAddUpdate("app" + 0, 0, Update.KindClick); |
2853 | - tryCompare(instance, "height", units.gu(7), 5000, "item did not have the correct height when we had all types of updates"); |
2854 | + tryCompare(instance, "height", units.gu(6.5), 5000, "item did not have the correct height when we had all types of updates"); |
2855 | } |
2856 | } |
2857 | } |
PASSED: Continuous integration, rev:1751 /jenkins. canonical. com/system- apps/job/ lp-ubuntu- system- settings- ci/259/ /jenkins. canonical. com/system- apps/job/ build/2122 /jenkins. canonical. com/system- apps/job/ test-0- autopkgtest/ label=phone- armhf,release= vivid+overlay, testname= default/ 532 /jenkins. canonical. com/system- apps/job/ build-0- fetch/2125 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 1953 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 1953/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 1953 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 1953/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= zesty/1953 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= zesty/1953/ artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 1953 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 1953/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 1953 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 1953/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= zesty/1953 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= zesty/1953/ artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 1953 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 1953/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 1953 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 1953/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= zesty/1953 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= zesty/1953/ artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/system- apps/job/ lp-ubuntu- system- settings- ci/259/ rebuild
https:/