Merge lp:~cimi/unity8/fix-1363400 into lp:unity8

Proposed by Andrea Cimitan on 2015-01-21
Status: Merged
Approved by: Albert Astals Cid on 2015-02-04
Approved revision: 1567
Merged at revision: 1589
Proposed branch: lp:~cimi/unity8/fix-1363400
Merge into: lp:unity8
Diff against target: 94 lines (+29/-9)
2 files modified
debian/control (+2/-0)
qml/Wizard/Pages/40-wifi.qml (+27/-9)
To merge this branch: bzr merge lp:~cimi/unity8/fix-1363400
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) 2015-01-21 Approve on 2015-02-04
PS Jenkins bot continuous-integration Needs Fixing on 2015-02-03
Review via email: mp+247129@code.launchpad.net

Commit Message

Fix continue button in wifi wizard page, adds qml-module-qtsysteminfo as unity8 dep

Description of the Change

The RTM part of this lives at https://code.launchpad.net/~cimi/ubuntu-system-settings/fix-1363400/+merge/247131

* Are there any related MPs required for this MP to build/function as expected? Please list.
No
 * Did you perform an exploratory manual test run of your code change and any related functionality?
Sure
 * Did you make sure that your branch does not contain spurious tags?
Yes
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
I will
 * If you changed the UI, has there been a design review?
n/a

To post a comment you must log in.
lp:~cimi/unity8/fix-1363400 updated on 2015-01-21
1562. By Andrea Cimitan on 2015-01-21

minor

1563. By Andrea Cimitan on 2015-01-21

This proved to be more reliable on krillin

Albert Astals Cid (aacid) wrote :

I'm a bit confused by how the code has

property string accessPointName: getAccessPointName()

but then in the getAccessPointName function you do accessPointName = "" which basically breaks the above binding and the you also have
 onNetworkNameChanged: getAccessPointName()
and
 onNetworkStatusChanged: if (status !== NetworkInfo.HomeNetwork) accessPointName = ""
which seems like they are trying to make up for the broken binding.

Wouldn't it be better to just have the getAccessPointName() function be the binding itself for accessPointName? Then we wouldn't need those onChanged since QML would do the re-evaluation for us when needed, no?

Albert Astals Cid (aacid) wrote :

Ok, ignore my comment since
   networkStatus(NetworkInfo.WlanMode, 0)
actually needs to be a function call so we need the onChanged stuff.

This NetworkInfo for QML seems like it's not very QML-friednly to be honest :/

lp:~cimi/unity8/fix-1363400 updated on 2015-01-22
1564. By Andrea Cimitan on 2015-01-22

fix for jenkins

1565. By Andrea Cimitan on 2015-01-22

let's add also for runtime

lp:~cimi/unity8/fix-1363400 updated on 2015-01-23
1566. By Andrea Cimitan on 2015-01-23

Some testers reported currentNetworkMode being sometimes set after the networkName changes (on RTM), let's add a signal, won't hurt

Michael Terry (mterry) :
lp:~cimi/unity8/fix-1363400 updated on 2015-02-03
1567. By Andrea Cimitan on 2015-02-03

As review

Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, also the system settings guys approved and landed the counterpart to this

 * Did CI run pass? If not, please explain why.
Not much, our CI is kind of broken, but we don't have tests over this as far as i can see

 * Did you make sure that the branch does not contain spurious tags?
Yes

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-22 10:09:11 +0000
3+++ debian/control 2015-02-03 15:00:49 +0000
4@@ -39,6 +39,7 @@
5 qml-module-qtquick-layouts,
6 qml-module-qtquick-xmllistmodel,
7 qml-module-qtquick2,
8+ qml-module-qtsysteminfo,
9 qml-module-qttest,
10 qt5-default,
11 qtbase5-dev (>= 5.2.1),
12@@ -90,6 +91,7 @@
13 qmenumodel-qml (>= 0.2.9),
14 qml-module-qt-labs-folderlistmodel,
15 qml-module-qtquick-xmllistmodel,
16+ qml-module-qtsysteminfo,
17 qtdeclarative5-gsettings1.0,
18 qtdeclarative5-qtmir-plugin (>= 0.4.4),
19 qtdeclarative5-ubuntu-telephony0.1,
20
21=== modified file 'qml/Wizard/Pages/40-wifi.qml'
22--- qml/Wizard/Pages/40-wifi.qml 2014-11-21 19:28:16 +0000
23+++ qml/Wizard/Pages/40-wifi.qml 2015-02-03 15:00:49 +0000
24@@ -16,6 +16,7 @@
25
26 import QtQuick 2.0
27 import QMenuModel 0.1 as QMenuModel
28+import QtSystemInfo 5.0
29 import Ubuntu.Components 0.1
30 import Ubuntu.Components.ListItems 0.1 as ListItem
31 import Ubuntu.Settings.Menus 0.1 as Menus
32@@ -28,7 +29,7 @@
33 title: i18n.tr("Connect to Wi‑Fi")
34 forwardButtonSourceComponent: forwardButton
35
36- readonly property bool connected: mainMenu.connectedAPs === 1
37+ readonly property bool connected: networkInfo.accessPointName
38
39 function getExtendedProperty(object, propertyName, defaultValue) {
40 if (object && object.hasOwnProperty(propertyName)) {
41@@ -44,6 +45,31 @@
42 menuObjectPath: "/com/canonical/indicator/network/phone_wifi_settings"
43 }
44
45+ NetworkInfo {
46+ id: networkInfo
47+
48+ property string accessPointName
49+
50+ monitorCurrentNetworkMode: true
51+ monitorNetworkName: true
52+ monitorNetworkStatus: true
53+
54+ onCurrentNetworkModeChanged: getAccessPointName()
55+ onNetworkNameChanged: getAccessPointName()
56+ onNetworkStatusChanged: if (status !== NetworkInfo.HomeNetwork) accessPointName = ""
57+
58+ Component.onCompleted: getAccessPointName()
59+
60+ function getAccessPointName() {
61+ // 0 is the interface
62+ if (currentNetworkMode === NetworkInfo.WlanMode &&
63+ networkStatus(NetworkInfo.WlanMode, 0) === NetworkInfo.HomeNetwork)
64+ accessPointName = networkName(NetworkInfo.WlanMode, 0);
65+ else
66+ accessPointName = "";
67+ }
68+ }
69+
70 Component {
71 id: accessPointComponent
72 ListItem.Standard {
73@@ -119,11 +145,6 @@
74 onCheckedChanged: {
75 // Can't rely on binding. Checked is assigned on click.
76 checkBoxActive.checked = checked;
77- if (checked) {
78- mainMenu.connectedAPs++
79- } else {
80- mainMenu.connectedAPs--
81- }
82 }
83 onActivate: unityMenuModel.activate(menuIndex);
84 }
85@@ -165,9 +186,6 @@
86 Repeater {
87 id: mainMenu
88
89- // FIXME Check connection better https://bugs.launchpad.net/indicator-network/+bug/1349371
90- property int connectedAPs: 0
91-
92 model: menuModel
93
94 delegate: Loader {

Subscribers

People subscribed via source and target branches