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

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 171
Merged at revision: 174
Proposed branch: lp:~renatofilho/address-book-app/fix-1268040_1312263_1235971
Merge into: lp:address-book-app
Diff against target: 162 lines (+50/-10)
6 files modified
src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml (+18/-0)
src/imports/ContactEdit/ContactDetailNameEditor.qml (+1/-2)
src/imports/ContactEdit/ContactEditor.qml (+1/-1)
src/imports/Ubuntu/Contacts/ContactList.js (+2/-1)
src/imports/Ubuntu/Contacts/ContactSearchListView.qml (+2/-2)
src/imports/Ubuntu/Contacts/ContactSimpleListView.qml (+26/-4)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-1268040_1312263_1235971
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+217299@code.launchpad.net

Commit message

Used contact.DisplayLabel as label for contacts in contactlist.

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

Used Contact.Tag as sort order and section name.

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

Add tag field into the FetchHint list.

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

Allows to save contacts with phone numbers and empty name.

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

Sort empty tags by display name.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
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? YES
 - https://code.launchpad.net/~renatofilho/address-book-service/fix-1268040_1312263_1235971/+merge/217301

* Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes): 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? N/A
* If you changed the packaging (debian), did you subscribe a core-dev to this MP? N/A

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Tested on the device. looks good to me.

-----------------

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.
Yes

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

review: Approve
172. By Renato Araujo Oliveira Filho

Merged trunk.

173. By Renato Araujo Oliveira Filho

Correct scroll back to section after expand the contact list.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml'
2--- src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2014-03-18 21:02:25 +0000
3+++ src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2014-05-05 14:08:29 +0000
4@@ -38,6 +38,24 @@
5 root.newDetails = []
6 }
7
8+ function isEmpty() {
9+ for(var i=0; i < detailDelegates.length; i++) {
10+ var delegate = detailDelegates[i]
11+
12+ // Get item from Loader
13+ if (delegate.item) {
14+ delegate = delegate.item
15+ }
16+
17+ if (delegate.isEmpty) {
18+ if (!delegate.isEmpty()) {
19+ return false
20+ }
21+ }
22+ }
23+ return true
24+ }
25+
26 function save() {
27 var changed = false
28 var removedDetails = []
29
30=== modified file 'src/imports/ContactEdit/ContactDetailNameEditor.qml'
31--- src/imports/ContactEdit/ContactDetailNameEditor.qml 2014-03-10 13:02:59 +0000
32+++ src/imports/ContactEdit/ContactDetailNameEditor.qml 2014-05-05 14:08:29 +0000
33@@ -23,11 +23,10 @@
34 ContactDetailItem {
35 id: root
36
37- property bool isEmpty: (fields == -1) || (emptyFields.length === fields.length)
38 property variant emptyFields: []
39
40 function isEmpty() {
41- return false
42+ return (fields == -1) || (emptyFields.length === fields.length)
43 }
44
45 function save() {
46
47=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
48--- src/imports/ContactEdit/ContactEditor.qml 2014-04-16 14:29:23 +0000
49+++ src/imports/ContactEdit/ContactEditor.qml 2014-05-05 14:08:29 +0000
50@@ -292,7 +292,7 @@
51 height: units.gu(6)
52 acceptAction: Action {
53 text: i18n.tr("Save")
54- enabled: !nameEditor.isEmpty
55+ enabled: !nameEditor.isEmpty() || !phonesEditor.isEmpty()
56 onTriggered: contactEditor.save()
57 }
58 rejectAction: Action {
59
60=== modified file 'src/imports/Ubuntu/Contacts/ContactList.js'
61--- src/imports/Ubuntu/Contacts/ContactList.js 2013-10-05 00:09:51 +0000
62+++ src/imports/Ubuntu/Contacts/ContactList.js 2014-05-05 14:08:29 +0000
63@@ -20,7 +20,8 @@
64
65 function sectionValueForContact(contact) {
66 if (contact) {
67- return contact.tag.tag
68+ var section = contact.tag.tag.charAt(0).toUpperCase()
69+ return (section === "" ? "#" : section)
70 } else {
71 return null
72 }
73
74=== modified file 'src/imports/Ubuntu/Contacts/ContactSearchListView.qml'
75--- src/imports/Ubuntu/Contacts/ContactSearchListView.qml 2013-10-21 19:25:51 +0000
76+++ src/imports/Ubuntu/Contacts/ContactSearchListView.qml 2014-05-05 14:08:29 +0000
77@@ -151,8 +151,8 @@
78 SortOrder {
79 id: sortOrder
80
81- detail: ContactDetail.Name
82- field: Name.FirstName
83+ detail: ContactDetail.Tag
84+ field: Tag.Name
85 direction: Qt.AscendingOrder
86 }
87 ]
88
89=== modified file 'src/imports/Ubuntu/Contacts/ContactSimpleListView.qml'
90--- src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2014-03-26 22:14:29 +0000
91+++ src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2014-05-05 14:08:29 +0000
92@@ -71,14 +71,14 @@
93 This property holds the contact detail which will be used to display the contact title in the delegate
94 By default this is set to ContactDetail.Name.
95 */
96- property int titleDetail: ContactDetail.Name
97+ property int titleDetail: ContactDetail.DisplayLabel
98 /*!
99 \qmlproperty list<int> titleFields
100
101 This property holds the list of all fields which will be used to display the contact title in the delegate
102 By default this is set to [ Name.FirstName, Name.LastName ]
103 */
104- property variant titleFields: [ Name.FirstName, Name.LastName ]
105+ property variant titleFields: [ DisplayLabel.Label ]
106 /*!
107 \qmlproperty list<SortOrder> sortOrders
108
109@@ -89,6 +89,14 @@
110 SortOrder {
111 id: sortOrder
112
113+ detail: ContactDetail.Tag
114+ field: Tag.Tag
115+ direction: Qt.AscendingOrder
116+ blankPolicy: SortOrder.BlanksLast
117+ caseSensitivity: Qt.CaseInsensitive
118+ },
119+ // empty tags will be sorted by display Label
120+ SortOrder {
121 detail: ContactDetail.DisplayLabel
122 field: DisplayLabel.Label
123 direction: Qt.AscendingOrder
124@@ -105,7 +113,7 @@
125 */
126 property var fetchHint : FetchHint {
127 detailTypesHint: {
128- var hints = [ contactListView.titleDetail, ContactDetail.Tag, ContactDetail.DisplayLabel ]
129+ var hints = [ ContactDetail.Tag, contactListView.titleDetail ]
130
131 if (contactListView.showAvatar) {
132 hints.push(ContactDetail.Avatar)
133@@ -256,7 +264,7 @@
134 labelPositioning: ViewSection.InlineLabels | ViewSection.CurrentLabelAtStart
135 delegate: ListItem.Header {
136 id: listHeader
137- text: section
138+ text: section != "" ? section : "#"
139 height: units.gu(4)
140
141 Rectangle {
142@@ -362,6 +370,20 @@
143 when: (loaderDelegate.status == Loader.Ready)
144 }
145
146+ Binding {
147+ target: loaderDelegate.item
148+ property: "titleDetail"
149+ value: contactListView.titleDetail
150+ when: (loaderDelegate.status == Loader.Ready)
151+ }
152+
153+ Binding {
154+ target: loaderDelegate.item
155+ property: "titleFields"
156+ value: contactListView.titleFields
157+ when: (loaderDelegate.status == Loader.Ready)
158+ }
159+
160 // this will avoid the binding to be broken during the PropertyAction
161 Binding {
162 target: loaderDelegate

Subscribers

People subscribed via source and target branches