Merge lp:~renatofilho/dialer-app/favorites-contacts into lp:dialer-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 219
Merged at revision: 222
Proposed branch: lp:~renatofilho/dialer-app/favorites-contacts
Merge into: lp:dialer-app
Diff against target: 180 lines (+141/-2)
2 files modified
src/qml/ContactsPage/ContactsPage.qml (+136/-2)
src/qml/dialer-app.qml (+5/-0)
To merge this branch: bzr merge lp:~renatofilho/dialer-app/favorites-contacts
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+230543@code.launchpad.net

Commit message

Add header section on ContactsPage to allow the user to switch between the "all" and "favorites" contacts.
Add an "Add new" button on contact list header.

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 the packaging (debian), did you add a core-dev as a reviewer to this MP? NO PACKAGE

218. By Renato Araujo Oliveira Filho

use i18n.tr for strings on page header section.

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 :

10 - property QtObject contact
11 + property QtObject contact

This change is not needed and breaks indentation.

review: Needs Fixing
219. By Renato Araujo Oliveira Filho

Fixed identation.

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 the failure is not related to this MR

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

Code looks good and works as expected!

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/qml/ContactsPage/ContactsPage.qml'
--- src/qml/ContactsPage/ContactsPage.qml 2014-08-01 14:59:45 +0000
+++ src/qml/ContactsPage/ContactsPage.qml 2014-08-13 15:18:51 +0000
@@ -26,10 +26,12 @@
26Page {26Page {
27 id: contactsPage27 id: contactsPage
28 objectName: "contactsPage"28 objectName: "contactsPage"
29
30 property QtObject contact
31
29 title: i18n.tr("Contacts")32 title: i18n.tr("Contacts")
30 property QtObject contact
3133
32 __customHeaderContents: TextField {34 TextField {
33 id: searchField35 id: searchField
3436
35 anchors {37 anchors {
@@ -44,6 +46,77 @@
44 onTextChanged: contactList.currentIndex = -146 onTextChanged: contactList.currentIndex = -1
45 inputMethodHints: Qt.ImhNoPredictiveText47 inputMethodHints: Qt.ImhNoPredictiveText
46 placeholderText: i18n.tr("Search...")48 placeholderText: i18n.tr("Search...")
49 visible: false
50 }
51
52 state: "default"
53 states: [
54 PageHeadState {
55 id: defaultState
56
57 name: "default"
58 actions: [
59 Action {
60 text: i18n.tr("Search")
61 iconName: "search"
62 onTriggered: {
63 contactsPage.state = "searching"
64 searchField.forceActiveFocus()
65 }
66 }
67 ]
68 PropertyChanges {
69 target: contactsPage.head
70 actions: defaultState.actions
71 sections.model: [i18n.tr("All"), i18n.tr("Favorites")]
72 }
73 PropertyChanges {
74 target: searchField
75 text: ""
76 visible: false
77 }
78 },
79 PageHeadState {
80 id: searchingState
81
82 name: "searching"
83 backAction: Action {
84 iconName: "close"
85 text: i18n.tr("Cancel")
86 onTriggered: {
87 contactList.forceActiveFocus()
88 contactsPage.state = "default"
89 }
90 }
91
92 PropertyChanges {
93 target: contactsPage.head
94 backAction: searchingState.backAction
95 contents: searchField
96 }
97
98 PropertyChanges {
99 target: searchField
100 text: ""
101 visible: true
102 }
103 }
104 ]
105
106 Connections {
107 target: contactsPage.head.sections
108 onSelectedIndexChanged: {
109 switch (contactsPage.head.sections.selectedIndex) {
110 case 0:
111 contactList.showAllContacts()
112 break;
113 case 1:
114 contactList.showFavoritesContacts()
115 break;
116 default:
117 break;
118 }
119 }
47 }120 }
48121
49 // background122 // background
@@ -61,6 +134,67 @@
61 right: parent.right134 right: parent.right
62 bottom: keyboardRect.top135 bottom: keyboardRect.top
63 }136 }
137
138
139 header: Item {
140 id: addNewContactButton
141 objectName: "addNewContact"
142
143 anchors {
144 left: parent.left
145 right: parent.right
146 }
147 height: units.gu(8)
148
149 Rectangle {
150 anchors.fill: parent
151 color: Theme.palette.selected.background
152 opacity: addNewContactButtonArea.pressed ? 1.0 : 0.0
153 }
154
155 UbuntuShape {
156 id: addIcon
157
158 anchors {
159 left: parent.left
160 top: parent.top
161 bottom: parent.bottom
162 margins: units.gu(1)
163 }
164 width: height
165 radius: "medium"
166 color: Theme.palette.normal.overlay
167 Image {
168 anchors.centerIn: parent
169 width: units.gu(2)
170 height: units.gu(2)
171 source: "image://theme/add"
172 }
173 }
174
175 Label {
176 id: name
177
178 anchors {
179 left: addIcon.right
180 leftMargin: units.gu(2)
181 verticalCenter: parent.verticalCenter
182 right: parent.right
183 rightMargin: units.gu(2)
184 }
185 color: UbuntuColors.lightAubergine
186 text: i18n.tr("+ Create New")
187 elide: Text.ElideRight
188 }
189
190 MouseArea {
191 id: addNewContactButtonArea
192
193 anchors.fill: parent
194 onClicked: mainView.createNewContactForPhone(" ")
195 }
196 }
197
64 onInfoRequested: {198 onInfoRequested: {
65 mainView.viewContact(contact.contactId)199 mainView.viewContact(contact.contactId)
66 }200 }
67201
=== modified file 'src/qml/dialer-app.qml'
--- src/qml/dialer-app.qml 2014-08-01 14:59:45 +0000
+++ src/qml/dialer-app.qml 2014-08-13 15:18:51 +0000
@@ -84,6 +84,11 @@
84 return false;84 return false;
85 }85 }
8686
87 function createNewContactForPhone(phoneNumber)
88 {
89 Qt.openUrlExternally("addressbook:///create?callback=dialer-app.desktop&phone=" + encodeURIComponent(phoneNumber))
90 }
91
87 function viewContact(contactId) {92 function viewContact(contactId) {
88 Qt.openUrlExternally("addressbook:///contact?callback=dialer-app.desktop&id=" + encodeURIComponent(contactId))93 Qt.openUrlExternally("addressbook:///contact?callback=dialer-app.desktop&id=" + encodeURIComponent(contactId))
89 }94 }

Subscribers

People subscribed via source and target branches