Merge lp:~seb128/ubuntu-system-settings/location-list-scrolling into lp:ubuntu-system-settings

Proposed by Sebastien Bacher
Status: Merged
Approved by: Ken VanDine
Approved revision: 1079
Merged at revision: 1103
Proposed branch: lp:~seb128/ubuntu-system-settings/location-list-scrolling
Merge into: lp:ubuntu-system-settings
Diff against target: 173 lines (+85/-74)
1 file modified
plugins/security-privacy/Location.qml (+85/-74)
To merge this branch: bzr merge lp:~seb128/ubuntu-system-settings/location-list-scrolling
Reviewer Review Type Date Requested Status
Ken VanDine Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+235994@code.launchpad.net

Commit message

[location] use a flickable so the list can be scrolled

Description of the change

[location] use a flickable so the list can be scrolled

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

the diff looks non trivial but it's basically moving the column in a flickable, which is changing the indendation of the block but not the content

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

I get some errors in the log:

2014-09-26 10:54:00,812 - WARNING - Exception org.freedesktop.DBus.Error.ServiceUnknown: The name com.ubuntu.trust.store.UbuntuLocationService was not provided by any .service files
2014-09-26 10:54:00,833 - WARNING - file:///usr/share/ubuntu/settings/system/qml-plugins/security-privacy/Location.qml:38: ReferenceError: root is not defined

I'm sure the first one has nothing to do with this branch, but the reference error does.

review: Needs Fixing
1079. By Sebastien Bacher

use correct variable name

Revision history for this message
Sebastien Bacher (seb128) wrote :

> I'm sure the first one has nothing to do with this branch, but the reference error does.

