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

« back to all changes in this revision

Viewing changes to plugins/hotspot/HotspotSetup.qml

  • Committer: Bileto Bot
  • Author(s): Ken VanDine
  • Date: 2016-07-22 14:38:13 UTC
  • mfrom: (1556.3.32 slotsLayout)
  • Revision ID: ci-train-bot@canonical.com-20160722143813-ht9e4766lm0ie5fa
Ported to use Slots layout and updated visuals (LP: #1596529)

Approved by: Jonas G. Drange

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * This file is part of system-settings
3
3
 *
4
 
 * Copyright (C) 2014 Canonical Ltd.
 
4
 * Copyright (C) 2014-2016 Canonical Ltd.
5
5
 *
6
6
 * This program is free software: you can redistribute it and/or modify it
7
7
 * under the terms of the GNU General Public License version 3, as published
19
19
import QtQuick 2.4
20
20
import QtQuick.Layouts 1.1
21
21
import SystemSettings 1.0
 
22
import SystemSettings.ListItems 1.0 as SettingsListItems
22
23
import Ubuntu.Components 1.3
23
 
import Ubuntu.Components.ListItems 1.3 as ListItem
 
24
import Ubuntu.Components.ListItems 1.3 as ListItems
24
25
import Ubuntu.Components.Popups 1.3
25
26
import Ubuntu.Connectivity 1.0
26
27
import Ubuntu.SystemSettings.Cellular 1.0
187
188
                width: parent.width
188
189
            }
189
190
 
190
 
            ListItem.Empty {
 
191
            SettingsListItems.Standard {
191
192
                id: passwordRequired
192
 
                onClicked: passwordRequiredToggle.trigger()
 
193
                text: i18n.tr("Require a password (recommended):")
 
194
                showDivider: false
 
195
                layout.padding.leading: 0
 
196
                SlotsLayout.padding.leading: 0
193
197
 
194
198
                CheckBox {
195
199
                    id: passwordRequiredToggle
196
200
                    objectName: "passwordRequiredToggle"
197
201
                    checked: Connectivity.hotspotAuth === "wpa-psk"
198
 
                    anchors {
199
 
                        left: parent.left
200
 
                        verticalCenter: parent.verticalCenter
201
 
                    }
 
202
                    SlotsLayout.position: SlotsLayout.First
 
203
                    SlotsLayout.padding.leading: 0
202
204
                    // FIXME: Workaround for lp:1415023
203
205
                    activeFocusOnPress: false
204
206
                }
205
 
 
206
 
                Label {
207
 
                    id: passwordRequiredLabel
208
 
                    anchors {
209
 
                        left: passwordRequiredToggle.right
210
 
                        leftMargin: units.gu(1)
211
 
                        right: parent.right
212
 
                        verticalCenter: parent.verticalCenter
213
 
                    }
214
 
 
215
 
                    // FIXME: Workaround for label not wrapping (lp:1442851)
216
 
                    wrapMode: Text.Wrap
217
 
                    text: i18n.tr("Require a password (recommended):")
218
 
                }
 
207
                onClicked: passwordRequiredToggle.trigger()
219
208
            }
220
209
 
221
210
            TextField {
229
218
                width: parent.width
230
219
            }
231
220
 
232
 
            ListItem.Empty {
 
221
            SettingsListItems.Standard {
233
222
                id: passwordVisible
234
223
                enabled: passwordRequiredToggle.checked
235
 
                onClicked: passwordVisibleToggle.trigger()
 
224
                text: i18n.tr("Show password")
 
225
                layout.padding.leading: 0
 
226
                SlotsLayout.padding.leading: 0
236
227
 
237
228
                CheckBox {
238
229
                    id: passwordVisibleToggle
239
230
                    enabled: parent.enabled
240
 
                    anchors {
241
 
                        left: parent.left
242
 
                        verticalCenter: parent.verticalCenter
243
 
                    }
244
 
 
 
231
                    SlotsLayout.position: SlotsLayout.First
 
232
                    SlotsLayout.padding.leading: 0
245
233
                    // FIXME: Workaround for lp:1415023
246
234
                    activeFocusOnPress: false
247
235
                }
248
 
 
249
 
                Label {
250
 
                    id: passwordVisibleLabel
251
 
 
252
 
                    /* FIXME: use enabled when lp:1491802 is fixed, or use
253
 
                    CheckBox.text once lp:1323238 is fixed. */
254
 
                    opacity: passwordRequiredToggle.checked ? 1 : 0.5
255
 
                    anchors {
256
 
                        left: passwordVisibleToggle.right
257
 
                        leftMargin: units.gu(1)
258
 
                        verticalCenter: parent.verticalCenter
259
 
                    }
260
 
                    text: i18n.tr("Show password")
261
 
                }
 
236
                onClicked: passwordVisibleToggle.trigger()
262
237
            }
263
238
 
264
 
            ListItem.Caption {
 
239
            ListItems.Caption {
265
240
                id: enableWifiCaption
266
241
                anchors {
267
242
                    left: parent.left