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
=== modified file 'plugins/security-privacy/Location.qml'
--- plugins/security-privacy/Location.qml 2014-09-05 08:50:28 +0000
+++ plugins/security-privacy/Location.qml 2014-09-26 15:00:09 +0000
@@ -29,84 +29,95 @@
29ItemPage {29ItemPage {
30 id: dashPage30 id: dashPage
31 title: i18n.tr("Location")31 title: i18n.tr("Location")
3232 flickable: scrollWidget
33 Column {33
34 anchors.left: parent.left34 Flickable {
35 anchors.right: parent.right35 id: scrollWidget
3636 anchors.fill: parent
37 QDBusActionGroup {37 contentHeight: contentItem.childrenRect.height
38 id: locationActionGroup38 boundsBehavior: (contentHeight > dashPage.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
39 busType: DBus.SessionBus39 /* Set the direction to workaround https://bugreports.qt-project.org/browse/QTBUG-31905
40 busName: "com.canonical.indicator.location"40 otherwise the UI might end up in a situation where scrolling doesn't work */
41 objectPath: "/com/canonical/indicator/location"41 flickableDirection: Flickable.VerticalFlick
4242
43 property variant enabled: action("location-detection-enabled")43 Column {
4444 anchors.left: parent.left
45 Component.onCompleted: start()45 anchors.right: parent.right
46 }46
4747 QDBusActionGroup {
48 ListItem.Standard {48 id: locationActionGroup
49 text: i18n.tr("Location detection")49 busType: DBus.SessionBus
50 control: Switch {50 busName: "com.canonical.indicator.location"
51 id: locationOn51 objectPath: "/com/canonical/indicator/location"
52 onClicked: locationActionGroup.enabled.activate()52
53 }53 property variant enabled: action("location-detection-enabled")
54 visible: locationActionGroup.enabled.state !== undefined54
55 Component.onCompleted:55 Component.onCompleted: start()
56 clicked.connect(locationOn.clicked)56 }
57 }57
58
59 Binding {
60 target: locationOn
61 property: "checked"
62 value: locationActionGroup.enabled.state
63 }
64
65 ListItem.Caption {
66 /* TODO: replace by real info from the location service */
67 property int locationInfo: 0
68
69 text: {
70 if (locationInfo === 0) /* GPS only */
71 return i18n.tr("Uses GPS to detect your rough location. When off, GPS turns off to save battery.")
72 else if (locationInfo === 1) /* GPS, wi-fi on */
73 return i18n.tr("Uses wi-fi and GPS to detect your rough location. Turning off location detection saves battery.")
74 else if (locationInfo === 2) /* GPS, wi-fi off */
75 return i18n.tr("Uses wi-fi (currently off) and GPS to detect your rough location. Turning off location detection saves battery.")
76 else if (locationInfo === 3) /* GPS, wi-fi and cellular on */
77 return i18n.tr("Uses wi-fi, cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
78 else if (locationInfo === 4) /* GPS, wi-fi on, cellular off */
79 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.")
80 else if (locationInfo === 5) /* GPS, wi-fi off, cellular on */
81 return i18n.tr("Uses wi-fi (currently off), cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
82 else if (locationInfo === 6) /* GPS, wi-fi and cellular off */
83 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.")
84 }
85
86 visible: showAllUI /* hide until the information is real */
87 }
88
89 ListItem.Standard {
90 text: i18n.tr("Allow access to location:")
91 visible: locationOn.checked
92 }
93
94 TrustStoreModel {
95 id: trustStoreModel
96 serviceName: "UbuntuLocationService"
97 }
98
99 Repeater {
100 model: trustStoreModel
101 ListItem.Standard {58 ListItem.Standard {
102 text: model.applicationName59 text: i18n.tr("Location detection")
103 iconSource: model.iconName
104 control: Switch {60 control: Switch {
105 checked: model.granted61 id: locationOn
106 onClicked: trustStoreModel.setEnabled(index, !model.granted)62 onClicked: locationActionGroup.enabled.activate()
107 }63 }
64 visible: locationActionGroup.enabled.state !== undefined
65 Component.onCompleted:
66 clicked.connect(locationOn.clicked)
67 }
68
69 Binding {
70 target: locationOn
71 property: "checked"
72 value: locationActionGroup.enabled.state
73 }
74
75 ListItem.Caption {
76 /* TODO: replace by real info from the location service */
77 property int locationInfo: 0
78
79 text: {
80 if (locationInfo === 0) /* GPS only */
81 return i18n.tr("Uses GPS to detect your rough location. When off, GPS turns off to save battery.")
82 else if (locationInfo === 1) /* GPS, wi-fi on */
83 return i18n.tr("Uses wi-fi and GPS to detect your rough location. Turning off location detection saves battery.")
84 else if (locationInfo === 2) /* GPS, wi-fi off */
85 return i18n.tr("Uses wi-fi (currently off) and GPS to detect your rough location. Turning off location detection saves battery.")
86 else if (locationInfo === 3) /* GPS, wi-fi and cellular on */
87 return i18n.tr("Uses wi-fi, cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
88 else if (locationInfo === 4) /* GPS, wi-fi on, cellular off */
89 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.")
90 else if (locationInfo === 5) /* GPS, wi-fi off, cellular on */
91 return i18n.tr("Uses wi-fi (currently off), cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
92 else if (locationInfo === 6) /* GPS, wi-fi and cellular off */
93 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.")
94 }
95
96 visible: showAllUI /* hide until the information is real */
97 }
98
99 ListItem.Standard {
100 text: i18n.tr("Allow access to location:")
108 visible: locationOn.checked101 visible: locationOn.checked
109 }102 }
103
104 TrustStoreModel {
105 id: trustStoreModel
106 serviceName: "UbuntuLocationService"
107 }
108
109 Repeater {
110 model: trustStoreModel
111 ListItem.Standard {
112 text: model.applicationName
113 iconSource: model.iconName
114 control: Switch {
115 checked: model.granted
116 onClicked: trustStoreModel.setEnabled(index, !model.granted)
117 }
118 visible: locationOn.checked
119 }
120 }
110 }121 }
111122
112 }123 }

Subscribers

People subscribed via source and target branches