Merge lp:~cimi/ubuntu-system-settings/wizard.wifi-fixes into lp:ubuntu-system-settings
- wizard.wifi-fixes
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Michael Terry | ||||||||
Approved revision: | 977 | ||||||||
Merged at revision: | 985 | ||||||||
Proposed branch: | lp:~cimi/ubuntu-system-settings/wizard.wifi-fixes | ||||||||
Merge into: | lp:ubuntu-system-settings | ||||||||
Diff against target: |
286 lines (+139/-79) 4 files modified
po/it.po (+2/-2) wizard/qml/Components/Page.qml (+1/-1) wizard/qml/Pages/20-wifi.qml (+125/-76) wizard/qml/main.qml (+11/-0) |
||||||||
To merge this branch: | bzr merge lp:~cimi/ubuntu-system-settings/wizard.wifi-fixes | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Terry (community) | Approve | ||
PS Jenkins bot | continuous-integration | Needs Fixing | |
Review via email: mp+233071@code.launchpad.net |
Commit message
Various fixes for wifi wizard page
Description of the change
* Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
y
* Did you build your software in a clean sbuild/pbuilder chroot or ppa?
n
* Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
n
* Has your component "TestPlan” been executed successfully on emulator, N4?
n
* Has a 5 minute exploratory testing run been executed on N4?
y
* If you changed the packaging (debian), did you subscribe a core-dev to this MP?
n
* If you changed the UI, did you subscribe the design-reviewers to this MP?
n
* What components might get impacted by your changes?
wizard
* Have you requested review by the teams of these owning components?
yes
- 974. By Andrea Cimitan
-
Locale update
Michael Terry (mterry) wrote : | # |
Michael Terry (mterry) : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:973
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 975. By Andrea Cimitan
-
using repeater
Andrea Cimitan (cimi) wrote : | # |
Comments inline
- 976. By Andrea Cimitan
-
Use null component
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:974
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Michael Terry (mterry) wrote : | # |
It's really hard to have a conversation inline when LP clears the slate every commit. Feels weird to go back to an old commit just to reply. So I'll just reply here.
About anchors: I've certainly seen the block format before, but I've never liked it. It wastes two whole lines for no benefit. I won't block this MP on that change, but I'm not a fan, and it's certainly not related to your other code changes.
About the list: I feel like it flashes a little bit when loading. And changes around a lot when you select an entry. Is that something we can do anything about on our end?
Also, you can't deselect an entry. Not necessarily something a user will want to do often, but since there is a checkbox on the right, it feels weird that they don't act like checkboxes. The design has just a check, but not a checkbox. Could we make it look like that?
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:976
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 977. By Andrea Cimitan
-
Review comments
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:977
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Michael Terry (mterry) wrote : | # |
You didn't answer my deselect question.
And the list is still jumpy. When I select an entry, the design visuals do not involve that entry jumping to the top. If you are scrolled down in a big list, it makes it look like the entry disappears after clicking it.
Andrea Cimitan (cimi) wrote : | # |
> You didn't answer my deselect question.
>
> And the list is still jumpy. When I select an entry, the design visuals do
> not involve that entry jumping to the top. If you are scrolled down in a big
> list, it makes it look like the entry disappears after clicking it.
Both those issues cannot be implemented now, as they are related to the backend. We have in fact the same issues on unity and system settings
Michael Terry (mterry) wrote : | # |
OK. You filed bug 1349371 about the jumping bit, thanks!
Michael Terry (mterry) wrote : | # |
* Are any changes against your component pending/needed to land the MP under review in a functional state and are those called out explicitly by the submitter?
NA
* Did you do exploratory testing related to the component you own with the MP changeset included?
Yes
* Has the submitter requested review by all the relevant teams/reviewers?
Yes
* If you are the reviewer owning the component the MP is against, have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes
Preview Diff
1 | === modified file 'po/it.po' |
2 | --- po/it.po 2014-09-03 07:03:52 +0000 |
3 | +++ po/it.po 2014-09-03 09:51:49 +0000 |
4 | @@ -1748,8 +1748,8 @@ |
5 | msgstr "Sistema" |
6 | |
7 | #: ../wizard/qml/Pages//20-wifi.qml:27 |
8 | -msgid "Connect to Wi-Fi" |
9 | -msgstr "Connetti alla rete Wi-Fi" |
10 | +msgid "Connect to Wi‑Fi" |
11 | +msgstr "Connetti alla rete Wi‑Fi" |
12 | |
13 | #: ../wizard/qml/Pages//20-wifi.qml:66 |
14 | msgid "Available networks" |
15 | |
16 | === modified file 'wizard/qml/Components/Page.qml' |
17 | --- wizard/qml/Components/Page.qml 2014-08-26 21:19:55 +0000 |
18 | +++ wizard/qml/Components/Page.qml 2014-09-03 09:51:49 +0000 |
19 | @@ -25,7 +25,7 @@ |
20 | readonly property real topMargin: units.gu(8) |
21 | readonly property real leftMargin: units.gu(2) |
22 | readonly property real rightMargin: units.gu(2) |
23 | - readonly property real bottomMargin: backButton.height + buttonMargin * 3 |
24 | + readonly property real bottomMargin: backButton.height + buttonMargin * 2 |
25 | |
26 | property bool hasBackButton: true |
27 | property bool customBack: false |
28 | |
29 | === modified file 'wizard/qml/Pages/20-wifi.qml' |
30 | --- wizard/qml/Pages/20-wifi.qml 2014-08-26 21:19:55 +0000 |
31 | +++ wizard/qml/Pages/20-wifi.qml 2014-09-03 09:51:49 +0000 |
32 | @@ -17,14 +17,14 @@ |
33 | import QtQuick 2.0 |
34 | import QMenuModel 0.1 as QMenuModel |
35 | import Ubuntu.Components 0.1 |
36 | -import Ubuntu.SystemSettings.Wifi 1.0 |
37 | +import Ubuntu.Components.ListItems 0.1 as ListItem |
38 | import Ubuntu.SystemSettings.Wizard.Utils 0.1 |
39 | import Ubuntu.Settings.Menus 0.1 as Menus |
40 | import "../Components" as LocalComponents |
41 | |
42 | LocalComponents.Page { |
43 | id: wifiPage |
44 | - title: i18n.tr("Connect to Wi-Fi") |
45 | + title: i18n.tr("Connect to Wi‑Fi") |
46 | forwardButtonSourceComponent: forwardButton |
47 | |
48 | readonly property bool connected: mainMenu.connectedAPs === 1 |
49 | @@ -36,15 +36,95 @@ |
50 | return defaultValue; |
51 | } |
52 | |
53 | - SortFilterProxyModel { |
54 | + QMenuModel.UnityMenuModel { |
55 | id: menuModel |
56 | - filterRole: 5 // UnityMenuModel.TypeRole should really be exported from unitymenumodel |
57 | - filterRegExp: RegExp("unity.widgets.systemsettings.tablet.accesspoint") |
58 | - model: QMenuModel.UnityMenuModel { |
59 | - id: unitymenumodel |
60 | - busName: "com.canonical.indicator.network" |
61 | - actions: { "indicator": "/com/canonical/indicator/network" } |
62 | - menuObjectPath: "/com/canonical/indicator/network/phone_wifi_settings" |
63 | + busName: "com.canonical.indicator.network" |
64 | + actions: { "indicator": "/com/canonical/indicator/network" } |
65 | + menuObjectPath: "/com/canonical/indicator/network/phone_wifi_settings" |
66 | + } |
67 | + |
68 | + Component { |
69 | + id: accessPointComponent |
70 | + ListItem.Standard { |
71 | + id: accessPoint |
72 | + objectName: "accessPoint" |
73 | + |
74 | + property QtObject menuData: null |
75 | + property var unityMenuModel: menuModel |
76 | + property var extendedData: menuData && menuData.ext || undefined |
77 | + property var strengthAction: QMenuModel.UnityMenuAction { |
78 | + model: unityMenuModel |
79 | + index: menuIndex |
80 | + name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "") |
81 | + } |
82 | + property bool checked: menuData && menuData.isToggled || false |
83 | + property bool secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false) |
84 | + property bool adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false) |
85 | + property int signalStrength: strengthAction.valid ? strengthAction.state : 0 |
86 | + property int menuIndex: -1 |
87 | + |
88 | + function loadAttributes() { |
89 | + if (!unityMenuModel || menuIndex == -1) return; |
90 | + unityMenuModel.loadExtendedAttributes(menuIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool', |
91 | + 'x-canonical-wifi-ap-is-secure': 'bool', |
92 | + 'x-canonical-wifi-ap-strength-action': 'string'}); |
93 | + } |
94 | + |
95 | + signal activate() |
96 | + |
97 | + text: menuData && menuData.label || "" |
98 | + enabled: menuData && menuData.sensitive || false |
99 | + iconName: { |
100 | + var imageName = "nm-signal-100"; |
101 | + |
102 | + if (adHoc) { |
103 | + imageName = "nm-adhoc"; |
104 | + } else if (signalStrength == 0) { |
105 | + imageName = "nm-signal-00"; |
106 | + } else if (signalStrength <= 25) { |
107 | + imageName = "nm-signal-25"; |
108 | + } else if (signalStrength <= 50) { |
109 | + imageName = "nm-signal-50"; |
110 | + } else if (signalStrength <= 75) { |
111 | + imageName = "nm-signal-75"; |
112 | + } |
113 | + |
114 | + if (secure) { |
115 | + imageName += "-secure"; |
116 | + } |
117 | + return imageName; |
118 | + } |
119 | + iconFrame: false |
120 | + control: CheckBox { |
121 | + id: checkBoxActive |
122 | + |
123 | + onClicked: { |
124 | + accessPoint.activate(); |
125 | + } |
126 | + } |
127 | + style: Rectangle { |
128 | + color: "#4c000000" |
129 | + } |
130 | + |
131 | + Component.onCompleted: { |
132 | + loadAttributes(); |
133 | + } |
134 | + onUnityMenuModelChanged: { |
135 | + loadAttributes(); |
136 | + } |
137 | + onMenuIndexChanged: { |
138 | + loadAttributes(); |
139 | + } |
140 | + onCheckedChanged: { |
141 | + // Can't rely on binding. Checked is assigned on click. |
142 | + checkBoxActive.checked = checked; |
143 | + if (checked) { |
144 | + mainMenu.connectedAPs++ |
145 | + } else { |
146 | + mainMenu.connectedAPs-- |
147 | + } |
148 | + } |
149 | + onActivate: unityMenuModel.activate(menuIndex); |
150 | } |
151 | } |
152 | |
153 | @@ -66,76 +146,45 @@ |
154 | text: i18n.tr("Available networks") |
155 | } |
156 | |
157 | - ListView { |
158 | - id: mainMenu |
159 | - |
160 | - property int connectedAPs: 0 |
161 | - |
162 | - model: menuModel |
163 | + Flickable { |
164 | + anchors.left: parent.left |
165 | + anchors.right: parent.right |
166 | height: column.height - label.height - column.spacing |
167 | - anchors.left: parent.left |
168 | - anchors.right: parent.right |
169 | + contentHeight: contentItem.childrenRect.height |
170 | clip: true |
171 | - |
172 | - // Ensure all delegates are cached in order to improve smoothness of scrolling |
173 | - cacheBuffer: 10000 |
174 | - |
175 | - // Only allow flicking if the content doesn't fit on the page |
176 | - boundsBehavior: (contentHeight > mainMenu.height) ? |
177 | - Flickable.DragAndOvershootBounds : |
178 | - Flickable.StopAtBounds |
179 | - |
180 | - currentIndex: -1 |
181 | - delegate: Menus.AccessPointMenu { |
182 | - id: menuDelegate |
183 | - |
184 | - property int menuIndex: menuModel.mapRowToSource(index) |
185 | - property var extendedData: model.ext |
186 | - property var serverToggle: model.isToggled |
187 | - property var strengthAction: QMenuModel.UnityMenuAction { |
188 | - model: unitymenumodel |
189 | - index: menuIndex |
190 | - name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "") |
191 | - } |
192 | - |
193 | - anchors { |
194 | - left: parent.left |
195 | - right: parent.right |
196 | - } |
197 | - text: model.label |
198 | - enabled: model.sensitive |
199 | - secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false) |
200 | - adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false) |
201 | - signalStrength: strengthAction.valid ? strengthAction.state : 0 |
202 | - |
203 | - style: Rectangle { |
204 | - color: "black" |
205 | - opacity: 0.3 |
206 | - } |
207 | - |
208 | - onCheckedChanged: { |
209 | - if (checked) { |
210 | - mainMenu.connectedAPs++ |
211 | - } else { |
212 | - mainMenu.connectedAPs-- |
213 | + flickDeceleration: 1500 * units.gridUnit / 8 |
214 | + maximumFlickVelocity: 2500 * units.gridUnit / 8 |
215 | + boundsBehavior: (contentHeight > height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds |
216 | + |
217 | + Column { |
218 | + anchors.left: parent.left |
219 | + anchors.right: parent.right |
220 | + |
221 | + Repeater { |
222 | + id: mainMenu |
223 | + |
224 | + // FIXME Check connection better https://bugs.launchpad.net/indicator-network/+bug/1349371 |
225 | + property int connectedAPs: 0 |
226 | + |
227 | + model: menuModel |
228 | + |
229 | + delegate: Loader { |
230 | + id: loader |
231 | + |
232 | + readonly property bool isAccessPoint: model.type === "unity.widgets.systemsettings.tablet.accesspoint" |
233 | + |
234 | + anchors.left: parent.left |
235 | + anchors.right: parent.right |
236 | + height: isAccessPoint ? units.gu(6) : 0 |
237 | + asynchronous: true |
238 | + sourceComponent: isAccessPoint ? accessPointComponent : null |
239 | + |
240 | + onLoaded: { |
241 | + item.menuData = Qt.binding(function() { return model; }); |
242 | + item.menuIndex = Qt.binding(function() { return index; }); |
243 | + } |
244 | } |
245 | } |
246 | - onMenuIndexChanged: { |
247 | - loadAttributes(); |
248 | - } |
249 | - onServerToggleChanged: { |
250 | - checked = serverToggle; |
251 | - } |
252 | - onTriggered: { |
253 | - unitymenumodel.activate(menuIndex); |
254 | - } |
255 | - |
256 | - function loadAttributes() { |
257 | - if (!unitymenumodel || menuIndex == -1) return; |
258 | - unitymenumodel.loadExtendedAttributes(menuIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool', |
259 | - 'x-canonical-wifi-ap-is-secure': 'bool', |
260 | - 'x-canonical-wifi-ap-strength-action': 'string'}); |
261 | - } |
262 | } |
263 | } |
264 | } |
265 | |
266 | === modified file 'wizard/qml/main.qml' |
267 | --- wizard/qml/main.qml 2014-08-26 21:19:55 +0000 |
268 | +++ wizard/qml/main.qml 2014-09-03 09:51:49 +0000 |
269 | @@ -108,6 +108,17 @@ |
270 | } |
271 | } |
272 | |
273 | + Rectangle { |
274 | + id: modalNotificationBackground |
275 | + visible: notifications.useModal && (notifications.state == "narrow") |
276 | + anchors.fill: parent |
277 | + color: "#80000000" |
278 | + |
279 | + MouseArea { |
280 | + anchors.fill: parent |
281 | + } |
282 | + } |
283 | + |
284 | InputMethod { |
285 | anchors.fill: parent |
286 | } |
Some comments inline.
Also, I noticed that if I flick to the bottom of the wifi list, it refreshes and loses my place. Which makes it hard to select an entry near the bottom (you have to slowly scroll down and be careful not to pull list above end).
Seems to fix the bugs though, and looks more like the design mockups, thanks.