good catch, I copied that from another panel and didn't update to the itempage's id, done that now

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/security-privacy/Location.qml'
2--- plugins/security-privacy/Location.qml 2014-09-05 08:50:28 +0000
3+++ plugins/security-privacy/Location.qml 2014-09-26 15:00:09 +0000
4@@ -29,84 +29,95 @@
5 ItemPage {
6 id: dashPage
7 title: i18n.tr("Location")
8-
9- Column {
10- anchors.left: parent.left
11- anchors.right: parent.right
12-
13- QDBusActionGroup {
14- id: locationActionGroup
15- busType: DBus.SessionBus
16- busName: "com.canonical.indicator.location"
17- objectPath: "/com/canonical/indicator/location"
18-
19- property variant enabled: action("location-detection-enabled")
20-
21- Component.onCompleted: start()
22- }
23-
24- ListItem.Standard {
25- text: i18n.tr("Location detection")
26- control: Switch {
27- id: locationOn
28- onClicked: locationActionGroup.enabled.activate()
29- }
30- visible: locationActionGroup.enabled.state !== undefined
31- Component.onCompleted:
32- clicked.connect(locationOn.clicked)
33- }
34-
35- Binding {
36- target: locationOn
37- property: "checked"
38- value: locationActionGroup.enabled.state
39- }
40-
41- ListItem.Caption {
42- /* TODO: replace by real info from the location service */
43- property int locationInfo: 0
44-
45- text: {
46- if (locationInfo === 0) /* GPS only */
47- return i18n.tr("Uses GPS to detect your rough location. When off, GPS turns off to save battery.")
48- else if (locationInfo === 1) /* GPS, wi-fi on */
49- return i18n.tr("Uses wi-fi and GPS to detect your rough location. Turning off location detection saves battery.")
50- else if (locationInfo === 2) /* GPS, wi-fi off */
51- return i18n.tr("Uses wi-fi (currently off) and GPS to detect your rough location. Turning off location detection saves battery.")
52- else if (locationInfo === 3) /* GPS, wi-fi and cellular on */
53- return i18n.tr("Uses wi-fi, cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
54- else if (locationInfo === 4) /* GPS, wi-fi on, cellular off */
55- return i18n.tr("Uses wi-fi, cell tower locations (no current cellular connection), and GPS to detect your rough location. Turning off location detection saves battery.")
56- else if (locationInfo === 5) /* GPS, wi-fi off, cellular on */
57- return i18n.tr("Uses wi-fi (currently off), cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
58- else if (locationInfo === 6) /* GPS, wi-fi and cellular off */
59- return i18n.tr("Uses wi-fi (currently off), cell tower locations (no current cellular connection), and GPS to detect your rough location. Turning off location detection saves battery.")
60- }
61-
62- visible: showAllUI /* hide until the information is real */
63- }
64-
65- ListItem.Standard {
66- text: i18n.tr("Allow access to location:")
67- visible: locationOn.checked
68- }
69-
70- TrustStoreModel {
71- id: trustStoreModel
72- serviceName: "UbuntuLocationService"
73- }
74-
75- Repeater {
76- model: trustStoreModel
77+ flickable: scrollWidget
78+
79+ Flickable {
80+ id: scrollWidget
81+ anchors.fill: parent
82+ contentHeight: contentItem.childrenRect.height
83+ boundsBehavior: (contentHeight > dashPage.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
84+ /* Set the direction to workaround https://bugreports.qt-project.org/browse/QTBUG-31905
85+ otherwise the UI might end up in a situation where scrolling doesn't work */
86+ flickableDirection: Flickable.VerticalFlick
87+
88+ Column {
89+ anchors.left: parent.left
90+ anchors.right: parent.right
91+
92+ QDBusActionGroup {
93+ id: locationActionGroup
94+ busType: DBus.SessionBus
95+ busName: "com.canonical.indicator.location"
96+ objectPath: "/com/canonical/indicator/location"
97+
98+ property variant enabled: action("location-detection-enabled")
99+
100+ Component.onCompleted: start()
101+ }
102+
103 ListItem.Standard {
104- text: model.applicationName
105- iconSource: model.iconName
106+ text: i18n.tr("Location detection")
107 control: Switch {
108- checked: model.granted
109- onClicked: trustStoreModel.setEnabled(index, !model.granted)
110- }
111+ id: locationOn
112+ onClicked: locationActionGroup.enabled.activate()
113+ }
114+ visible: locationActionGroup.enabled.state !== undefined
115+ Component.onCompleted:
116+ clicked.connect(locationOn.clicked)
117+ }
118+
119+ Binding {
120+ target: locationOn
121+ property: "checked"
122+ value: locationActionGroup.enabled.state
123+ }
124+
125+ ListItem.Caption {
126+ /* TODO: replace by real info from the location service */
127+ property int locationInfo: 0
128+
129+ text: {
130+ if (locationInfo === 0) /* GPS only */
131+ return i18n.tr("Uses GPS to detect your rough location. When off, GPS turns off to save battery.")
132+ else if (locationInfo === 1) /* GPS, wi-fi on */
133+ return i18n.tr("Uses wi-fi and GPS to detect your rough location. Turning off location detection saves battery.")
134+ else if (locationInfo === 2) /* GPS, wi-fi off */
135+ return i18n.tr("Uses wi-fi (currently off) and GPS to detect your rough location. Turning off location detection saves battery.")
136+ else if (locationInfo === 3) /* GPS, wi-fi and cellular on */
137+ return i18n.tr("Uses wi-fi, cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
138+ else if (locationInfo === 4) /* GPS, wi-fi on, cellular off */
139+ return i18n.tr("Uses wi-fi, cell tower locations (no current cellular connection), and GPS to detect your rough location. Turning off location detection saves battery.")
140+ else if (locationInfo === 5) /* GPS, wi-fi off, cellular on */
141+ return i18n.tr("Uses wi-fi (currently off), cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
142+ else if (locationInfo === 6) /* GPS, wi-fi and cellular off */
143+ return i18n.tr("Uses wi-fi (currently off), cell tower locations (no current cellular connection), and GPS to detect your rough location. Turning off location detection saves battery.")
144+ }
145+
146+ visible: showAllUI /* hide until the information is real */
147+ }
148+
149+ ListItem.Standard {
150+ text: i18n.tr("Allow access to location:")
151 visible: locationOn.checked
152 }
153+
154+ TrustStoreModel {
155+ id: trustStoreModel
156+ serviceName: "UbuntuLocationService"
157+ }
158+
159+ Repeater {
160+ model: trustStoreModel
161+ ListItem.Standard {
162+ text: model.applicationName
163+ iconSource: model.iconName
164+ control: Switch {
165+ checked: model.granted
166+ onClicked: trustStoreModel.setEnabled(index, !model.granted)
167+ }
168+ visible: locationOn.checked
169+ }
170+ }
171 }
172
173 }

Subscribers

People subscribed via source and target branches