Merge lp:~cimi/ubuntu-system-settings/fix-1363400 into lp:ubuntu-system-settings/rtm-14.09

Proposed by Andrea Cimitan on 2015-01-21
Status: Merged
Approved by: Ken VanDine on 2015-01-23
Approved revision: 967
Merged at revision: 973
Proposed branch: lp:~cimi/ubuntu-system-settings/fix-1363400
Merge into: lp:ubuntu-system-settings/rtm-14.09
Diff against target: 84 lines (+26/-9)
2 files modified
debian/control (+1/-0)
wizard/qml/Pages/40-wifi.qml (+25/-9)
To merge this branch: bzr merge lp:~cimi/ubuntu-system-settings/fix-1363400
Reviewer Review Type Date Requested Status
Ken VanDine 2015-01-21 Approve on 2015-01-23
PS Jenkins bot continuous-integration Approve on 2015-01-23
Review via email: mp+247131@code.launchpad.net

Commit Message

Fix continue button in wifi wizard page, adds qml-module-qtsysteminfo as ubuntu-system-settings-wizard dep

Description of the Change

The vivid part of this lives at https://code.launchpad.net/~cimi/unity8/fix-1363400/+merge/247129

* Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes
 * Did you build your software in a clean sbuild/pbuilder chroot or ppa?
no
 * Did you build your software in a clean sbuild/pbuilder armhf chroot or ppa?
no
 * Has your component "TestPlan” been executed successfully on emulator, N4?
Tested manually the change on my device
 * Has a 5 minute exploratory testing run been executed on N4?
no
 * If you changed the packaging (debian), did you subscribe a core-dev to this MP?
will do soon
 * If you changed the UI, did you subscribe the design-reviewers to this MP?
n/a
 * What components might get impacted by your changes?
wizard
 * Have you requested review by the teams of these owning components?
doing now

To post a comment you must log in.
Ken VanDine (ken-vandine) wrote :

I tested this on mako, with rtm image 174. I verified qml-module-qtsysteminfo is installed, but after connecting to wifi the skip button remains, no continue button.

review: Needs Fixing
Ken VanDine (ken-vandine) wrote :

why not call getAccessPointName in onNetworkStatusChanged if the status was HomeNetwork, instead of in onNetworkNameChanged?

Ken VanDine (ken-vandine) wrote :

I did a little hacking here, the NetworkInfo API isn't very QML friendly. I've proposed a fix that ensures the accessPointName gets set, it's a little hacky though.

https://code.launchpad.net/~ken-vandine/ubuntu-system-settings/fix-1363400/+merge/247341

967. By Andrea Cimitan on 2015-01-23

Should fix rtm on mako

Andrea Cimitan (cimi) wrote :

> why not call getAccessPointName in onNetworkStatusChanged if the status was
> HomeNetwork, instead of in onNetworkNameChanged?
that's a good question, originally I wanted to update the network name when it changes, I am confused by networkStatus possible values, onNetworkNameChanged guarantees to update when the wifi connection changes

Ken VanDine (ken-vandine) wrote :

> > why not call getAccessPointName in onNetworkStatusChanged if the status was
> > HomeNetwork, instead of in onNetworkNameChanged?
> that's a good question, originally I wanted to update the network name when it
> changes, I am confused by networkStatus possible values, onNetworkNameChanged
> guarantees to update when the wifi connection changes

The problem is when it changes, the other properties aren't guaranteed yet. I think this is a buggy API, we shouldn't expect the properties to all be updated when we get the signal.

Ken VanDine (ken-vandine) wrote :

Using the onCurrentNetworkChanged signal as well does indeed fix it. I still worry about this about this API a bit, it's the best we can do without digging deep into QtSystemInfo.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2015-01-14 20:43:55 +0000
3+++ debian/control 2015-01-23 10:04:48 +0000
4@@ -99,6 +99,7 @@
5 Architecture: any
6 Depends: ${misc:Depends},
7 ${shlibs:Depends},
8+ qml-module-qtsysteminfo,
9 ubuntu-system-settings (= ${binary:Version}),
10 unity8 (>= 8.01),
11 Recommends: qtdeclarative5-qtmir-plugin (>= 0.4)
12
13=== modified file 'wizard/qml/Pages/40-wifi.qml'
14--- wizard/qml/Pages/40-wifi.qml 2014-10-07 13:06:50 +0000
15+++ wizard/qml/Pages/40-wifi.qml 2015-01-23 10:04:48 +0000
16@@ -16,6 +16,7 @@
17
18 import QtQuick 2.0
19 import QMenuModel 0.1 as QMenuModel
20+import QtSystemInfo 5.0
21 import Ubuntu.Components 0.1
22 import Ubuntu.Components.ListItems 0.1 as ListItem
23 import Ubuntu.SystemSettings.Wizard.Utils 0.1
24@@ -27,7 +28,7 @@
25 title: i18n.tr("Connect to Wi‑Fi")
26 forwardButtonSourceComponent: forwardButton
27
28- readonly property bool connected: mainMenu.connectedAPs === 1
29+ readonly property bool connected: networkInfo.accessPointName
30
31 function getExtendedProperty(object, propertyName, defaultValue) {
32 if (object && object.hasOwnProperty(propertyName)) {
33@@ -43,6 +44,29 @@
34 menuObjectPath: "/com/canonical/indicator/network/phone_wifi_settings"
35 }
36
37+ NetworkInfo {
38+ id: networkInfo
39+
40+ property string accessPointName: getAccessPointName()
41+
42+ monitorCurrentNetworkMode: true
43+ monitorNetworkName: true
44+ monitorNetworkStatus: true
45+
46+ onCurrentNetworkModeChanged: getAccessPointName()
47+ onNetworkNameChanged: getAccessPointName()
48+ onNetworkStatusChanged: if (status !== NetworkInfo.HomeNetwork) accessPointName = ""
49+
50+ function getAccessPointName() {
51+ // 0 is the interface
52+ if (currentNetworkMode === NetworkInfo.WlanMode &&
53+ networkStatus(NetworkInfo.WlanMode, 0) === NetworkInfo.HomeNetwork)
54+ accessPointName = networkName(NetworkInfo.WlanMode, 0);
55+ else
56+ accessPointName = "";
57+ }
58+ }
59+
60 Component {
61 id: accessPointComponent
62 ListItem.Standard {
63@@ -118,11 +142,6 @@
64 onCheckedChanged: {
65 // Can't rely on binding. Checked is assigned on click.
66 checkBoxActive.checked = checked;
67- if (checked) {
68- mainMenu.connectedAPs++
69- } else {
70- mainMenu.connectedAPs--
71- }
72 }
73 onActivate: unityMenuModel.activate(menuIndex);
74 }
75@@ -164,9 +183,6 @@
76 Repeater {
77 id: mainMenu
78
79- // FIXME Check connection better https://bugs.launchpad.net/indicator-network/+bug/1349371
80- property int connectedAPs: 0
81-
82 model: menuModel
83
84 delegate: Loader {

Subscribers

People subscribed via source and target branches