Merge lp:~renatofilho/address-book-app/multiple-addressbook into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 154
Merged at revision: 159
Proposed branch: lp:~renatofilho/address-book-app/multiple-addressbook
Merge into: lp:address-book-app
Prerequisite: lp:~renatofilho/address-book-app/optimize-app
Diff against target: 306 lines (+189/-5)
9 files modified
src/imports/Common/ContactDetailBase.qml (+6/-0)
src/imports/ContactEdit/CMakeLists.txt (+1/-0)
src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml (+106/-0)
src/imports/ContactEdit/ContactEditor.qml (+15/-0)
src/imports/ContactList/ContactListPage.qml (+1/-1)
src/imports/ContactView/CMakeLists.txt (+1/-0)
src/imports/ContactView/ContactDetailSyncTargetView.qml (+30/-0)
src/imports/ContactView/ContactView.qml (+9/-0)
src/imports/Ubuntu/Contacts/ContactSimpleListView.qml (+20/-4)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/multiple-addressbook
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+211806@code.launchpad.net

This proposal supersedes a proposal from 2014-03-05.

Commit message

Implemented support to create contacts in different sources.

Description of the change

How to test this:

- You can use this script: http://paste.ubuntu.com/7132433/ to create multitple sources on your phone. (run this as phablet user. Ex: python3 create-source.py MySource)

- You will need this service branch to have access to other sources: https://code.launchpad.net/~renatofilho/address-book-service/implement-multiple-addressbook-support/+merge/210881

- Try create contacts in different sources and check if it was correct saved on the contact view.

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

FAILED: Continuous integration, rev:143
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/446/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-amd64-ci/156
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/156
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/156/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-i386-ci/156
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/3691
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3285/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3242
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3696
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/3696/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3287
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3287/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5657/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/4503

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/address-book-app-ci/446/rebuild

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

FAILED: Continuous integration, rev:144
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/464/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-amd64-ci/174
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/174
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/174/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-i386-ci/174
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4089
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3673/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3568
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4141
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4141/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3675
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3675/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5995/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5004

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/address-book-app-ci/464/rebuild

review: Needs Fixing (continuous-integration)
145. By Renato Araujo Oliveira Filho

Merged parent branch.

146. By Renato Araujo Oliveira Filho

Merged parent branch.

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

Added missing file.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:147
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/470/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-amd64-ci/180
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/180
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/180/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-i386-ci/180
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4140
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3724/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3605
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4204
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4204/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3726
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3726/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6033/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5068

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/address-book-app-ci/470/rebuild

review: Needs Fixing (continuous-integration)
148. By Renato Araujo Oliveira Filho

Fixed problem saving contact without sync target.

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

is this really required?

152 + z: 1000

also, can we remove the following line, or did you leave it there on purpose?

229 + //defaultIcon: "image://theme/language-chooser"

149. By Renato Araujo Oliveira Filho

Merged parent branch.

150. By Renato Araujo Oliveira Filho

Set the default icon for address-book.

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

Merged parent branch: lp:~renatofilho/address-book-app/optimize-app

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

