Merge lp:~renatofilho/address-book-app/fix-1411323-rtm into lp:address-book-app/rtm-14.09

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 293
Merged at revision: 293
Proposed branch: lp:~renatofilho/address-book-app/fix-1411323-rtm
Merge into: lp:address-book-app/rtm-14.09
Diff against target: 90 lines (+61/-2)
2 files modified
src/imports/ContactList/ContactListPage.qml (+1/-1)
tests/qml/tst_ContactList.qml (+60/-1)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-1411323-rtm
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+247142@code.launchpad.net

Commit message

Use the "tick" icon as confirm button while in Pick mode.

To post a comment you must log in.
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Are there any related MPs required for this MP to build/function as expected? NO

Is your branch in sync with latest trunk? YES

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator? YES

Did you successfully run all tests found in your component's Test Plan on device or emulator? YES

If you changed the UI, was the change specified/approved by design? YES

If you changed UI labels, did you update the pot file? NO LABEL CHANGED

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP? NO PACKAGE CHANGED

292. By Renato Araujo Oliveira Filho

Added unit test for "share" button icon.

293. By Renato Araujo Oliveira Filho

Fixed icon name on comments.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/ContactList/ContactListPage.qml'
2--- src/imports/ContactList/ContactListPage.qml 2014-12-04 13:18:23 +0000
3+++ src/imports/ContactList/ContactListPage.qml 2015-01-22 16:04:59 +0000
4@@ -421,7 +421,7 @@
5 Action {
6 objectName: "share"
7 text: i18n.tr("Share")
8- iconName: "share"
9+ iconName: mainPage.pickMode ? "tick" : "share"
10 visible: contactList.isInSelectionMode
11 onTriggered: {
12 var contacts = []
13
14=== modified file 'tests/qml/tst_ContactList.qml'
15--- tests/qml/tst_ContactList.qml 2014-12-04 13:18:23 +0000
16+++ tests/qml/tst_ContactList.qml 2015-01-22 16:04:59 +0000
17@@ -88,7 +88,7 @@
18
19 function cleanup()
20 {
21- root.contactListPageObj.destroy()
22+ root.contactListPageObj = null
23 }
24
25 function test_title()
26@@ -137,5 +137,64 @@
27 tryCompare(dialog.item, "dialogVisible", false)
28 }
29
30+ function test_pickButtonIcon()
31+ {
32+ tryCompare(root.contactListPageObj, "state", "default")
33+ var activeActions = root.contactListPageObj.head.actions
34+
35+
36+ // before start the pick mode the action is not visible
37+ for(var i = 0; i < activeActions.length; i++) {
38+ if (activeActions[i].objectName === "share")
39+ fail("Share icon is visible but the list is not in selection mode")
40+ }
41+
42+ // start selection
43+ var view = findChild(root.contactListPageObj, "contactListView")
44+ view.startSelection()
45+ tryCompare(root.contactListPageObj, "state", "selection")
46+
47+ // on selection mode the share shuld be visible and using the 'share' icon
48+ var shareAction = null
49+ activeActions = root.contactListPageObj.head.actions
50+ for(var i = 0; i < activeActions.length; i++) {
51+ if (activeActions[i].objectName === "share") {
52+ shareAction = activeActions[i]
53+ break
54+ }
55+ }
56+ verify(shareAction != null, "Share button is not visible while the list is in selection mode")
57+ tryCompare(shareAction, "visible", true)
58+ tryCompare(shareAction, "iconName", "share")
59+
60+ // cancel selection
61+ view.cancelSelection()
62+
63+ // check if the list went back to default state
64+ tryCompare(root.contactListPageObj, "state", "default")
65+ activeActions = root.contactListPageObj.head.actions
66+ for(var i = 0; i < activeActions.length; i++) {
67+ if (activeActions[i].objectName === "share")
68+ fail("Share icon is visible but the list is not in selection mode")
69+ }
70+
71+
72+ // enter on pick mode
73+ root.contactListPageObj.startPickMode(true, null)
74+
75+ // share button is visible and using the 'tick' icon
76+ tryCompare(root.contactListPageObj, "state", "selection")
77+ shareAction = null
78+ activeActions = root.contactListPageObj.head.actions
79+ for(var i = 0; i < activeActions.length; i++) {
80+ if (activeActions[i].objectName === "share") {
81+ shareAction = activeActions[i]
82+ break
83+ }
84+ }
85+ verify(shareAction != null, "Share button is not visible while the list is in pick mode")
86+ tryCompare(shareAction, "visible", true)
87+ tryCompare(shareAction, "iconName", "tick")
88+ }
89 }
90 }

Subscribers

People subscribed via source and target branches