Merge lp:~renatofilho/address-book-app/fix-1387659 into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 326
Merged at revision: 338
Proposed branch: lp:~renatofilho/address-book-app/fix-1387659
Merge into: lp:address-book-app
Prerequisite: lp:~renatofilho/address-book-app/fix-1390128
Diff against target: 152 lines (+26/-7)
2 files modified
src/imports/ContactList/ContactListPage.qml (+11/-6)
src/imports/MainWindow.qml (+15/-1)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-1387659
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+241361@code.launchpad.net

This proposal supersedes a proposal from 2014-11-10.

Commit message

Show "No contacts." for empty list in pick mode.
Hide search button if the list is empty.
Make the "share" and "select" buttons invisible if the contact list is empty.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
323. By Renato Araujo Oliveira Filho

Resync parent branch.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
324. By Renato Araujo Oliveira Filho

Do not async load content hub object. Async load can cause some signal to get lost due the delay to create the component.

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? NO UI CHANGE

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

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

325. By Renato Araujo Oliveira Filho

Do not use preset property in the header.

326. By Renato Araujo Oliveira Filho

Use "You have no contacts." string instead of "no contacts".

This will avoid create a new string to be translated.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

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

Did CI run pass? If not, please explain why.
No, but not related to the MR

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
Yes

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

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-11-11 14:36:28 +0000
3+++ src/imports/ContactList/ContactListPage.qml 2014-11-11 14:36:28 +0000
4@@ -37,6 +37,7 @@
5 property string newPhoneToAdd: ""
6 property alias contactManager: contactList.manager
7
8+ readonly property bool isEmpty: (contactList.count === 0)
9 readonly property bool allowToQuit: (application.callbackApplication.length > 0)
10 readonly property bool syncEnabled: application.syncEnabled
11 readonly property var contactModel: contactList.listModel ? contactList.listModel : null
12@@ -352,6 +353,7 @@
13 Action {
14 text: i18n.tr("Search")
15 iconName: "search"
16+ visible: !mainPage.isEmpty
17 onTriggered: {
18 mainPage.state = (mainPage.state === "newphone" ? "newphoneSearching" : "searching")
19 contactList.showAllContacts()
20@@ -402,12 +404,12 @@
21 name: "selection"
22 backAction: Action {
23 text: i18n.tr("Cancel selection")
24- iconName: "close"
25+ iconName: "back"
26 onTriggered: contactList.cancelSelection()
27 }
28 actions: [
29 Action {
30- text: i18n.tr("Select All")
31+ text: (contactList.selectedItems.count === contactList.count) ? i18n.tr("Unselect All") : i18n.tr("Select All")
32 iconName: "select"
33 onTriggered: {
34 if (contactList.selectedItems.count === contactList.count) {
35@@ -416,12 +418,13 @@
36 contactList.selectAll()
37 }
38 }
39- visible: contactList.multipleSelection
40+ visible: contactList.multipleSelection && !mainPage.isEmpty
41 },
42 Action {
43 objectName: "share"
44 text: i18n.tr("Share")
45 iconName: "share"
46+ enabled: (contactList.selectedItems.count > 0)
47 visible: contactList.isInSelectionMode
48 onTriggered: {
49 var contacts = []
50@@ -439,6 +442,7 @@
51 objectName: "delete"
52 text: i18n.tr("Delete")
53 iconName: "delete"
54+ enabled: (contactList.selectedItems.count > 0)
55 visible: contactList.isInSelectionMode && !mainPage.pickMode
56 onTriggered: {
57 var contacts = []
58@@ -532,8 +536,7 @@
59 height: childrenRect.height
60 width: childrenRect.width
61 spacing: units.gu(2)
62-
63- visible: (contactList.count === 0 && !indicator.visible && (mainPage.newPhoneToAdd === ""))
64+ visible: (mainPage.isEmpty && !indicator.visible && (mainPage.newPhoneToAdd === ""))
65
66 Icon {
67 id: emptyStateIcon
68@@ -547,7 +550,9 @@
69 id: emptyStateLabel
70 width: mainPage.width - units.gu(12)
71 height: paintedHeight
72- text: i18n.tr("Create a new contact by swiping up from the bottom of the screen.")
73+ text: mainPage.pickMode ?
74+ i18n.tr("You have no contacts.") :
75+ i18n.tr("Create a new contact by swiping up from the bottom of the screen.")
76 color: "#5d5d5d"
77 fontSize: "x-large"
78 wrapMode: Text.WordWrap
79
80=== modified file 'src/imports/MainWindow.qml'
81--- src/imports/MainWindow.qml 2014-11-11 14:36:28 +0000
82+++ src/imports/MainWindow.qml 2014-11-11 14:36:28 +0000
83@@ -32,6 +32,8 @@
84 mainStack.resetStack()
85 if (mainStack.contactListPage) {
86 mainStack.contactListPage.showContact(contactId)
87+ } else {
88+ console.error("Contact preview requested but ContactListPage not loaded")
89 }
90 mainStack.quitOnDepth = 1
91 }
92@@ -41,6 +43,8 @@
93 mainStack.resetStack()
94 if (mainStack.contactListPage) {
95 mainStack.contactListPage.createContactWithPhoneNumber(phoneNumber)
96+ } else {
97+ console.error("Contact creation requested but ContactListPage not loaded")
98 }
99 }
100
101@@ -49,11 +53,14 @@
102 mainStack.resetStack()
103 if (mainStack.contactListPage) {
104 mainStack.contactListPage.addPhoneToContact(contactId, phoneNumber)
105+ } else {
106+ console.error("Add phone to contact requested but ContactListPage not loaded")
107 }
108 }
109
110 function pick(single)
111 {
112+ console.debug("Pick mode:" + single)
113 pickWithTransfer(single, null)
114 }
115
116@@ -62,6 +69,8 @@
117 mainStack.resetStack()
118 if (mainStack.contactListPage) {
119 mainStack.contactListPage.startPickMode(single === "true", activeTransfer)
120+ } else {
121+ console.error("Pick mode requested but ContactListPage not loaded")
122 }
123 }
124
125@@ -75,6 +84,8 @@
126 mainStack.resetStack()
127 if (mainStack.contactListPage) {
128 mainStack.contactListPage.importContact(_urls)
129+ } else {
130+ console.error("Import vcard requested but ContactListPage not loaded")
131 }
132 }
133
134@@ -83,6 +94,8 @@
135 mainStack.resetStack()
136 if (mainStack.contactListPage) {
137 mainStack.contactListPage.addNewPhone(phoneNumer)
138+ } else {
139+ console.error("Add new phone requested but ContactListPage not loaded")
140 }
141 }
142
143@@ -159,7 +172,8 @@
144 Loader {
145 id: contentHubLoader
146
147- asynchronous: true
148+ //We can not use async load, the export requested signal can be received before the component get ready
149+ //asynchronous: true
150 source: Qt.resolvedUrl("ContentHubProxy.qml")
151 onStatusChanged: {
152 if (status === Loader.Ready) {

Subscribers

People subscribed via source and target branches