Merged mainline.

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 (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 (https://wiki.ubuntu.com/Process/Merges/TestPlan/address-book-app) on device or emulator? YES
If you changed the UI, was the change specified/approved by design? NO UI CHANGE
If you changed the packaging (debian), did you subscribe a core-dev to this MP? NO PACKAGE CHANGE

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:152
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/487/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-amd64-ci/197
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/197
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/197/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-i386-ci/197
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4282
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3867/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3708
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4367
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4367/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3869
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3869/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6148/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5243

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/address-book-app-ci/487/rebuild

review: Needs Fixing (continuous-integration)
153. By Renato Araujo Oliveira Filho

Fixed scroll to created contact.

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

FAILED: Continuous integration, rev:153
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/490/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-amd64-ci/200
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/200
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/200/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-i386-ci/200
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4288
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3873/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3713
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4373
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4373/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3875
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3875/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6154/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5252

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/address-book-app-ci/490/rebuild

review: Needs Fixing (continuous-integration)
154. By Renato Araujo Oliveira Filho

Scroll to contact based on the contact name if the contact id is empty

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:154
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/491/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-amd64-ci/201
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/201
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-armhf-ci/201/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-trusty-i386-ci/201
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/4291
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/3878/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/3717
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4378
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/4378/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3880
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/3880/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/6158/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/5265

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/address-book-app-ci/491/rebuild

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

looks good to me.

review: Approve
Revision history for this message
Tiago Salem Herrmann (tiagosh) 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.
Yes

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

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/imports/Common/ContactDetailBase.qml'
--- src/imports/Common/ContactDetailBase.qml 2013-11-14 13:25:28 +0000
+++ src/imports/Common/ContactDetailBase.qml 2014-03-26 22:14:43 +0000
@@ -61,6 +61,10 @@
61 imMap[QtContacts.OnlineAccount.Protocol] = "imProtocol"61 imMap[QtContacts.OnlineAccount.Protocol] = "imProtocol"
62 imMap[QtContacts.OnlineAccount.Capabilities] = "imCaps"62 imMap[QtContacts.OnlineAccount.Capabilities] = "imCaps"
6363
64 // SyncTarget
65 var syncTargetMap = {}
66 syncTargetMap[QtContacts.SyncTarget.SyncTarget] = "syncTarget"
67
64 // all68 // all
65 var detailMap = {}69 var detailMap = {}
66 detailMap[QtContacts.ContactDetail.Name] = nameMap70 detailMap[QtContacts.ContactDetail.Name] = nameMap
@@ -68,6 +72,7 @@
68 detailMap[QtContacts.ContactDetail.Email] = emailMap72 detailMap[QtContacts.ContactDetail.Email] = emailMap
69 detailMap[QtContacts.ContactDetail.Address] = addressMap73 detailMap[QtContacts.ContactDetail.Address] = addressMap
70 detailMap[QtContacts.ContactDetail.OnlineAccount] = imMap74 detailMap[QtContacts.ContactDetail.OnlineAccount] = imMap
75 detailMap[QtContacts.ContactDetail.SyncTarget] = syncTargetMap
7176
72 // detail name77 // detail name
73 var detailNameMap = {}78 var detailNameMap = {}
@@ -76,6 +81,7 @@
76 detailNameMap[QtContacts.ContactDetail.Email] = "email"81 detailNameMap[QtContacts.ContactDetail.Email] = "email"
77 detailNameMap[QtContacts.ContactDetail.Address] = "address"82 detailNameMap[QtContacts.ContactDetail.Address] = "address"
78 detailNameMap[QtContacts.ContactDetail.OnlineAccount] = "onlineAccount"83 detailNameMap[QtContacts.ContactDetail.OnlineAccount] = "onlineAccount"
84 detailNameMap[QtContacts.ContactDetail.SyncTarget] = "syncTarget"
7985
80 if ((detail in detailMap) && (field in detailMap[detail])) {86 if ((detail in detailMap) && (field in detailMap[detail])) {
81 return detailMap[detail][field]87 return detailMap[detail][field]
8288
=== modified file 'src/imports/ContactEdit/CMakeLists.txt'
--- src/imports/ContactEdit/CMakeLists.txt 2013-09-24 15:07:46 +0000
+++ src/imports/ContactEdit/CMakeLists.txt 2014-03-26 22:14:43 +0000
@@ -7,6 +7,7 @@
7 ContactDetailOnlineAccountsEditor.qml7 ContactDetailOnlineAccountsEditor.qml
8 ContactDetailOrganizationsEditor.qml8 ContactDetailOrganizationsEditor.qml
9 ContactDetailPhoneNumbersEditor.qml9 ContactDetailPhoneNumbersEditor.qml
10 ContactDetailSyncTargetEditor.qml
10 ContactDetailWithTypeEditor.qml11 ContactDetailWithTypeEditor.qml
11 ContactEditor.qml12 ContactEditor.qml
12 ContactFetchError.qml13 ContactFetchError.qml
1314
=== added file 'src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml'
--- src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml 1970-01-01 00:00:00 +0000
+++ src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml 2014-03-26 22:14:43 +0000
@@ -0,0 +1,106 @@
1/*
2 * Copyright (C) 2012-2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtContacts 5.0
19import Ubuntu.Components 0.1
20import Ubuntu.Components.ListItems 0.1 as ListItem
21
22import "../Common"
23
24ContactDetailBase {
25 id: root
26
27 function save() {
28 // only changes the target sync for new contacts
29 if (!isNewContact) {
30 return;
31 }
32 var activeSource = getSelectedSource()
33 if (!activeSource) {
34 return;
35 }
36
37 if (!root.detail) {
38 root.detail = root.contact.syncTarget
39 }
40 root.detail.syncTarget = activeSource
41 }
42
43 function getSelectedSource() {
44 var selectedContact = sourceModel.contacts[sources.selectedIndex]
45 if (selectedContact) {
46 return selectedContact.guid.guid
47 } else {
48 return -1
49 }
50 }
51
52 property bool isNewContact: contact && contact.contactId === "qtcontacts:::"
53 property real myHeight: sources.containerHeight + units.gu(4) + label.height
54
55 detail: contact ? contact.detail(ContactDetail.SyncTarget) : null
56 implicitHeight: isNewContact ? myHeight : 0
57
58 ContactModel {
59 id: sourceModel
60
61 manager: QTCONTACTS_MANAGER_OVERRIDE && QTCONTACTS_MANAGER_OVERRIDE != "" ? QTCONTACTS_MANAGER_OVERRIDE : "galera"
62 filter: DetailFilter {
63 detail: ContactDetail.Type
64 field: Type.TypeField
65 value: Type.Group
66 matchFlags: DetailFilter.MatchExactly
67 }
68 }
69
70 Label {
71 id: label
72
73 text: i18n.tr("Addressbook")
74 anchors {
75 left: parent.left
76 top: parent.top
77 right: parent.right
78 margins: units.gu(2)
79 }
80 height: root.active ? units.gu(4) : units.gu(3)
81 }
82
83 OptionSelector {
84 id: sources
85
86 anchors {
87 left: parent.left
88 leftMargin: units.gu(2)
89 top: label.bottom
90 topMargin: units.gu(1)
91 right: parent.right
92 rightMargin: units.gu(2)
93 bottom: parent.bottom
94 bottomMargin: units.gu(2)
95 }
96
97 model: sourceModel
98 delegate: OptionSelectorDelegate {
99 text: contact.displayLabel.label
100 height: units.gu(5)
101 }
102
103 containerHeight: sourceModel.contacts.length > 4 ? itemHeight * 4 : itemHeight * sourceModel.contacts.length
104 }
105}
106
0107
=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
--- src/imports/ContactEdit/ContactEditor.qml 2014-03-26 22:14:43 +0000
+++ src/imports/ContactEdit/ContactEditor.qml 2014-03-26 22:14:43 +0000
@@ -181,6 +181,7 @@
181 }181 }
182 height: implicitHeight + units.gu(3)182 height: implicitHeight + units.gu(3)
183 KeyNavigation.tab: avatarEditor183 KeyNavigation.tab: avatarEditor
184 KeyNavigation.backtab : syncTargetEditor
184 }185 }
185186
186 ContactDetailAvatarEditor {187 ContactDetailAvatarEditor {
@@ -261,6 +262,20 @@
261 }262 }
262 height: implicitHeight263 height: implicitHeight
263 KeyNavigation.backtab : addressesEditor264 KeyNavigation.backtab : addressesEditor
265 KeyNavigation.tab: syncTargetEditor
266 }
267
268 ContactDetailSyncTargetEditor {
269 id: syncTargetEditor
270
271 contact: contactEditor.contact
272 anchors {
273 left: parent.left
274 right: parent.right
275 }
276 height: implicitHeight
277 KeyNavigation.backtab : organizationsEditor
278 KeyNavigation.tab: nameEditor
264 }279 }
265 }280 }
266 }281 }
267282
=== modified file 'src/imports/ContactList/ContactListPage.qml'
--- src/imports/ContactList/ContactListPage.qml 2014-03-26 22:14:43 +0000
+++ src/imports/ContactList/ContactListPage.qml 2014-03-26 22:14:43 +0000
@@ -174,7 +174,7 @@
174 Connections {174 Connections {
175 target: mainPage.contactModel175 target: mainPage.contactModel
176 onContactsChanged: {176 onContactsChanged: {
177 if (contactIndex && contactIndex.contactId != "contact:qtcontacts:::") {177 if (contactIndex) {
178 contactList.positionViewAtContact(mainPage.contactIndex)178 contactList.positionViewAtContact(mainPage.contactIndex)
179 mainPage.contactIndex = null179 mainPage.contactIndex = null
180 }180 }
181181
=== modified file 'src/imports/ContactView/CMakeLists.txt'
--- src/imports/ContactView/CMakeLists.txt 2013-10-21 19:25:51 +0000
+++ src/imports/ContactView/CMakeLists.txt 2014-03-26 22:14:43 +0000
@@ -11,6 +11,7 @@
11 ContactDetailOrganizationsView.qml11 ContactDetailOrganizationsView.qml
12 ContactDetailPhoneNumbersView.qml12 ContactDetailPhoneNumbersView.qml
13 ContactDetailPhoneNumberView.qml13 ContactDetailPhoneNumberView.qml
14 ContactDetailSyncTargetView.qml
14 ContactDetailWithTypeView.qml15 ContactDetailWithTypeView.qml
15 ContactHeaderView.qml16 ContactHeaderView.qml
16 ContactView.qml17 ContactView.qml
1718
=== added file 'src/imports/ContactView/ContactDetailSyncTargetView.qml'
--- src/imports/ContactView/ContactDetailSyncTargetView.qml 1970-01-01 00:00:00 +0000
+++ src/imports/ContactView/ContactDetailSyncTargetView.qml 2014-03-26 22:14:43 +0000
@@ -0,0 +1,30 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import QtContacts 5.0 as QtContacts
20
21ContactDetailGroupWithTypeView {
22 id: root
23
24 title: i18n.tr("Addressbook")
25 defaultIcon: "image://theme/contact-group"
26 detailType: QtContacts.ContactDetail.SyncTarget
27 typeModel: null
28
29 fields: [ QtContacts.SyncTarget.SyncTarget ]
30}
031
=== modified file 'src/imports/ContactView/ContactView.qml'
--- src/imports/ContactView/ContactView.qml 2014-03-18 21:02:25 +0000
+++ src/imports/ContactView/ContactView.qml 2014-03-26 22:14:43 +0000
@@ -137,6 +137,15 @@
137 }137 }
138 height: implicitHeight138 height: implicitHeight
139 }139 }
140
141 ContactDetailSyncTargetView {
142 contact: root.contact
143 anchors {
144 left: parent.left
145 right: parent.right
146 }
147 height: implicitHeight
148 }
140 }149 }
141 }150 }
142151
143152
=== modified file 'src/imports/Ubuntu/Contacts/ContactSimpleListView.qml'
--- src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2014-03-26 22:14:43 +0000
+++ src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2014-03-26 22:14:43 +0000
@@ -191,16 +191,32 @@
191 signal detailClicked(QtObject contact, QtObject detail)191 signal detailClicked(QtObject contact, QtObject detail)
192192
193 /*!193 /*!
194 Retrieve the contact index inside of the list194 Retrieve the contact index inside of the list based on contact id or contact name if the id is empty
195 */195 */
196 function getIndex(contact)196 function getIndex(contact)
197 {197 {
198 var contacts = listModel.contacts;198 var contacts = listModel.contacts
199 var contactId = null
200 var firstName
201 var middleName
202 var lastName
203
204 if (contact.contactId !== "qtcontacts:::") {
205 contactId = contact.contactId
206 } else {
207 firstName = contact.name.firstName
208 middleName = contact.name.middleName
209 lastName = contact.name.lastName
210 }
199211
200 for (var i = 0, count = contacts.length; i < count; i++) {212 for (var i = 0, count = contacts.length; i < count; i++) {
201 var itemId = contacts[i].contactId213 var c = contacts[i]
202 if (itemId === contact.contactId) {214 if (contactId && (c.contactId === contactId)) {
203 return i215 return i
216 } else if ((c.name.firstName === firstName) &&
217 (c.name.middleName === middleName) &&
218 (c.name.lastName === lastName)) {
219 return i
204 }220 }
205 }221 }
206222

Subscribers

People subscribed via source and target branches