Merge lp:~nick-dedekind/ubuntu-settings-components/access-point-init into lp:~registry/ubuntu-settings-components/trunk

Proposed by Nick Dedekind
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 67
Merged at revision: 67
Proposed branch: lp:~nick-dedekind/ubuntu-settings-components/access-point-init
Merge into: lp:~registry/ubuntu-settings-components/trunk
Diff against target: 35 lines (+15/-0)
2 files modified
Ubuntu/Settings/Menus/AccessPointMenu.qml (+8/-0)
tests/qmltests/Menus/tst_AccessPointMenu.qml (+7/-0)
To merge this branch: bzr merge lp:~nick-dedekind/ubuntu-settings-components/access-point-init
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+212913@code.launchpad.net

Commit message

Fixed issue with Access Point checkbox not fetching initial value.

Description of the change

* 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?
yes

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
no

* If you changed the UI, has there been a design review?
N/a

To post a comment you must log in.
67. By Nick Dedekind

Added comment

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

is there a chance we're clearing enableCheckConnection value? (something setting this before the Component.onCompleted) do we need the oldValue here as well?

review: Needs Information
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> is there a chance we're clearing enableCheckConnection value? (something
> setting this before the Component.onCompleted) do we need the oldValue here as
> well?

Nope. Component.onCompleted cannot be called as a result of any other function calls in this component. As enableCheckConnection is always returned to it's previous value, this will always be true at the start of Component.onCompleted

Revision history for this message
Andrea Cimitan (cimi) wrote :

After long private discussion, it's fine for now :) Thank you

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Ubuntu/Settings/Menus/AccessPointMenu.qml'
2--- Ubuntu/Settings/Menus/AccessPointMenu.qml 2013-10-29 17:40:23 +0000
3+++ Ubuntu/Settings/Menus/AccessPointMenu.qml 2014-03-26 17:58:58 +0000
4@@ -47,6 +47,14 @@
5 verticalCenter: parent.verticalCenter
6 }
7
8+ // need onCompleted to set the initial value
9+ // can't use binding otherwise we will get feedback from connections.
10+ Component.onCompleted: {
11+ enableCheckConnection = false;
12+ checked = menu.checked;
13+ enableCheckConnection = true;
14+ }
15+
16 // FIXME : should use Checkbox.toggled signal
17 // lp:~nick-dedekind/ubuntu-ui-toolkit/checkbox.toggled
18 onCheckedChanged: {
19
20=== modified file 'tests/qmltests/Menus/tst_AccessPointMenu.qml'
21--- tests/qmltests/Menus/tst_AccessPointMenu.qml 2013-10-04 13:57:24 +0000
22+++ tests/qmltests/Menus/tst_AccessPointMenu.qml 2014-03-26 17:58:58 +0000
23@@ -135,5 +135,12 @@
24 accessPoint.checked = false;
25 compare(checkBox.checked, false, "Checkbox should not be checked when access point is not checked");
26 }
27+
28+ function test_checkBox_on_default_checked() {
29+ var checkBox = UtilsJS.findChild(accessPoint2, "checkBox");
30+ verify(checkBox !== undefined);
31+
32+ compare(checkBox.checked, true, "Check box should be checked if default to checked")
33+ }
34 }
35 }

Subscribers

People subscribed via source and target branches

to all changes: