on xenial help sign in
switch to a ListView; fix activating an AP
d2aeca1Lukáš Tinkl
qml/Wizard/Pages.qml+1−1
@@ -31,7 +31,7 @@ Item {
31 // the user exits the wizard.
31 // the user exits the wizard.
32 property int passwordMethod: UbuntuSecurityPrivacyPanel.Passphrase
32 property int passwordMethod: UbuntuSecurityPrivacyPanel.Passphrase
33 property string password: ""
33 property string password: ""
34− property string countryCode: "US"
34+ property string countryCode: "US" // default country (for the timezone page)
35
35
36 UbuntuSecurityPrivacyPanel {
36 UbuntuSecurityPrivacyPanel {
37 id: securityPrivacy
37 id: securityPrivacy
qml/Wizard/Pages/30-wifi.qml+29−41
@@ -1,4 +1,4 @@
1−/*
1+/*
2 * Copyright (C) 2013 Canonical, Ltd.
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * This program is free software; you can redistribute it and/or modify
@@ -63,7 +63,7 @@ LocalComponents.Page {
63 function getAccessPointName() {
63 function getAccessPointName() {
64 // 0 is the interface
64 // 0 is the interface
65 if (currentNetworkMode === NetworkInfo.WlanMode &&
65 if (currentNetworkMode === NetworkInfo.WlanMode &&
66− networkStatus(NetworkInfo.WlanMode, 0) === NetworkInfo.HomeNetwork)
66+ networkStatus(NetworkInfo.WlanMode, 0) === NetworkInfo.HomeNetwork)
67 accessPointName = networkName(NetworkInfo.WlanMode, 0);
67 accessPointName = networkName(NetworkInfo.WlanMode, 0);
68 else
68 else
69 accessPointName = "";
69 accessPointName = "";
@@ -84,23 +84,26 @@ LocalComponents.Page {
84 index: menuIndex
84 index: menuIndex
85 name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "")
85 name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "")
86 }
86 }
87− property bool checked: menuData && menuData.isToggled || false
88− property bool secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false)
87+ readonly property bool secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false)
89− property bool adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false)
88+ readonly property bool adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false)
90− property bool enterprise: getExtendedProperty(extendedData, "xCanonicalWifiApIsEnterprise", false)
89+ readonly property bool enterprise: getExtendedProperty(extendedData, "xCanonicalWifiApIsEnterprise", false)
90+ readonly property bool isAccessPoint: menuData.type === "unity.widgets.systemsettings.tablet.accesspoint"
91 property int signalStrength: strengthAction.valid ? strengthAction.state : 0
91 property int signalStrength: strengthAction.valid ? strengthAction.state : 0
92 property int menuIndex: -1
92 property int menuIndex: -1
93
93
94 function loadAttributes() {
94 function loadAttributes() {
95 if (!unityMenuModel || menuIndex == -1) return;
95 if (!unityMenuModel || menuIndex == -1) return;
96 unityMenuModel.loadExtendedAttributes(menuIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool',
96 unityMenuModel.loadExtendedAttributes(menuIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool',
97− 'x-canonical-wifi-ap-is-secure': 'bool',
97+ 'x-canonical-wifi-ap-is-secure': 'bool',
98− 'x-canonical-wifi-ap-is-enterprise': 'bool',
98+ 'x-canonical-wifi-ap-is-enterprise': 'bool',
99− 'x-canonical-wifi-ap-strength-action': 'string'});
99+ 'x-canonical-wifi-ap-strength-action': 'string'});
100 }
100 }
101
101
102+ signal activate()
103+
102 text: menuData && menuData.label || ""
104 text: menuData && menuData.label || ""
103 enabled: menuData && menuData.sensitive || false
105 enabled: menuData && menuData.sensitive || false
106+ height: isAccessPoint && !enterprise ? units.gu(6) : 0
104 visible: !enterprise
107 visible: !enterprise
105 __foregroundColor: "#525252"
108 __foregroundColor: "#525252"
106 showDivider: true
109 showDivider: true
@@ -125,7 +128,7 @@ LocalComponents.Page {
125 return imageName;
128 return imageName;
126 }
129 }
127 iconFrame: false
130 iconFrame: false
128− onClicked: unityMenuModel.activate(menuIndex);
131+ onClicked: accessPoint.activate();
129
132
130 Component.onCompleted: {
133 Component.onCompleted: {
131 loadAttributes();
134 loadAttributes();
@@ -136,6 +139,7 @@ LocalComponents.Page {
136 onMenuIndexChanged: {
139 onMenuIndexChanged: {
137 loadAttributes();
140 loadAttributes();
138 }
141 }
142+ onActivate: unityMenuModel.activate(menuIndex);
139 }
143 }
140 }
144 }
141
145
@@ -151,45 +155,29 @@ LocalComponents.Page {
151 anchors.right: parent.right
155 anchors.right: parent.right
152 font.weight: Font.Light
156 font.weight: Font.Light
153 color: "#525252"
157 color: "#525252"
154− text: mainMenu.count > 0 ? i18n.tr("Available Wi-Fi networks")
158+ text: listview.count > 0 ? i18n.tr("Available Wi-Fi networks")
155 : i18n.tr("No available Wi-Fi networks")
159 : i18n.tr("No available Wi-Fi networks")
156 }
160 }
157
161
158− Flickable {
162+ ListView {
163+ id: listview
159 anchors.left: parent.left
164 anchors.left: parent.left
160 anchors.right: parent.right
165 anchors.right: parent.right
161− height: column.height - label.height - column.spacing
166+ model: menuModel
162− contentHeight: contentItem.childrenRect.height
163− clip: true
164− flickDeceleration: 1500 * units.gridUnit / 8
165− maximumFlickVelocity: 2500 * units.gridUnit / 8
166− boundsBehavior: (contentHeight > height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds
167−
168− Column {
169− anchors.left: parent.left
170− anchors.right: parent.right
171−
172− Repeater {
173− id: mainMenu
174
167
175− model: menuModel
168+ delegate: Loader {
169+ id: loader
176
170
177− delegate: Loader {
171+ readonly property bool isAccessPoint: model.type === "unity.widgets.systemsettings.tablet.accesspoint"
178− id: loader
179
172
180− readonly property bool isAccessPoint: model.type === "unity.widgets.systemsettings.tablet.accesspoint"
181−
182− anchors.left: parent.left
173+ anchors.left: parent.left
183− anchors.right: parent.right
174+ anchors.right: parent.right
184− height: isAccessPoint ? units.gu(6) : 0
185− asynchronous: true
175+ asynchronous: true
186− sourceComponent: isAccessPoint ? accessPointComponent : null
176+ sourceComponent: isAccessPoint ? accessPointComponent : null
187
177
188− onLoaded: {
178+ onLoaded: {
189− item.menuData = Qt.binding(function() { return model; });
179+ item.menuData = Qt.binding(function() { return model; });
190− item.menuIndex = Qt.binding(function() { return index; });
180+ item.menuIndex = Qt.binding(function() { return index; });
191− }
192− }
193 }
181 }
194 }
182 }
195 }
183 }
@@ -198,7 +186,7 @@ LocalComponents.Page {
198 Component {
186 Component {
199 id: forwardButton
187 id: forwardButton
200 LocalComponents.StackButton {
188 LocalComponents.StackButton {
201− text: (connected || mainMenu.count === 0) ? i18n.tr("Next") : i18n.tr("Skip")
189+ text: (connected || listview.count === 0) ? i18n.tr("Next") : i18n.tr("Skip")
202 onClicked: pageStack.next()
190 onClicked: pageStack.next()
203 }
191 }
204 }
192 }
qml/Wizard/Pages/50-timezone.qml+2−4
@@ -121,9 +121,7 @@ LocalComponents.Page {
121 }
121 }
122
122
123 height: column.height - searchField.height - column.spacing - topMargin
123 height: column.height - searchField.height - column.spacing - topMargin
124−
125 model: tzFilterModel
124 model: tzFilterModel
126−
127 delegate: tzComponent
125 delegate: tzComponent
128 }
126 }
129 }
127 }
@@ -134,8 +132,8 @@ LocalComponents.Page {
134 text: i18n.tr("Next")
132 text: i18n.tr("Next")
135 enabled: selectedTimeZone != ""
133 enabled: selectedTimeZone != ""
136 onClicked: {
134 onClicked: {
137− UbuntuTimeDatePanel.timeZone = selectedTimeZone
135+ UbuntuTimeDatePanel.timeZone = selectedTimeZone;
138− pageStack.next()
136+ pageStack.next();
139 }
137 }
140 }
138 }
141 }
139 }