~ken-vandine/ubuntu-system-settings/rtm_click_framework_check

« back to all changes in this revision

Viewing changes to plugins/security-privacy/Location.qml

[ CI bot ]
* Resync trunk
[ Michael Zanetti ]
* update code to reset launcher after launcher backend implementation
  was reworked (LP: #1376707)
[ Sebastien Bacher ]
* [storage] translator comment for the string "%1 free" (LP: #1377929)
* [system-update] ellipsize labels if needed (LP: #1376286)
* [sound] Use the correct low icon (LP: #1376286)
[ Lars Uebernickel ]
* notification-manager: fix issues with GVariant API usage
[ jonas-drange ]
* [security/privacy] allow user to change HERE and location detection
  settings. (LP: #1375322)
[ Ken VanDine ]
* Updated the pot file.
[ jonas-drange ]
* [cellular] indirectly recreate ConnectionManager interface's dbus
  proxy so it reports the true value of 'Powered' after flight mode
  (LP: #1376957)
[ Iain Lane ]
* [sound] Make listSounds take a list of directories and list all of
  the files in them, instead of assuming "/custom" all the time.
[ Ubuntu daily release ]
* New rebuild forced
[ Sebastien Bacher ]
* [sound] list custom ringtones as well (LP: #1381528)
[ Ken VanDine ]
* Add an APN editor. (LP: #1225174)
[ Michael Terry ]
* Complete the unlock security screens and update a host of other
  small design issues. (LP: #1365034, LP: #1348362) (LP: #1365034,
  #1348362)
[ Diego Sarmentero ]
* Improves in network backend. Detect network connection and show
  "Connect to the internet..." message or retry on netword detected. .
* Detect account added on online accounts (LP: #1362149)
[ jonas-drange ]
* [wifi/phone] dynamically chooses what SIM to use when there's only
  one present. (LP: #1375832)
[ Iain Lane ]
* [storage/about] Use a QSharedPointer to manage freeing of the
  counter which we use to display all of the collected sizes at once.
  If the measuring process was cancelled, we were freeing it multiple
  times - once for each outstanding size measurement. This led to a
  crash. (LP: #1375988)
* [security-privacy] Link with gobject, uses symbols from this
  library. Prevents "[…]libUbuntuSecurityPrivacyPanel.so contains an
  unresolvable reference to symbol
  g_signal_handlers_disconnect_matched: it's probably a plugin"
  warnings.
[ jonas-drange ]
* [cellular] react to application.state changes and update potential
  out-of-date default SIM settings (LP: #1364103)
* [wifi] let removed networks update the previous network model so
  that we can reuse the model (and not pop the pagestack twice,
  causing this ux issue) (LP: #1370389)
[ Sebastien Bacher ]
* [location] use a flickable so the list can be scrolled (LP:
  #1374017)
* [security] get localized application names from the trust-store (LP:
  #1374018)
[ Ken VanDine ]
* Fixed handling of the Downloading/Installing label based on actual
  state. . Forward updateProgress signals for system updates. Layout
  fixes (LP: #1312587)
* Use new splash screen (LP: #1376242)
* Improved tracking download states
* Use new target_build_number from system-image-dbus to determine
  visibility of the update notification (LP: #1355803)
[ CI bot ]
* Resync trunk
[ Sebastien Bacher ]
* [storage] use libclick rather than calling the command line (LP:
  #1368967)
* [storage] tweaks to the disk informations, limit the free space to
  the user available one (excluding the system partitions), don't list
  the external mounts, that's described in the design and is going to
  require work on the categories computation to give correct values
  (LP: #1284247)
* [about] display the free space value next to the storage label (LP:
  #1335144)
[ Albert Astals ]
* Add i18n.tr
[ jonas-drange ]
* [wifi] connect to hidden network is now a dialog (LP: #1366005)
[ Ken VanDine ]
* Provide more keywords to make search useful (LP: #1370219) (LP:
  #1370219)
* [background] set sourceSize in the image preview to work around an
  issue loading large images (LP: #1373462)
[ CI bot ]
* Resync trunk
[ Mathieu Trudel-Lapierre ]
* [bluetooth] Properly handle device types for connection and
  disconnection. (LP: #1369964)
[ Michael Terry ]
* Add a translator comment for what HERE means. (LP: #1368838) (LP:
  #1368838)
* Prevent a crash in unity8 when the wizard also crashes or stops
  early. (LP: #1355892) (LP: #1355892)
[ Michael Terry ]
* Prevent the buttons of the wizard's password page from overlapping
  its content when the OSK appears. (LP: #1368346) (LP: #1368346)
[ Ken VanDine ]
* Set the version information in the SystemUpdate constructor (LP:
  #1371810) (LP: #1371810)
* [reset] Don't bail out on an isValid() check on the SystemImage
  QDBusInterface, the docs say isValid() may not be reliable for
  remote interfaces (LP: #1370815) (LP: #1370815)
* Fixed reference error for count on the various device models (LP:
  #1362517) (LP: #1362517)
* [background] Use the ContentPeerPicker to select sources for
  backgrounds (LP: #1356542) (LP: #1356542)
[ Iain Lane ]
* Don't check if the timedated interface is valid before calling
  SetTime on it, it might have timed out and we should reactivate it
  in that case.
* [about] Fix developerMode property to be QMLish - read & write
  instead of separate "read" and "toggle" properties.
* [about] Don't display a frame for icons that can't be found,
  improving the visual appearance. Also return the correct path for
  click packages which use the icon theme.
[ Sebastien Bacher ]
* [storage] handle the scope click .ini and get the correct icons (LP:
  #1368920)
[ Albert Astals ]
* make pot
[ Oliver Grawert ]
* fix LP: #1365903, add a watch to Developer Mode page so the page
  gets refreshed when going back through the page stack, also fix the
  page id and bounds (LP: #1365903)
* Some packaging fixes
  - > is not a valid relationship. It should be >>
  - Don't recommend suru-icon-theme since we also depend on it
  - Bump S-V to 3.9.6 which for example allows the images we ship in
    /usr/lib/
  - Override binary-no-manpage lintian warnings. We're not going to get man
    pages for u-s-s any time soon
[ Ken VanDine ]
* Make UpdateManager a singleton and refresh the availableUpdates
  count when the model updates (LP: #1325629) (LP: #1325629)
[ Ken VanDine ]
* Include an icon instead of using the themed icon (LP: #1365408) (LP:
  #1365408)
[ Mathieu Trudel-Lapierre ]
* [bluetooth] don't try to enable Discoverable if the device isn't
  powered yet. (LP: #1355904)
[ Ken VanDine ]
* When activated by a url request for a specific panel, clear the
  pageStack to maintain the natural navigation instead of pushing a
  new page on top of a page from a the previous panel (LP: #1362025)
  (LP: #1362025, #1359953)
[ Lars Uebernickel ]
* Use Icon instead of StatusIcon
[ CI bot ]
* Resync trunk
[ John R. Lenton ]
* Take the system settings push helper closer to implementing the spec
  at https://wiki.ubuntu.com/SoftwareUpdates#Prompting (LP: #1363972)
[ Ken VanDine ]
* Don't try to tweak the bottomMargin for the OSK, it was trying to
  calculate it based on an undefined component so failing. It
  shouldn't be needed anyway.
[ jonas-drange ]
* [wifi] "Other Network" -> "Connect to hidden network" (LP: #1365984)
* [wifi] fix bad looking buttons in "Other Networks" panel (LP:
  #1362127)
[ Jussi Pakkanen ]
* Hide entry to connect to hidden network when wifi is off. (LP:
  #1365960)
[ Ken VanDine ]
* Fixed tests for the dialpad settings failing on mako
* Don't call downloadUpdate when we see a system update ready, the
  service does that for us (LP: #1368294) (LP: #1368294)
* Translate desktop file (LP: #1318008) (LP: #1318008)
[ Martin Pitt ]
* update POT
[ Sebastien Bacher ]
* [system-update] open the ubuntuone subpanel rather than the list
  (LP: #1348580)
* [security-privacy] use ngettext strings when needed (LP: #1368159)
* Increase vertical spacing in the settings grid (LP: #1348579)
[ jonas-drange ]
* [background] always keep custom images, and remove press-and-hold
  action. (LP: #1365167)
* [wifi] do not use predictive text for network name input (LP:
  #1365992)
* [language] workaround for transition bug in keyboard layout menu
  (LP: #1350809)
* [wifi] factory was setting the icon property, which was causing the
  icon to not render (LP: #1364366)
[ Alejandro J. Cura ]
* Fixing the refreshing of the apps scope (LP: #1360369)
[ Sebastien Bacher ]
* [sound] use the correct backend to control the keyboard sound toggle
  (LP: #1366208)
[ Ken VanDine ]
* Don't call downloadUpdate for system updates that are already
  downloading (LP: #1365646) (LP: #1311219, #1365646)
[ Ken VanDine ]
* Notify the user if the phone needs to be plug to power for update.
[ Sebastien Bacher ]
* [system-update] don't draw a frame around ubuntu updates (LP:
  #1367136)
[ Mathieu Trudel-Lapierre ]
* Also allow Speakers and Carkits as valid audio devices to pair.
[ Michael Terry ]
* Allow switch from PIN code to passphrase and back using the same
  password. (LP: #1357043) (LP: #1357043)
* Fix false-negatives from AccountsService when switching from swipe
  to password (LP: #1363405) (LP: #1363405)
[ Ricardo Salveti de Araujo ]
* sound: setting default audio role for ringtone and messages
[ Michael Terry ]
* Don't crash when destructing the Wizard.Utils.System plugin. This
  fixes the crash on wizard exit and the crash when pressing back on
  the HERE license.
[ CI bot ]
* Resync trunk
[ Sebastien Bacher ]
* [developer-mode] working scrolling and correct spacing
* Use standard items for the categories and don't display dividers
  (LP: #1365563)
* [orientation-lock] don't display a frame around the icon (LP:
  #1365450)
[ jonas-drange ]
* [about/versions] create reusable component of singlevalue items that
  have long values (LP: #1363927)
[ David Barth ]
* Enable location panel, display contols for authorized applications.
[ Ken VanDine ]
* Tweak the depends for accountsservice-ubuntu-schemas to handle a "~"
  version
[ CI bot ]
* Resync trunk
[ Guillermo Gonzalez ]
* Basic unittest for the push-helper script
[ Mathieu Trudel-Lapierre ]
* Downgrade qFatal failure to register bluetooth agent to a qCritical.
[ Andrea Cimitan ]
* Various fixes for wifi wizard page (LP: #1362296)
[ Sebastien Bacher ]
* [security] don't mark "%1" string as translatable
* [security] give a translation context to the 'None' string (LP:
  #1362143)
* [licenses] display an error when the copyright can't be read (LP:
  #1206150)
[ Michael Terry ]
* Avoid another race condition when switching password types by
  completing all DBus operations synchronously as we exit the
  policykit agent. LP: 1361137 (LP: #1361137)
* Fix the OSK not working on first boot. When the wizard closes, shut
  down maliit-server and the indicators so that unity8 can start them
  itself. LP: 1362679 (LP: #1362679)
[ jonas-drange ]
* [about] print out phone numbers for dual sims as well
* [about/wifi] adding mac addresses for bt and wifi, and ip for wifi
  (LP: #1356239)
* [language] explain to the user that a reboot is necessary for the
  change to take effect (LP: #1240875)
[ Michael Terry ]
* Make the HERE license optional, clearly mark it as a HERE license
  instead of an Ubuntu license, and connect it to the HERE backend.
[ CI bot ]
* Resync trunk
[ Martin Pitt ]
* POT update
[ Ken VanDine ]
* Added setting for dialpad sounds to both the sound and phone panels.
[ CI bot ]
* Resync trunk
[ Diego Sarmentero ]
* Fix out of sync image download. Refresh scope after installation
  (LP: #1324923)
[ Sebastien Bacher ]
* [battery] refresh the graph on a minute basis
* [notifications] use normal text style and ubuntushaped icons
[ Michael Terry ]
* When changing to swipe mode, it was possible that our policykit
  agent would not unregister itself, making the next attempt to change
  modes appear to work, but in truth fail. Also, no longer ask for a
  password to switch to swipe mode if policykit has a cached
  authentication for us. (LP: #1350381)
[ Sebastien Bacher ]
* [security] tweak some pin locking details to match the design better
[ Michael Terry ]
* Implement the "When locked, allow:" portion of the Security &
  Privacy panel, so now the user can control whether the launcher
  and/or indicators are available while locked. (LP: #1358340) (LP:
  #1358340)
[ Michael Terry ]
* Update look and feel of wizard to more closely match the visual
  design.
[ Jussi Pakkanen ]
* Minor cleanups.
[ Roberto Alsina ]
* Don't crash the push helper in locales that have no .mo file (LP:
  #1357506)
[ Ken VanDine ]
* SIM PIN lock implementation
[ jonas-drange ]
* [main panel] add visual feedback on press
* [cellular] uses modemtechnologies property from ofono to populate
  technology preference options (LP: #1346790)
[ Sebastien Bacher ]
* [language] workaround inconsistent languages casing (LP: #1362123)
* [background] Display the default background selected (LP: #1349329)
* [storage] display translated names (LP: #1360207)
* [updates] don't display animations when clicking on update rows (LP:
  #1360364)
* [background] don't use an icon in the headerbar (LP: #1362122)
[ Mathieu Trudel-Lapierre ]
* Fix PIN code or passcode requests by properly matching the tag for
  the original request. (LP: #1355152)
[ Martin Pitt ]
* Update PO template
[ Sebastien Bacher ]
* Include extra files for translations (LP: #1359267)
[ jonas-drange ]
* [main panel] show rotation lock, point to correct setting
[ Ken VanDine ]
* Hide sleep locks immediately setting, which isn't implemented yet
  (LP: #1361297) (LP: #1361297)
[ Sebastien Bacher ]
* [system-update] rework the ui to use a column rather than anchors,
  the layout is quite dynamic and it should be easier to position and
  stack widgets this way (LP: #1343172)
[ Michael Terry ]
* After selecting the language, update the session environment
  immediately and restart indicators so that their notifications (like
  wifi prompt) are translated. (LP: #1354325)
[ Ken VanDine ]
* Added autopilot tests for security-privacy
[ jonas-drange ]
* [phone] adding dual sim functionality to phone panel
[ Charles Kerr ]
* In the welcome wizard, refresh the text in the 'no sim card' and
  'all done' pages to match the latest from design.
[ Michael Terry ]
* Add a location page and a terms and conditions page for the HERE
  service.
[ Ken VanDine ]
* Settings for idle/lock timeout (LP: #1230345)
* Added flickable to fix scrolling (LP: #1354161)
[ Jussi Pakkanen ]
* Fix a bunch of compiler warnings.
[ jonas-drange ]
* [cellular] displays cellular UIs based on how many SIMs are present.
  (LP: #1357393)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import GSettings 1.0
22
22
import QMenuModel 0.1
23
 
import QtQuick 2.0
24
 
import Ubuntu.Components 0.1
 
23
import Qt.labs.folderlistmodel 2.1
 
24
import QtQuick 2.3
 
25
import Ubuntu.Components 1.1
25
26
import Ubuntu.Components.ListItems 0.1 as ListItem
 
27
import Ubuntu.SystemSettings.SecurityPrivacy 1.0
26
28
import SystemSettings 1.0
27
29
 
28
30
ItemPage {
29
 
    id: dashPage
 
31
    id: locationPage
30
32
    title: i18n.tr("Location")
31
 
 
32
 
    Column {
33
 
        anchors.left: parent.left
34
 
        anchors.right: parent.right
35
 
 
36
 
        QDBusActionGroup {
37
 
            id: locationActionGroup
38
 
            busType: DBus.SessionBus
39
 
            busName: "com.canonical.indicator.location"
40
 
            objectPath: "/com/canonical/indicator/location"
41
 
 
42
 
            property variant enabled: action("location-detection-enabled")
43
 
 
44
 
            Component.onCompleted: start()
45
 
        }
46
 
 
47
 
        ListItem.Standard {
48
 
            text: i18n.tr("Location detection")
49
 
            control: Switch {
50
 
                id: locationOn
51
 
                onClicked: locationActionGroup.enabled.activate()
52
 
            }
53
 
            visible: locationActionGroup.enabled.state !== undefined
54
 
            Component.onCompleted:
55
 
                clicked.connect(locationOn.clicked)
56
 
        }
57
 
 
58
 
        Binding {
59
 
            target: locationOn
60
 
            property: "checked"
61
 
            value: locationActionGroup.enabled.state
62
 
        }
63
 
 
64
 
        ListItem.Caption {
65
 
            /* TODO: replace by real info from the location service */
66
 
            property int locationInfo: 0
67
 
 
68
 
            text: {
69
 
                if (locationInfo === 0) /* GPS only */
70
 
                    return i18n.tr("Uses GPS to detect your rough location. When off, GPS turns off to save battery.")
71
 
                else if (locationInfo === 1) /* GPS, wi-fi on */
72
 
                    return i18n.tr("Uses wi-fi and GPS to detect your rough location. Turning off location detection saves battery.")
73
 
                else if (locationInfo === 2) /* GPS, wi-fi off */
74
 
                    return i18n.tr("Uses wi-fi (currently off) and GPS to detect your rough location. Turning off location detection saves battery.")
75
 
                else if (locationInfo === 3) /* GPS, wi-fi and cellular on */
76
 
                    return i18n.tr("Uses wi-fi, cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
77
 
                else if (locationInfo === 4) /* GPS, wi-fi on, cellular off */
78
 
                    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.")
79
 
                else if (locationInfo === 5) /* GPS, wi-fi off, cellular on */
80
 
                    return i18n.tr("Uses wi-fi (currently off), cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
81
 
                else if (locationInfo === 6) /* GPS, wi-fi and cellular off */
82
 
                    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.")
83
 
            }
84
 
 
85
 
            visible: showAllUI
86
 
        }
87
 
 
88
 
        ListItem.Standard {
89
 
            text: i18n.tr("Allow access to location:")
90
 
            visible: showAllUI && locationOn.checked
91
 
        }
92
 
 
93
 
        Repeater {
94
 
            model: ["Browser", "Camera", "Clock", "Weather"]
95
 
            ListItem.Standard {
96
 
                text: modelData
97
 
                control: Switch { checked: true; enabled: false}
98
 
                visible: showAllUI && locationOn.checked
99
 
            }
100
 
        }
 
33
    flickable: scrollWidget
 
34
 
 
35
    property bool useNone: !useLocation
 
36
    property bool canLocate: locationActionGroup.enabled.state !== undefined
 
37
    property bool useLocation: canLocate && locationActionGroup.enabled.state
 
38
    property bool hereInstalled: securityPrivacy.hereLicensePath !== "" && termsModel.count > 0
 
39
    property bool useHere: hereInstalled && securityPrivacy.hereEnabled
 
40
 
 
41
    onUseLocationChanged: {
 
42
        var newIndex;
 
43
        if (useLocation) {
 
44
            newIndex = useHere ? 1 : 0;
 
45
        } else {
 
46
            newIndex = detection.model.count - 1;
 
47
        }
 
48
        detection.selectedIndex = newIndex;
 
49
    }
 
50
 
 
51
    onCanLocateChanged: {
 
52
        optionsModel.createModel();
 
53
    }
 
54
 
 
55
    onHereInstalledChanged: {
 
56
        optionsModel.createModel();
 
57
    }
 
58
 
 
59
    UbuntuSecurityPrivacyPanel {
 
60
        id: securityPrivacy
 
61
    }
 
62
 
 
63
    FolderListModel {
 
64
        id: termsModel
 
65
        folder: securityPrivacy.hereLicensePath
 
66
        nameFilters: ["*.html"]
 
67
        showDirs: false
 
68
        showOnlyReadable: true
 
69
    }
 
70
 
 
71
    QDBusActionGroup {
 
72
        id: locationActionGroup
 
73
        busType: DBus.SessionBus
 
74
        busName: "com.canonical.indicator.location"
 
75
        objectPath: "/com/canonical/indicator/location"
 
76
        property variant enabled: action("location-detection-enabled")
 
77
        Component.onCompleted: start()
 
78
    }
 
79
 
 
80
    Flickable {
 
81
        id: scrollWidget
 
82
        anchors.fill: parent
 
83
        contentHeight: contentItem.childrenRect.height
 
84
        boundsBehavior: (contentHeight > locationPage.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
 
85
        /* Set the direction to workaround https://bugreports.qt-project.org/browse/QTBUG-31905
 
86
           otherwise the UI might end up in a situation where scrolling doesn't work */
 
87
        flickableDirection: Flickable.VerticalFlick
 
88
 
 
89
        Column {
 
90
            anchors.left: parent.left
 
91
            anchors.right: parent.right
 
92
 
 
93
            ListItem.ItemSelector {
 
94
                id: detection
 
95
 
 
96
                /* Helper that toggles location detection and HERE based on
 
97
                what selector element was tapped. */
 
98
                function activate (key) {
 
99
                    var usingLocation = locationActionGroup.enabled.state;
 
100
                    if (key === 'none' && usingLocation) {
 
101
                        // turns OFF location detection
 
102
                        locationActionGroup.enabled.activate();
 
103
                    }
 
104
                    if ( (key === 'gps' || key === 'here') && !usingLocation) {
 
105
                        // turns ON location detection
 
106
                        locationActionGroup.enabled.activate();
 
107
                    }
 
108
                    if (locationPage.hereInstalled) {
 
109
                        // toggles whether HERE is enabled
 
110
                        securityPrivacy.hereEnabled = key === 'here';
 
111
                    }
 
112
                }
 
113
                property bool allow: selectedIndex !== (model.count - 1)
 
114
 
 
115
                text: i18n.tr("Let the phone detect your location:")
 
116
                expanded: true
 
117
                model: optionsModel
 
118
                delegate: optionsDelegate
 
119
                selectedIndex: {
 
120
                    if (model.count === 0) return 0; // re-creating
 
121
                    if (useNone) return model.count - 1;
 
122
                    if (useLocation && !useHere) return 0;
 
123
                    if (useHere && useLocation) return 1;
 
124
                }
 
125
                onDelegateClicked: {
 
126
                    activate(model.get(index).key);
 
127
                }
 
128
            }
 
129
 
 
130
            Component {
 
131
                id: optionsDelegate
 
132
                OptionSelectorDelegate {
 
133
 
 
134
                    id: dlgt
 
135
                    text: " "
 
136
                    height: label.height
 
137
                    Label {
 
138
                        id: label
 
139
                        anchors {
 
140
                            left: parent.left
 
141
                            right: parent.right
 
142
                            margins: units.gu(2)
 
143
                            rightMargin: units.gu(6)
 
144
                        }
 
145
                        textFormat: Text.StyledText
 
146
                        text: name
 
147
                        wrapMode: Text.WordWrap
 
148
                        verticalAlignment: Text.AlignVCenter
 
149
                        height: contentHeight + units.gu(4)
 
150
                        onLinkActivated: {
 
151
                            pageStack.push(Qt.resolvedUrl(link))
 
152
                        }
 
153
                        onLineLaidOut: {
 
154
                            dlgt.height = label.height
 
155
                        }
 
156
                    }
 
157
                }
 
158
             }
 
159
 
 
160
 
 
161
            ListModel {
 
162
                id: optionsModel
 
163
 
 
164
                function createModel () {
 
165
                    clear();
 
166
 
 
167
                    if (canLocate) {
 
168
                        optionsModel.append({
 
169
                            name: hereInstalled ?
 
170
                                i18n.tr("Using GPS only (less accurate)") :
 
171
                                i18n.tr("Using GPS"),
 
172
                            key: "gps"
 
173
                        });
 
174
                    }
 
175
 
 
176
                    if (hereInstalled) {
 
177
                        optionsModel.append({
 
178
                            /* TRANSLATORS: %1 is the resource wherein HERE
 
179
                            terms and conditions reside (typically a qml file).
 
180
                            HERE is a Nokia trademark, so it should probably
 
181
                            not be translated. */
 
182
                            name: i18n.tr("Using GPS, anonymized Wi-Fi and cellular network info.<br>By selecting this option you accept the <a href='%1'>Nokia HERE terms and conditions</a>.").arg("here-terms.qml"),
 
183
                            key: "here"
 
184
                        });
 
185
                    }
 
186
 
 
187
                    optionsModel.append({
 
188
                        name: i18n.tr("Not at all"),
 
189
                        key: "none"
 
190
                    });
 
191
                }
 
192
 
 
193
                dynamicRoles: true
 
194
                Component.onCompleted: {
 
195
                    createModel();
 
196
                }
 
197
            }
 
198
 
 
199
            ListItem.Caption {
 
200
                /* TODO: replace by real info from the location service */
 
201
                property int locationInfo: 0
 
202
 
 
203
                text: {
 
204
                    if (locationInfo === 0) /* GPS only */
 
205
                        return i18n.tr("Uses GPS to detect your rough location. When off, GPS turns off to save battery.")
 
206
                    else if (locationInfo === 1) /* GPS, wi-fi on */
 
207
                        return i18n.tr("Uses wi-fi and GPS to detect your rough location. Turning off location detection saves battery.")
 
208
                    else if (locationInfo === 2) /* GPS, wi-fi off */
 
209
                        return i18n.tr("Uses wi-fi (currently off) and GPS to detect your rough location. Turning off location detection saves battery.")
 
210
                    else if (locationInfo === 3) /* GPS, wi-fi and cellular on */
 
211
                        return i18n.tr("Uses wi-fi, cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
 
212
                    else if (locationInfo === 4) /* GPS, wi-fi on, cellular off */
 
213
                        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.")
 
214
                    else if (locationInfo === 5) /* GPS, wi-fi off, cellular on */
 
215
                        return i18n.tr("Uses wi-fi (currently off), cell tower locations, and GPS to detect your rough location. Turning off location detection saves battery.")
 
216
                    else if (locationInfo === 6) /* GPS, wi-fi and cellular off */
 
217
                        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.")
 
218
                }
 
219
 
 
220
                visible: showAllUI /* hide until the information is real */
 
221
            }
 
222
 
 
223
            ListItem.Divider {}
 
224
 
 
225
            ListItem.Standard {
 
226
                text: i18n.tr("Allow access to location:")
 
227
                enabled: detection.allow
 
228
            }
 
229
 
 
230
            TrustStoreModel {
 
231
                id: trustStoreModel
 
232
                serviceName: "UbuntuLocationService"
 
233
            }
 
234
 
 
235
            Repeater {
 
236
                model: trustStoreModel
 
237
                ListItem.Standard {
 
238
                    text: model.applicationName
 
239
                    iconSource: model.iconName
 
240
                    control: Switch {
 
241
                        checked: model.granted
 
242
                        onClicked: trustStoreModel.setEnabled(index, !model.granted)
 
243
                    }
 
244
                    enabled: detection.allow
 
245
                }
 
246
            }
 
247
 
 
248
            ListItem.Standard {
 
249
                text: i18n.tr("None requested")
 
250
                visible: trustStoreModel.count === 0
 
251
                enabled: false
 
252
            }
 
253
        }
 
254
 
101
255
    }
102
256
}