Merge lp:~renatofilho/address-book-app/release-2014-08-14 into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 245
Merged at revision: 275
Proposed branch: lp:~renatofilho/address-book-app/release-2014-08-14
Merge into: lp:address-book-app
Diff against target: 2449 lines (+872/-493)
51 files modified
po/address-book-app.pot (+39/-42)
src/imports/Common/CMakeLists.txt (+0/-3)
src/imports/Common/ContactDetailItem.qml (+2/-1)
src/imports/Common/RemoveContactsDialog.qml (+2/-2)
src/imports/ContactEdit/AddFieldDialog.qml (+4/-3)
src/imports/ContactEdit/AvatarImport.qml (+83/-41)
src/imports/ContactEdit/ContactDetailAddressesEditor.qml (+8/-8)
src/imports/ContactEdit/ContactDetailAvatarEditor.qml (+9/-3)
src/imports/ContactEdit/ContactDetailEmailsEditor.qml (+5/-4)
src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml (+6/-6)
src/imports/ContactEdit/ContactDetailNameEditor.qml (+5/-4)
src/imports/ContactEdit/ContactDetailOnlineAccountsEditor.qml (+4/-5)
src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml (+6/-8)
src/imports/ContactEdit/ContactDetailPhoneNumbersEditor.qml (+4/-5)
src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml (+4/-4)
src/imports/ContactEdit/ContactDetailWithTypeEditor.qml (+3/-4)
src/imports/ContactEdit/ContactEditor.qml (+9/-7)
src/imports/ContactList/ContactListPage.qml (+8/-7)
src/imports/ContactView/CMakeLists.txt (+0/-13)
src/imports/ContactView/ContactDetailSyncTargetView.qml (+1/-0)
src/imports/ContactView/ContactView.qml (+11/-107)
src/imports/ContentHubProxy.qml.moved (+0/-42)
src/imports/MainWindow.qml (+1/-8)
src/imports/Ubuntu/Contacts/BasicFieldView.qml (+0/-2)
src/imports/Ubuntu/Contacts/CMakeLists.txt (+22/-6)
src/imports/Ubuntu/Contacts/ContactAvatar.qml (+5/-2)
src/imports/Ubuntu/Contacts/ContactDetailAddressesView.qml (+1/-1)
src/imports/Ubuntu/Contacts/ContactDetailAvatarView.qml (+4/-33)
src/imports/Ubuntu/Contacts/ContactDetailBase.qml (+0/-1)
src/imports/Ubuntu/Contacts/ContactDetailGroupBase.qml (+0/-2)
src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeBase.qml (+0/-1)
src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeView.qml (+0/-2)
src/imports/Ubuntu/Contacts/ContactDetailOnlineAccountsView.qml (+0/-3)
src/imports/Ubuntu/Contacts/ContactDetailOrganizationsView.qml (+1/-4)
src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberView.qml (+0/-4)
src/imports/Ubuntu/Contacts/ContactDetailPhoneNumbersView.qml (+0/-4)
src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml (+1/-1)
src/imports/Ubuntu/Contacts/ContactDetailWithTypeView.qml (+0/-4)
src/imports/Ubuntu/Contacts/ContactListView.qml (+1/-1)
src/imports/Ubuntu/Contacts/ContactPreviewPage.qml (+138/-0)
src/imports/Ubuntu/Contacts/DialogButtons.qml (+0/-62)
src/imports/Ubuntu/Contacts/FastScroll.qml (+3/-3)
src/imports/Ubuntu/Contacts/ListItemWithActions.qml (+41/-22)
src/imports/Ubuntu/Contacts/VCardParser.qml (+57/-0)
src/imports/Ubuntu/Contacts/qmldir (+22/-5)
tests/data/CMakeLists.txt (+2/-0)
tests/data/vcard_single.vcf (+16/-0)
tests/qml/CMakeLists.txt (+4/-0)
tests/qml/tst_ContactPreviewPage.qml (+208/-0)
tests/qml/tst_ListWithActions.qml (+69/-3)
tests/qml/tst_VCardParser.qml (+63/-0)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/release-2014-08-14
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+230882@code.launchpad.net

Commit message

- [Contacts] Created ContactPreviewPage component and extend it to be used by other apps.
- [Contacts] Created VCardParser component.
- [ContactListPage] Fixed contact share on multiselection mode.
- [ListItemWithActions] Filter only visible right side actions.
- [ContactEditorPage] Used ContentPeerPicker to pick a contact avatar.
- [ContactEditorPage] Update "add field" "delete" buttons color.
- [FastScroll] Avoid make the letter empty when scrolling over it, this was causing problems on fast scroll.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:243
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/665/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-amd64-ci/118
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-armhf-ci/118
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-armhf-ci/118/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-i386-ci/118
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3574/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2807/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3467/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4821
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4821/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11513
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2275/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3087
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3087/artifact/work/output/*zip*/output.zip

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

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

PASSED: Continuous integration, rev:243
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/666/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-amd64-ci/119
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-armhf-ci/119
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-armhf-ci/119/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-i386-ci/119
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3584
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2814
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3476
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4831
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4831/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11524
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2283
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3098
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3098/artifact/work/output/*zip*/output.zip

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

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? 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? YES

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

244. By Renato Araujo Oliveira Filho

Removed code used by debug.

245. By Renato Araujo Oliveira Filho

Fixed ContactListPage state change from "selection" to "default".

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

PASSED: Continuous integration, rev:245
http://jenkins.qa.ubuntu.com/job/address-book-app-ci/667/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-amd64-ci/120
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-armhf-ci/120
        deb: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-armhf-ci/120/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/address-book-app-utopic-i386-ci/120
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3628
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2837
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3517
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4875
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4875/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11587
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2302
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3121
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/3121/artifact/work/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested, works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/address-book-app.pot'
2--- po/address-book-app.pot 2014-07-16 12:56:19 +0000
3+++ po/address-book-app.pot 2014-08-15 21:50:36 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: address-book-app\n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2014-07-16 09:55-0300\n"
9+"POT-Creation-Date: 2014-08-13 09:13-0300\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13@@ -22,25 +22,30 @@
14 msgid "%1 vCards imported"
15 msgstr ""
16
17-#: src/imports/ContactList/ContactListPage.qml:202
18-msgid "+ New Contact"
19+#. TRANSLATORS: this refers to creating a new contact
20+#: src/imports/ContactList/ContactListPage.qml:240
21+msgid "+ Create New"
22 msgstr ""
23
24 #: src/imports/ContactEdit/ContactEditor.qml:322
25 msgid "Add Field"
26 msgstr ""
27
28-#: src/imports/ContactList/ContactListPage.qml:462
29+#: src/imports/ContactList/ContactListPage.qml:527
30 msgid "Add contact"
31 msgstr ""
32
33+#: src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml:82
34+msgid "Add number..."
35+msgstr ""
36+
37 #: src/imports/ContactEdit/AddFieldDialog.qml:59
38 #: src/imports/ContactEdit/ContactDetailAddressesEditor.qml:23
39 #: src/imports/ContactView/ContactDetailAddressesView.qml:24
40 msgid "Address"
41 msgstr ""
42
43-#: src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml:77
44+#: src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml:76
45 #: src/imports/ContactView/ContactDetailSyncTargetView.qml:48
46 msgid "Addressbook"
47 msgstr ""
48@@ -49,7 +54,8 @@
49 msgid "Aim"
50 msgstr ""
51
52-#: src/imports/Ubuntu/Contacts/ContactListView.qml:316
53+#. TRANSLATORS: this refers to all contacts
54+#: src/imports/ContactList/ContactListPage.qml:410
55 msgid "All"
56 msgstr ""
57
58@@ -62,13 +68,14 @@
59 msgstr ""
60
61 #: src/imports/ContactEdit/AddFieldDialog.qml:133
62-#: src/imports/ContactEdit/ContactEditor.qml:372
63-#: src/imports/ContactList/ContactListPage.qml:418
64+#: src/imports/ContactEdit/ContactEditor.qml:373
65+#: src/imports/ContactList/ContactListPage.qml:423
66+#: src/imports/MainWindow.qml:133
67 #: src/imports/Ubuntu/Contacts/DialogButtons.qml:37
68 msgid "Cancel"
69 msgstr ""
70
71-#: src/imports/ContactList/ContactListPage.qml:330
72+#: src/imports/ContactList/ContactListPage.qml:447
73 msgid "Cancel selection"
74 msgstr ""
75
76@@ -89,8 +96,8 @@
77 msgstr ""
78
79 #: src/imports/ContactEdit/ContactEditor.qml:337
80-#: src/imports/ContactList/ContactListPage.qml:235
81-#: src/imports/ContactList/ContactListPage.qml:355
82+#: src/imports/ContactList/ContactListPage.qml:267
83+#: src/imports/ContactList/ContactListPage.qml:487
84 msgid "Delete"
85 msgstr ""
86
87@@ -123,7 +130,7 @@
88 msgstr ""
89
90 #: src/imports/ContactView/ContactFetchError.qml:25
91-#: src/imports/MainWindow.qml:112
92+#: src/imports/MainWindow.qml:129
93 msgid "Error"
94 msgstr ""
95
96@@ -131,20 +138,20 @@
97 msgid "Favorite"
98 msgstr ""
99
100-#: src/imports/Ubuntu/Contacts/ContactListView.qml:348
101-msgid "Favourites"
102+#: src/imports/ContactList/ContactListPage.qml:410
103+msgid "Favorites"
104 msgstr ""
105
106 #: src/imports/ContactEdit/ContactDetailNameEditor.qml:83
107 msgid "First name"
108 msgstr ""
109
110-#: src/imports/Ubuntu/Contacts/ContactListView.qml:442
111+#: src/imports/Ubuntu/Contacts/ContactListView.qml:430
112 msgid "Frequently called"
113 msgstr ""
114
115 #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:116
116-#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:99
117+#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:103
118 msgid "Home"
119 msgstr ""
120
121@@ -172,11 +179,7 @@
122 msgid "Last name"
123 msgstr ""
124
125-#: src/imports/ContactEdit/AvatarImport.qml:71
126-msgid "Loading"
127-msgstr ""
128-
129-#: src/imports/ContactList/ContactListPage.qml:320
130+#: src/imports/ContactList/ContactListPage.qml:338
131 msgid "Loading..."
132 msgstr ""
133
134@@ -188,7 +191,7 @@
135 msgid "MSN"
136 msgstr ""
137
138-#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:103
139+#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:107
140 msgid "Mobile"
141 msgstr ""
142
143@@ -214,7 +217,7 @@
144 msgstr ""
145
146 #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:118
147-#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:107
148+#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:111
149 msgid "Other"
150 msgstr ""
151
152@@ -229,15 +232,12 @@
153 msgstr ""
154
155 #: src/imports/ContactEdit/AddFieldDialog.qml:63
156-msgid "Professional Details"
157-msgstr ""
158-
159 #: src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml:23
160 #: src/imports/ContactView/ContactDetailOrganizationsView.qml:27
161-msgid "Professional details"
162+msgid "Professional Details"
163 msgstr ""
164
165-#: src/imports/ContactList/ContactListPage.qml:372
166+#: src/imports/ContactList/ContactListPage.qml:382
167 msgid "Quit"
168 msgstr ""
169
170@@ -249,30 +249,27 @@
171 msgid "Role"
172 msgstr ""
173
174-#: src/imports/ContactEdit/ContactEditor.qml:385
175+#: src/imports/ContactEdit/ContactEditor.qml:386
176 msgid "Save"
177 msgstr ""
178
179-#: src/imports/ContactList/ContactListPage.qml:396
180+#: src/imports/ContactList/ContactListPage.qml:397
181 msgid "Search"
182 msgstr ""
183
184-#: src/imports/ContactList/ContactListPage.qml:355
185-msgid "Select"
186+#: src/imports/ContactList/ContactListPage.qml:353
187+msgid "Search..."
188 msgstr ""
189
190-#: src/imports/ContactList/ContactListPage.qml:339
191+#: src/imports/ContactList/ContactListPage.qml:453
192 msgid "Select All"
193 msgstr ""
194
195-#: src/imports/ContactList/ContactListPage.qml:512
196-msgid "Select Contacts"
197-msgstr ""
198-
199 #: src/imports/ContactEdit/AddFieldDialog.qml:116
200 msgid "Select a field"
201 msgstr ""
202
203+#: src/imports/ContactList/ContactListPage.qml:466
204 #: src/imports/ContactView/ContactView.qml:206
205 msgid "Share"
206 msgstr ""
207@@ -290,15 +287,15 @@
208 msgid "Street"
209 msgstr ""
210
211-#: src/imports/ContactList/ContactListPage.qml:387
212+#: src/imports/ContactList/ContactListPage.qml:391
213 msgid "Sync"
214 msgstr ""
215
216-#: src/imports/ContactList/ContactListPage.qml:387
217+#: src/imports/ContactList/ContactListPage.qml:391
218 msgid "Syncing"
219 msgstr ""
220
221-#: src/imports/ContactList/ContactListPage.qml:320
222+#: src/imports/ContactList/ContactListPage.qml:338
223 msgid "Syncing..."
224 msgstr ""
225
226@@ -311,11 +308,11 @@
227 msgstr ""
228
229 #: src/imports/Common/ContactDetailGroupWithTypeBase.qml:117
230-#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:101
231+#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:105
232 msgid "Work"
233 msgstr ""
234
235-#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:105
236+#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:109
237 msgid "Work Mobile"
238 msgstr ""
239
240
241=== modified file 'src/imports/Common/CMakeLists.txt'
242--- src/imports/Common/CMakeLists.txt 2014-06-05 16:46:28 +0000
243+++ src/imports/Common/CMakeLists.txt 2014-08-15 21:50:36 +0000
244@@ -1,8 +1,5 @@
245 set(CONTACT_COMMON_QMLS
246- ContactDetailBase.qml
247 ContactDetailItem.qml
248- ContactDetailGroupBase.qml
249- ContactDetailGroupWithTypeBase.qml
250 KeyboardRectangle.qml
251 RemoveContactsDialog.qml
252 StandardAnimation.qml
253
254=== modified file 'src/imports/Common/ContactDetailItem.qml'
255--- src/imports/Common/ContactDetailItem.qml 2014-07-20 20:23:20 +0000
256+++ src/imports/Common/ContactDetailItem.qml 2014-08-15 21:50:36 +0000
257@@ -15,8 +15,9 @@
258 */
259
260 import QtQuick 2.2
261+
262 import Ubuntu.Components 1.1
263-import Ubuntu.Components.ListItems 1.0 as ListItem
264+import Ubuntu.Contacts 0.1
265
266 ContactDetailBase {
267 id: root
268
269=== modified file 'src/imports/Common/RemoveContactsDialog.qml'
270--- src/imports/Common/RemoveContactsDialog.qml 2014-07-20 20:23:20 +0000
271+++ src/imports/Common/RemoveContactsDialog.qml 2014-08-15 21:50:36 +0000
272@@ -16,9 +16,9 @@
273
274 import QtQuick 2.2
275 import Ubuntu.Components 1.1
276-import Ubuntu.Components.Popups 1.0 as Popups
277+import Ubuntu.Components.Popups 1.0
278
279-Popups.Dialog {
280+Dialog {
281 objectName: "removeContactsDialog"
282
283 property var contacts: []
284
285=== modified file 'src/imports/ContactEdit/AddFieldDialog.qml'
286--- src/imports/ContactEdit/AddFieldDialog.qml 2014-07-20 20:23:20 +0000
287+++ src/imports/ContactEdit/AddFieldDialog.qml 2014-08-15 21:50:36 +0000
288@@ -15,9 +15,10 @@
289 */
290
291 import QtQuick 2.2
292+import QtContacts 5.0
293+
294 import Ubuntu.Components 1.1
295-import QtContacts 5.0
296-import Ubuntu.Components.Popups 1.0 as Popups
297+import Ubuntu.Components.Popups 1.0
298
299
300 Item {
301@@ -109,7 +110,7 @@
302 Component {
303 id: addFieldDialog
304
305- Popups.Dialog {
306+ Dialog {
307 id: dialogue
308 objectName: "addFieldDialog"
309
310
311=== modified file 'src/imports/ContactEdit/AvatarImport.qml'
312--- src/imports/ContactEdit/AvatarImport.qml 2014-07-20 20:23:20 +0000
313+++ src/imports/ContactEdit/AvatarImport.qml 2014-08-15 21:50:36 +0000
314@@ -15,64 +15,106 @@
315 */
316
317 import QtQuick 2.2
318+
319 import Ubuntu.Components 1.1
320-import Ubuntu.Components.Popups 1.0 as Popups
321-import Ubuntu.Content 0.1 as ContentHub
322+import Ubuntu.Components.Popups 1.0
323+import Ubuntu.Content 0.1
324
325 Item {
326 id: root
327
328- property var activeTransfer: null
329- property var loadingDialog: null
330+ property var importDialog: null
331
332 signal avatarReceived(string avatarUrl)
333
334 function requestNewAvatar()
335 {
336- if (!root.loadingDialog) {
337- root.loadingDialog = PopupUtils.open(loadingDialog, null)
338- root.activeTransfer = defaultSource.request();
339- }
340- }
341-
342- ContentHub.ContentPeer {
343- id: defaultSource
344-
345- contentType: ContentHub.ContentType.Pictures
346- handler: ContentHub.ContentHandler.Source
347- selectionType: ContentHub.ContentTransfer.Single
348- }
349-
350- Connections {
351- target: root.activeTransfer
352- onStateChanged: {
353- var done = ((root.activeTransfer.state === ContentHub.ContentTransfer.Charged) ||
354- (root.activeTransfer.state === ContentHub.ContentTransfer.Aborted));
355-
356- if (root.activeTransfer.state === ContentHub.ContentTransfer.Charged) {
357- if (root.activeTransfer.items.length > 0) {
358- root.avatarReceived(root.activeTransfer.items[0].url)
359- }
360- }
361-
362- if (done) {
363- PopupUtils.close(root.loadingDialog)
364- root.loadingDialog = null
365- }
366+ if (!root.importDialog) {
367+ root.importDialog = PopupUtils.open(contentHubDialog, null)
368+ } else {
369+ console.warn("Import dialog already running")
370 }
371 }
372
373 Component {
374- id: loadingDialog
375+ id: contentHubDialog
376
377- Popups.Dialog {
378+ PopupBase {
379 id: dialogue
380
381- title: i18n.tr("Loading")
382- ActivityIndicator {
383- running: true
384- visible: running
385- }
386+ property alias activeTransfer: signalConnections.target
387+
388+ parent: QuickUtils.rootItem(this)
389+ focus: true
390+
391+ Rectangle {
392+ anchors.fill: parent
393+
394+ ContentTransferHint {
395+ anchors.fill: parent
396+ activeTransfer: dialogue.activeTransfer
397+ }
398+
399+ ContentPeerPicker {
400+ id: peerPicker
401+
402+ anchors.fill: parent
403+ visible: dialogue.done
404+ contentType: ContentType.Pictures
405+ handler: ContentHandler.Source
406+
407+ onPeerSelected: {
408+ peer.selectionType = ContentTransfer.Single
409+ dialogue.activeTransfer = peer.request()
410+ }
411+
412+ onCancelPressed: {
413+ PopupUtils.close(root.importDialog)
414+ }
415+ }
416+ }
417+
418+ Connections {
419+ id: signalConnections
420+
421+ target: dialogue.activeTransfer
422+ onStateChanged: {
423+ var done = ((dialogue.activeTransfer.state === ContentTransfer.Charged) ||
424+ (dialogue.activeTransfer.state === ContentTransfer.Aborted))
425+
426+ if (dialogue.activeTransfer.state === ContentTransfer.Charged) {
427+ dialogue.hide()
428+ if (dialogue.activeTransfer.items.length > 0) {
429+ root.avatarReceived(dialogue.activeTransfer.items[0].url)
430+ }
431+ }
432+
433+ if (done) {
434+ acceptTimer.restart()
435+ }
436+ }
437+ }
438+
439+ // WORKAROUND: Work around for application becoming insensitive to touch events
440+ // if the dialog is dismissed while the application is inactive.
441+ // Just listening for changes to Qt.application.active doesn't appear
442+ // to be enough to resolve this, so it seems that something else needs
443+ // to be happening first. As such there's a potential for a race
444+ // condition here, although as yet no problem has been encountered.
445+ Timer {
446+ id: acceptTimer
447+
448+ interval: 100
449+ repeat: true
450+ running: false
451+ onTriggered: {
452+ if(Qt.application.active) {
453+ PopupUtils.close(root.importDialog)
454+ }
455+ }
456+ }
457+
458+ Component.onDestruction: root.importDialog = null
459 }
460 }
461 }
462
463=== modified file 'src/imports/ContactEdit/ContactDetailAddressesEditor.qml'
464--- src/imports/ContactEdit/ContactDetailAddressesEditor.qml 2014-05-06 13:18:07 +0000
465+++ src/imports/ContactEdit/ContactDetailAddressesEditor.qml 2014-08-15 21:50:36 +0000
466@@ -15,19 +15,19 @@
467 */
468
469 import QtQuick 2.2
470-import QtContacts 5.0 as QtContacts
471+import QtContacts 5.0
472
473-import "../Common"
474+import Ubuntu.Contacts 0.1
475
476 ContactDetailGroupWithTypeEditor {
477 title: i18n.tr("Address")
478 detailQmlTypeName: "Address"
479- detailType: QtContacts.ContactDetail.Address
480- fields: [ QtContacts.Address.Street,
481- QtContacts.Address.Locality,
482- QtContacts.Address.Region,
483- QtContacts.Address.Postcode,
484- QtContacts.Address.Country ]
485+ detailType: ContactDetail.Address
486+ fields: [ Address.Street,
487+ Address.Locality,
488+ Address.Region,
489+ Address.Postcode,
490+ Address.Country ]
491 placeholderTexts: [ i18n.tr("Street"),
492 i18n.tr("Locality"),
493 i18n.tr("Region"),
494
495=== modified file 'src/imports/ContactEdit/ContactDetailAvatarEditor.qml'
496--- src/imports/ContactEdit/ContactDetailAvatarEditor.qml 2014-07-28 23:12:24 +0000
497+++ src/imports/ContactEdit/ContactDetailAvatarEditor.qml 2014-08-15 21:50:36 +0000
498@@ -15,10 +15,10 @@
499 */
500
501 import QtQuick 2.2
502+import QtContacts 5.0
503+
504 import Ubuntu.Components 1.1
505-import QtContacts 5.0
506-
507-import "../Common"
508+import Ubuntu.Contacts 0.1
509
510 ContactDetailBase {
511 id: root
512@@ -89,6 +89,12 @@
513 }
514 }
515
516+ ActivityIndicator {
517+ anchors.centerIn: avatar
518+ running: (avatarImport.importDialog != null)
519+ visible: running
520+ }
521+
522 AvatarImport {
523 id: avatarImport
524
525
526=== modified file 'src/imports/ContactEdit/ContactDetailEmailsEditor.qml'
527--- src/imports/ContactEdit/ContactDetailEmailsEditor.qml 2014-05-06 13:18:07 +0000
528+++ src/imports/ContactEdit/ContactDetailEmailsEditor.qml 2014-08-15 21:50:36 +0000
529@@ -15,14 +15,15 @@
530 */
531
532 import QtQuick 2.2
533-import QtContacts 5.0 as QtContacts
534-
535-import "../Common"
536+import QtContacts 5.0
537+
538+import Ubuntu.Contacts 0.1
539+
540
541 ContactDetailGroupWithTypeEditor {
542 title: i18n.tr("Email")
543 detailQmlTypeName: "EmailAddress"
544- detailType: QtContacts.ContactDetail.Email
545+ detailType: ContactDetail.Email
546 fields: [ 0 ]
547 placeholderTexts: [ i18n.tr("Enter an email address") ]
548 inputMethodHints: Qt.ImhEmailCharactersOnly
549
550=== modified file 'src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml'
551--- src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2014-07-20 20:23:20 +0000
552+++ src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2014-08-15 21:50:36 +0000
553@@ -15,18 +15,18 @@
554 */
555
556 import QtQuick 2.2
557+import QtContacts 5.0
558+
559 import Ubuntu.Components 1.1
560-import QtContacts 5.0 as QtContacts
561-import Ubuntu.Components.ListItems 1.0 as ListItem
562-
563-import "../Common"
564+import Ubuntu.Components.ListItems 1.0
565+import Ubuntu.Contacts 0.1
566
567 ContactDetailGroupWithTypeBase {
568 id: root
569
570 property string detailQmlTypeName
571 property int currentItem: -1
572- property int fieldType: QtContacts.ContactDetail.FieldContext
573+ property int fieldType: ContactDetail.FieldContext
574 property variant placeholderTexts: []
575 property int inputMethodHints: Qt.ImhNone
576 property variant newDetails: []
577@@ -96,7 +96,7 @@
578 return changed
579 }
580
581- headerDelegate: ListItem.Empty {
582+ headerDelegate: Empty {
583 id: header
584 highlightWhenPressed: false
585
586
587=== modified file 'src/imports/ContactEdit/ContactDetailNameEditor.qml'
588--- src/imports/ContactEdit/ContactDetailNameEditor.qml 2014-07-20 20:23:20 +0000
589+++ src/imports/ContactEdit/ContactDetailNameEditor.qml 2014-08-15 21:50:36 +0000
590@@ -15,8 +15,9 @@
591 */
592
593 import QtQuick 2.2
594+import QtContacts 5.0
595+
596 import Ubuntu.Components 1.1
597-import QtContacts 5.0 as QtContacts
598
599 import "../Common"
600
601@@ -53,11 +54,11 @@
602
603 spacing: units.gu(1)
604 detail: root.contact ? root.contact.name : null
605- fields: [ QtContacts.Name.FirstName, QtContacts.Name.LastName ]
606+ fields: [ Name.FirstName, Name.LastName ]
607
608 fieldDelegate: TextInputDetail {
609 id: textInputDetail
610- objectName: detailToString(QtContacts.ContactDetail.Name, field)
611+ objectName: detailToString(ContactDetail.Name, field)
612
613 function checkIsEmpty() {
614 if (field == -1) {
615@@ -80,7 +81,7 @@
616 x: units.gu(2)
617 detail: root.detail
618 height: units.gu(4)
619- placeholderText: field == QtContacts.Name.FirstName ? i18n.tr("First name") : i18n.tr("Last name")
620+ placeholderText: field == Name.FirstName ? i18n.tr("First name") : i18n.tr("Last name")
621 inputMethodHints: Qt.ImhNoPredictiveText
622 onTextChanged: checkIsEmpty()
623 onFieldChanged: checkIsEmpty()
624
625=== modified file 'src/imports/ContactEdit/ContactDetailOnlineAccountsEditor.qml'
626--- src/imports/ContactEdit/ContactDetailOnlineAccountsEditor.qml 2014-05-06 13:18:07 +0000
627+++ src/imports/ContactEdit/ContactDetailOnlineAccountsEditor.qml 2014-08-15 21:50:36 +0000
628@@ -15,16 +15,15 @@
629 */
630
631 import QtQuick 2.2
632-import QtContacts 5.0 as QtContacts
633+import QtContacts 5.0
634+
635 import Ubuntu.Contacts 0.1
636
637-import "../Common"
638-
639 ContactDetailGroupWithTypeEditor {
640 title: i18n.tr("IM")
641- detailType: QtContacts.ContactDetail.OnlineAccount
642+ detailType: ContactDetail.OnlineAccount
643 detailQmlTypeName: "OnlineAccount"
644- fields: [ QtContacts.OnlineAccount.AccountUri ]
645+ fields: [ OnlineAccount.AccountUri ]
646 placeholderTexts: [ i18n.tr("Enter a social alias") ]
647 typeModel: ContactDetailOnlineAccountTypeModel { }
648 inputMethodHints: Qt.ImhEmailCharactersOnly
649
650=== modified file 'src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml'
651--- src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml 2014-05-06 13:18:07 +0000
652+++ src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml 2014-08-15 21:50:36 +0000
653@@ -15,18 +15,16 @@
654 */
655
656 import QtQuick 2.2
657-import QtContacts 5.0 as QtContacts
658-
659-import "../Common"
660+import QtContacts 5.0
661
662 ContactDetailGroupWithTypeEditor {
663- title: i18n.tr("Professional details")
664+ title: i18n.tr("Professional Details")
665 typeModel: null
666 detailQmlTypeName: "Organization"
667- detailType: QtContacts.ContactDetail.Organization
668- fields: [ QtContacts.Organization.Name,
669- QtContacts.Organization.Role,
670- QtContacts.Organization.Title ]
671+ detailType: ContactDetail.Organization
672+ fields: [ Organization.Name,
673+ Organization.Role,
674+ Organization.Title ]
675 placeholderTexts: [ i18n.tr("Organization"),
676 i18n.tr("Role"),
677 i18n.tr("Title")
678
679=== modified file 'src/imports/ContactEdit/ContactDetailPhoneNumbersEditor.qml'
680--- src/imports/ContactEdit/ContactDetailPhoneNumbersEditor.qml 2014-05-13 18:53:02 +0000
681+++ src/imports/ContactEdit/ContactDetailPhoneNumbersEditor.qml 2014-08-15 21:50:36 +0000
682@@ -15,16 +15,15 @@
683 */
684
685 import QtQuick 2.2
686-import QtContacts 5.0 as QtContacts
687+import QtContacts 5.0
688+
689 import Ubuntu.Contacts 0.1
690
691-import "../Common"
692-
693 ContactDetailGroupWithTypeEditor {
694 title: i18n.tr("Phone")
695- detailType: QtContacts.ContactDetail.PhoneNumber
696+ detailType: ContactDetail.PhoneNumber
697 detailQmlTypeName: "PhoneNumber"
698- fields: [ QtContacts.PhoneNumber.Number ]
699+ fields: [ PhoneNumber.Number ]
700 placeholderTexts: [ i18n.tr("Enter a number") ]
701 typeModel: ContactDetailPhoneNumberTypeModel { }
702 inputMethodHints: Qt.ImhDialableCharactersOnly
703
704=== modified file 'src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml'
705--- src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml 2014-07-20 20:26:54 +0000
706+++ src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml 2014-08-15 21:50:36 +0000
707@@ -16,10 +16,10 @@
708
709 import QtQuick 2.2
710 import QtContacts 5.0
711+
712 import Ubuntu.Components 1.1
713-import Ubuntu.Components.ListItems 1.0 as ListItem
714-
715-import "../Common"
716+import Ubuntu.Components.ListItems 1.0
717+import Ubuntu.Contacts 0.1
718
719 ContactDetailBase {
720 id: root
721@@ -83,7 +83,7 @@
722 height: units.gu(4)
723 }
724
725- ListItem.ThinDivider {
726+ ThinDivider {
727 id: divider
728
729 anchors.top: label.bottom
730
731=== modified file 'src/imports/ContactEdit/ContactDetailWithTypeEditor.qml'
732--- src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2014-07-20 20:23:20 +0000
733+++ src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2014-08-15 21:50:36 +0000
734@@ -15,11 +15,10 @@
735 */
736
737 import QtQuick 2.2
738+import QtContacts 5.0
739+
740 import Ubuntu.Components 1.1
741-import QtContacts 5.0
742-import Ubuntu.Components.ListItems 1.0 as ListItem
743-
744-import "../Common"
745+import Ubuntu.Contacts 0.1
746
747 ContactDetailBase {
748 id: root
749
750=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
751--- src/imports/ContactEdit/ContactEditor.qml 2014-07-22 10:39:49 +0000
752+++ src/imports/ContactEdit/ContactEditor.qml 2014-08-15 21:50:36 +0000
753@@ -16,9 +16,10 @@
754
755 import QtQuick 2.2
756 import QtContacts 5.0
757+
758 import Ubuntu.Components 1.1
759-import Ubuntu.Components.ListItems 1.0 as ListItem
760-import Ubuntu.Components.Popups 1.0 as Popups
761+import Ubuntu.Components.ListItems 1.0
762+import Ubuntu.Components.Popups 1.0
763
764 import "../Common"
765
766@@ -288,7 +289,7 @@
767 height: implicitHeight
768 }
769
770- ListItem.ThinDivider {}
771+ ThinDivider {}
772
773 Item {
774 anchors {
775@@ -320,7 +321,7 @@
776 objectName: "addNewFieldButton"
777
778 text: i18n.tr("Add Field")
779- gradient: UbuntuColors.greyGradient
780+ strokeColor: UbuntuColors.warmGrey
781 anchors {
782 top: parent.top
783 bottom: parent.bottom
784@@ -336,6 +337,7 @@
785
786 text: i18n.tr("Delete")
787 visible: !contactEditor.isNewContact
788+ color: "red"
789 anchors {
790 top: parent.top
791 bottom: parent.bottom
792@@ -343,7 +345,7 @@
793 }
794 width: (parent.width / 2) - units.gu(1)
795 onClicked: {
796- var dialog = Popups.PopupUtils.open(removeContactDialog, null)
797+ var dialog = PopupUtils.open(removeContactDialog, null)
798 dialog.contacts = [contactEditor.contact]
799 }
800 }
801@@ -427,13 +429,13 @@
802 property var popPages: false
803
804 onCanceled: {
805- Popups.PopupUtils.close(removeContactsDialogMessage)
806+ PopupUtils.close(removeContactsDialogMessage)
807 }
808
809 onAccepted: {
810 popPages = true
811 removeContacts(contactEditor.model)
812- Popups.PopupUtils.close(removeContactsDialogMessage)
813+ PopupUtils.close(removeContactsDialogMessage)
814 }
815
816 // hide virtual keyboard if necessary
817
818=== modified file 'src/imports/ContactList/ContactListPage.qml'
819--- src/imports/ContactList/ContactListPage.qml 2014-07-31 07:56:49 +0000
820+++ src/imports/ContactList/ContactListPage.qml 2014-08-15 21:50:36 +0000
821@@ -236,6 +236,7 @@
822 rightMargin: units.gu(2)
823 }
824 color: UbuntuColors.lightAubergine
825+ // TRANSLATORS: this refers to creating a new contact
826 text: i18n.tr("+ Create New")
827 elide: Text.ElideRight
828 }
829@@ -301,6 +302,7 @@
830
831 onAddDetailClicked: mainPage.addPhoneToContact(contact.contactId, " ")
832
833+ onIsInSelectionModeChanged: mainPage.state = isInSelectionMode ? "selection" : "default"
834 onSelectionCanceled: {
835 if (pickMode) {
836 if (contentHubTransfer) {
837@@ -308,7 +310,6 @@
838 }
839 pickMode = false
840 contentHubTransfer = null
841- console.debug("UPDATE STATE:" + mainPage.state )
842 application.returnVcard("")
843 }
844 mainPage.state = "default"
845@@ -369,7 +370,6 @@
846 }
847
848 state: "default"
849- onStateChanged: console.debug("STATE CHANGEDDDDD" + state)
850 states: [
851 PageHeadState {
852 id: defaultState
853@@ -405,7 +405,8 @@
854 target: mainPage.head
855 backAction: defaultState.backAction
856 actions: defaultState.actions
857- sections.model: ["All", "Favorites"]
858+ // TRANSLATORS: this refers to all contacts
859+ sections.model: [i18n.tr("All"), i18n.tr("Favorites")]
860 }
861 PropertyChanges {
862 target: searchField
863@@ -440,7 +441,6 @@
864 id: selectionState
865
866 name: "selection"
867- when: contactList.isInSelectionMode
868 backAction: Action {
869 text: i18n.tr("Cancel selection")
870 iconName: "close"
871@@ -468,16 +468,18 @@
872 var contacts = []
873 var items = contactList.selectedItems
874
875- for (var i=0; i < items.count; i++) {
876+ for (var i=0, iMax=items.count; i < iMax; i++) {
877 contacts.push(items.get(i).model.contact)
878 }
879+
880 if (mainPage.pickMode) {
881 contactExporter.exportContacts(contacts)
882 mainPage.pickMode = false
883 } else {
884 pageStack.push(Qt.resolvedUrl("../ContactShare/ContactSharePage.qml"),
885- { contactModel: contactList.model, contacts: contacts })
886+ { contactModel: contactList.listModel, contacts: contacts })
887 }
888+ contactList.endSelection()
889 }
890 },
891 Action {
892@@ -486,7 +488,6 @@
893 iconName: "delete"
894 visible: contactList.isInSelectionMode && !mainPage.pickMode
895 onTriggered: {
896-
897 var contacts = []
898 var items = contactList.selectedItems
899
900
901=== modified file 'src/imports/ContactView/CMakeLists.txt'
902--- src/imports/ContactView/CMakeLists.txt 2014-06-12 17:21:38 +0000
903+++ src/imports/ContactView/CMakeLists.txt 2014-08-15 21:50:36 +0000
904@@ -1,19 +1,6 @@
905 set(CONTACT_VIEW_QMLS
906- ActionButton.qml
907- BasicFieldView.qml
908- ContactDetailAddressesView.qml
909- ContactDetailAvatarView.qml
910- ContactDetailEmailsView.qml
911- ContactDetailGroupWithTypeView.qml
912- ContactDetailNameView.qml
913- ContactDetailOnlineAccountsView.qml
914- ContactDetailOrganizationsView.qml
915- ContactDetailPhoneNumbersView.qml
916- ContactDetailPhoneNumberView.qml
917 ContactDetailSyncTargetView.qml
918- ContactDetailWithTypeView.qml
919 ContactFetchError.qml
920- ContactHeaderView.qml
921 ContactView.qml
922 )
923
924
925=== modified file 'src/imports/ContactView/ContactDetailSyncTargetView.qml'
926--- src/imports/ContactView/ContactDetailSyncTargetView.qml 2014-07-20 20:23:20 +0000
927+++ src/imports/ContactView/ContactDetailSyncTargetView.qml 2014-08-15 21:50:36 +0000
928@@ -17,6 +17,7 @@
929 import QtQuick 2.2
930 import Ubuntu.Components 1.1
931 import QtContacts 5.0
932+import Ubuntu.Contacts 0.1
933
934 ContactDetailGroupWithTypeView {
935 id: root
936
937=== modified file 'src/imports/ContactView/ContactView.qml'
938--- src/imports/ContactView/ContactView.qml 2014-07-28 16:59:18 +0000
939+++ src/imports/ContactView/ContactView.qml 2014-08-15 21:50:36 +0000
940@@ -15,37 +15,19 @@
941 */
942
943 import QtQuick 2.2
944-import QtContacts 5.0
945 import Ubuntu.Components 1.1
946-import Ubuntu.Components.ListItems 1.0 as ListItem
947-import Ubuntu.Contacts 0.1 as ContactsUI
948 import Ubuntu.Components.Popups 1.0 as Popups
949+import Ubuntu.Contacts 0.1
950
951-Page {
952+ContactPreviewPage {
953 id: root
954 objectName: "contactViewPage"
955
956- property QtObject contact: null
957 property alias model: contactFetch.model
958 // used by main page to open the contact view on app startup
959 property string contactId: ""
960 property string addPhoneToContact: ""
961
962- function formatNameToDisplay(contact) {
963- if (!contact) {
964- return ""
965- }
966- if (contact.name) {
967- var detail = contact.name
968- return detail.firstName +" " + detail.lastName
969- } else if (contact.displayLabel && contact.displayLabel.label && contact.displayLabel.label !== "") {
970- return contact.displayLabel.label
971- } else {
972- return ""
973- }
974- }
975-
976- title: formatNameToDisplay(contact)
977 onActiveChanged: {
978 if (active) {
979 //WORKAROUND: to correct scroll back the page
980@@ -60,98 +42,20 @@
981 }
982 }
983
984- Flickable {
985- id: flickable
986-
987- flickableDirection: Flickable.VerticalFlick
988- anchors.fill: parent
989- //WORKAROUND: There is a bug on SDK page that causes the page to appear flicked with small contents
990- // see bug #1223050
991- contentHeight: Math.max(contents.height, parent.height) + units.gu(2)
992- contentWidth: parent.width
993- visible: !busyIndicator.visible
994-
995- Column {
996- id: contents
997-
998- height: childrenRect.height
999- anchors {
1000- top: parent.top
1001- topMargin: units.gu(2)
1002- left: parent.left
1003- right: parent.right
1004- }
1005-
1006- ContactDetailAvatarView {
1007- contact: root.contact
1008- anchors.left: parent.left
1009- height: implicitHeight
1010- width: implicitWidth
1011- }
1012-
1013- ContactDetailPhoneNumbersView {
1014- objectName: "phones"
1015-
1016- contact: root.contact
1017- anchors {
1018- left: parent.left
1019- right: parent.right
1020- }
1021- height: implicitHeight
1022- }
1023-
1024- ContactDetailEmailsView {
1025- objectName: "emails"
1026-
1027- contact: root.contact
1028- anchors {
1029- left: parent.left
1030- right: parent.right
1031- }
1032- height: implicitHeight
1033- }
1034-
1035- ContactDetailOnlineAccountsView {
1036- contact: root.contact
1037- anchors {
1038- left: parent.left
1039- right: parent.right
1040- }
1041- height: implicitHeight
1042- }
1043-
1044- ContactDetailAddressesView {
1045- contact: root.contact
1046- anchors {
1047- left: parent.left
1048- right: parent.right
1049- }
1050- height: implicitHeight
1051- }
1052-
1053- ContactDetailOrganizationsView {
1054- contact: root.contact
1055- anchors {
1056- left: parent.left
1057- right: parent.right
1058- }
1059- height: implicitHeight
1060- }
1061-
1062- ContactDetailSyncTargetView {
1063- contact: root.contact
1064- anchors {
1065- left: parent.left
1066- right: parent.right
1067- }
1068- height: implicitHeight
1069- }
1070+ extensions: ContactDetailSyncTargetView {
1071+ contact: root.contact
1072+ anchors {
1073+ left: parent.left
1074+ right: parent.right
1075 }
1076+ height: implicitHeight
1077 }
1078
1079 ActivityIndicator {
1080 id: busyIndicator
1081
1082+ parent: root
1083+
1084 running: (root.contact === null) && contactFetch.running
1085 visible: running
1086 anchors.centerIn: parent
1087@@ -161,7 +65,7 @@
1088 id: fetchErrorDialog
1089 }
1090
1091- ContactsUI.ContactFetch {
1092+ ContactFetch {
1093 id: contactFetch
1094
1095 onContactRemoved: {
1096
1097=== removed file 'src/imports/ContentHubProxy.qml.moved'
1098--- src/imports/ContentHubProxy.qml.moved 2014-07-28 23:12:24 +0000
1099+++ src/imports/ContentHubProxy.qml.moved 1970-01-01 00:00:00 +0000
1100@@ -1,42 +0,0 @@
1101-/*
1102- * Copyright (C) 2012-2013 Canonical, Ltd.
1103- *
1104- * This program is free software; you can redistribute it and/or modify
1105- * it under the terms of the GNU General Public License as published by
1106- * the Free Software Foundation; version 3.
1107- *
1108- * This program is distributed in the hope that it will be useful,
1109- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1110- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1111- * GNU General Public License for more details.
1112- *
1113- * You should have received a copy of the GNU General Public License
1114- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1115- */
1116-
1117-import QtQuick 2.2
1118-import Ubuntu.Content 0.1 as ContentHub
1119-
1120-QtObject {
1121- property QtObject pageStack: null
1122- property list<QtObject> objects: [
1123- Connections {
1124- target: ContentHub.ContentHub
1125- onExportRequested: {
1126- // enter in pick mode
1127- pageStack.push(Qt.createComponent("ContactList/ContactListPage.qml"),
1128- {pickMode: true,
1129- contentHubTransfer: transfer})
1130- }
1131- onImportRequested: {
1132- if (transfer.state === ContentHub.ContentTransfer.Charged) {
1133- var urls = []
1134- for(var i=0; i < transfer.items.length; i++) {
1135- urls.push(transfer.items[i].url)
1136- }
1137- pageStack.contactList.importContact(urls)
1138- }
1139- }
1140- }
1141- ]
1142-}
1143
1144=== modified file 'src/imports/MainWindow.qml'
1145--- src/imports/MainWindow.qml 2014-07-28 23:12:24 +0000
1146+++ src/imports/MainWindow.qml 2014-08-15 21:50:36 +0000
1147@@ -130,7 +130,7 @@
1148 text: mainWindow.modelErrorMessage
1149
1150 Button {
1151- text: "Cancel"
1152+ text: i18n.tr("Cancel")
1153 gradient: UbuntuColors.greyGradient
1154 onClicked: PopupUtils.close(dialogue)
1155 }
1156@@ -165,11 +165,4 @@
1157 mainStack.contactListPage.returnToNormalState()
1158 }
1159 }
1160-
1161- Image {
1162- source: Qt.resolvedUrl("grid.jpg")
1163- asynchronous: true
1164- anchors.fill: parent
1165- opacity: 0.3
1166- }
1167 }
1168
1169=== renamed file 'src/imports/ContactView/ActionButton.qml' => 'src/imports/Ubuntu/Contacts/ActionButton.qml'
1170=== renamed file 'src/imports/ContactView/BasicFieldView.qml' => 'src/imports/Ubuntu/Contacts/BasicFieldView.qml'
1171--- src/imports/ContactView/BasicFieldView.qml 2014-07-20 20:23:20 +0000
1172+++ src/imports/Ubuntu/Contacts/BasicFieldView.qml 2014-08-15 21:50:36 +0000
1173@@ -17,8 +17,6 @@
1174 import QtQuick 2.2
1175 import Ubuntu.Components 1.1
1176
1177-import "../Common"
1178-
1179 Item {
1180 id: root
1181
1182
1183=== modified file 'src/imports/Ubuntu/Contacts/CMakeLists.txt'
1184--- src/imports/Ubuntu/Contacts/CMakeLists.txt 2014-07-31 10:46:27 +0000
1185+++ src/imports/Ubuntu/Contacts/CMakeLists.txt 2014-08-15 21:50:36 +0000
1186@@ -1,27 +1,42 @@
1187 set(CONTACT_COMPONENTS_PLUGIN "ubuntu-contacts-qml")
1188
1189 set(CONTACT_COMPONENTS_QMLS
1190- ContactList.js
1191+ ActionButton.qml
1192+ BasicFieldView.qml
1193 ContactAvatar.qml
1194 ContactDelegate.qml
1195+ ContactDetailAddressesView.qml
1196+ ContactDetailAvatarView.qml
1197+ ContactDetailBase.qml
1198+ ContactDetailEmailsView.qml
1199+ ContactDetailGroupBase.qml
1200+ ContactDetailGroupWithTypeBase.qml
1201+ ContactDetailGroupWithTypeView.qml
1202+ ContactDetailOnlineAccountsView.qml
1203 ContactDetailOnlineAccountTypeModel.qml
1204+ ContactDetailOrganizationsView.qml
1205+ ContactDetailPhoneNumbersView.qml
1206 ContactDetailPhoneNumberTypeModel.qml
1207+ ContactDetailPhoneNumberView.qml
1208 ContactDetailPickerPhoneNumberDelegate.qml
1209+ ContactDetailWithTypeView.qml
1210 ContactFetch.qml
1211+ ContactList.js
1212 ContactListView.qml
1213+ ContactPreviewPage.qml
1214+ ContactSimpleListView.qml
1215 Contacts.js
1216- ContactSimpleListView.qml
1217- DialogButtons.qml
1218+ FastScroll.js
1219 FastScroll.qml
1220- FastScroll.js
1221+ ListItemWithActionsCheckBox.qml
1222 ListItemWithActions.qml
1223- ListItemWithActionsCheckBox.qml
1224 MostCalledModel.qml
1225 MultipleSelectionListView.qml
1226 MultipleSelectionVisualModel.qml
1227 PageWithBottomEdge.qml
1228+ qmldir
1229 SubtitledWithColors.qml
1230- qmldir
1231+ VCardParser.qml
1232 )
1233
1234 set(CONTACT_COMPONENTS_SRC
1235@@ -60,3 +75,4 @@
1236 if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
1237 add_dependencies(${CONTACT_COMPONENTS_PLUGIN} copy_qml)
1238 endif()
1239+
1240
1241=== modified file 'src/imports/Ubuntu/Contacts/ContactAvatar.qml'
1242--- src/imports/Ubuntu/Contacts/ContactAvatar.qml 2014-07-20 20:23:20 +0000
1243+++ src/imports/Ubuntu/Contacts/ContactAvatar.qml 2014-08-15 21:50:36 +0000
1244@@ -29,7 +29,7 @@
1245 property bool showAvatarPicture: (avatarUrl != fallbackAvatarUrl) || (initials.length === 0)
1246
1247 readonly property alias initials: initialsLabel.text
1248- readonly property string displayName: ContactsJS.formatToDisplay(contactElement, ContactDetail.Name, [Name.FirstName, Name.LastName], fallbackDisplayName)
1249+ readonly property alias displayName: initialsLabel.contactDisplayName
1250 readonly property alias avatarUrl: img.avatarUrl
1251
1252 // this is necessary because the object does not monitor changes on avatarDetail object this will be very expesive and only happens in few cases,
1253@@ -37,6 +37,7 @@
1254 function reload()
1255 {
1256 img.avatarUrl = Qt.binding(function() { return ContactsJS.getAvatar(contactElement, fallbackAvatarUrl) })
1257+ initialsLabel.contactDisplayName = Qt.binding(function() { return ContactsJS.formatToDisplay(contactElement, ContactDetail.Name, [Name.FirstName, Name.LastName], fallbackDisplayName) })
1258 }
1259
1260 radius: "medium"
1261@@ -46,8 +47,10 @@
1262 id: initialsLabel
1263 objectName: "avatarInitials"
1264
1265+ property string contactDisplayName: ContactsJS.formatToDisplay(contactElement, ContactDetail.Name, [Name.FirstName, Name.LastName], fallbackDisplayName)
1266+
1267 anchors.centerIn: parent
1268- text: Contacts.contactInitialsFromString(displayName)
1269+ text: Contacts.contactInitialsFromString(contactDisplayName)
1270 font.pointSize: 88
1271 color: UbuntuColors.lightAubergine
1272 visible: (img.status != Image.Ready)
1273
1274=== renamed file 'src/imports/ContactView/ContactDetailAddressesView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailAddressesView.qml'
1275--- src/imports/ContactView/ContactDetailAddressesView.qml 2014-07-20 20:23:20 +0000
1276+++ src/imports/Ubuntu/Contacts/ContactDetailAddressesView.qml 2014-08-15 21:50:36 +0000
1277@@ -21,7 +21,7 @@
1278 ContactDetailGroupWithTypeView {
1279 id: root
1280
1281- title: i18n.tr("Address")
1282+ title: i18n.dtr("address-book-app", "Address")
1283 defaultIcon: "image://theme/location"
1284 detailType: QtContacts.ContactDetail.Address
1285 fields: [ QtContacts.Address.Street,
1286
1287=== renamed file 'src/imports/ContactView/ContactDetailAvatarView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailAvatarView.qml'
1288--- src/imports/ContactView/ContactDetailAvatarView.qml 2014-07-28 23:12:24 +0000
1289+++ src/imports/Ubuntu/Contacts/ContactDetailAvatarView.qml 2014-08-15 21:50:36 +0000
1290@@ -16,10 +16,6 @@
1291
1292 import QtQuick 2.2
1293 import QtContacts 5.0
1294-import Ubuntu.Components 1.1
1295-import Ubuntu.Contacts 0.1 as ContactsUI
1296-
1297-import "../Common"
1298
1299 ContactDetailBase {
1300 id: root
1301@@ -30,39 +26,14 @@
1302 Connections {
1303 id: connections
1304
1305- function updateTarget()
1306- {
1307- if (root.contact) {
1308- var avatarDetail = root.contact.detail(ContactDetail.Avatar)
1309- if (avatarDetail) {
1310- return avatarDetail
1311- } else {
1312- return root.contact
1313- }
1314- }
1315- return null
1316- }
1317-
1318- target: updateTarget()
1319+ target: avatar.contactElement
1320 ignoreUnknownSignals: true
1321- onContactChanged: {
1322- var avatarDetail = root.contact.detail(ContactDetail.Avatar)
1323- if (avatarDetail) {
1324- avatar.reload()
1325- connections.target = avatarDetail
1326- }
1327- }
1328- onDetailChanged: {
1329- var avatarDetail = root.contact.detail(ContactDetail.Avatar)
1330- if (avatarDetail === null) {
1331- connections.target = root.contact
1332- }
1333- avatar.reload()
1334- }
1335+ onContactChanged: avatar.reload()
1336 }
1337
1338- ContactsUI.ContactAvatar {
1339+ ContactAvatar {
1340 id: avatar
1341+ objectName: "contactAvatarDetail"
1342
1343 contactElement: root.contact
1344 anchors {
1345
1346=== renamed file 'src/imports/Common/ContactDetailBase.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailBase.qml'
1347--- src/imports/Common/ContactDetailBase.qml 2014-07-20 20:23:20 +0000
1348+++ src/imports/Ubuntu/Contacts/ContactDetailBase.qml 2014-08-15 21:50:36 +0000
1349@@ -16,7 +16,6 @@
1350
1351 import QtQuick 2.2
1352 import QtContacts 5.0 as QtContacts
1353-import Ubuntu.Components 1.1
1354 import Ubuntu.Components.ListItems 1.0 as ListItem
1355
1356 ListItem.Empty {
1357
1358=== renamed file 'src/imports/ContactView/ContactDetailEmailsView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailEmailsView.qml'
1359=== renamed file 'src/imports/Common/ContactDetailGroupBase.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailGroupBase.qml'
1360--- src/imports/Common/ContactDetailGroupBase.qml 2014-07-20 20:23:20 +0000
1361+++ src/imports/Ubuntu/Contacts/ContactDetailGroupBase.qml 2014-08-15 21:50:36 +0000
1362@@ -15,8 +15,6 @@
1363 */
1364
1365 import QtQuick 2.2
1366-import Ubuntu.Components 1.1
1367-import Ubuntu.Components.ListItems 1.0 as ListItem
1368
1369 FocusScope {
1370 id: root
1371
1372=== renamed file 'src/imports/Common/ContactDetailGroupWithTypeBase.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeBase.qml'
1373--- src/imports/Common/ContactDetailGroupWithTypeBase.qml 2014-07-20 20:23:20 +0000
1374+++ src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeBase.qml 2014-08-15 21:50:36 +0000
1375@@ -15,7 +15,6 @@
1376 */
1377
1378 import QtQuick 2.2
1379-import Ubuntu.Components 1.1
1380 import QtContacts 5.0 as QtContacts
1381
1382 ContactDetailGroupBase {
1383
1384=== renamed file 'src/imports/ContactView/ContactDetailGroupWithTypeView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeView.qml'
1385--- src/imports/ContactView/ContactDetailGroupWithTypeView.qml 2014-07-20 20:23:20 +0000
1386+++ src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeView.qml 2014-08-15 21:50:36 +0000
1387@@ -19,8 +19,6 @@
1388 import Ubuntu.Components.ListItems 1.0 as ListItem
1389 import QtContacts 5.0 as QtContacts
1390
1391-import "../Common"
1392-
1393 ContactDetailGroupWithTypeBase {
1394 id: root
1395
1396
1397=== renamed file 'src/imports/ContactView/ContactDetailOnlineAccountsView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailOnlineAccountsView.qml'
1398--- src/imports/ContactView/ContactDetailOnlineAccountsView.qml 2014-07-20 20:23:20 +0000
1399+++ src/imports/Ubuntu/Contacts/ContactDetailOnlineAccountsView.qml 2014-08-15 21:50:36 +0000
1400@@ -17,9 +17,6 @@
1401 import QtQuick 2.2
1402 import QtContacts 5.0 as QtContacts
1403 import Ubuntu.Components 1.1
1404-import Ubuntu.Contacts 0.1
1405-
1406-import "../Common"
1407
1408 ContactDetailGroupWithTypeView {
1409 detailType: QtContacts.ContactDetail.OnlineAccount
1410
1411=== renamed file 'src/imports/ContactView/ContactDetailOrganizationsView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailOrganizationsView.qml'
1412--- src/imports/ContactView/ContactDetailOrganizationsView.qml 2014-07-20 20:23:20 +0000
1413+++ src/imports/Ubuntu/Contacts/ContactDetailOrganizationsView.qml 2014-08-15 21:50:36 +0000
1414@@ -16,15 +16,12 @@
1415
1416 import QtQuick 2.2
1417 import QtContacts 5.0 as QtContacts
1418-import Ubuntu.Components 1.1
1419-import Ubuntu.Contacts 0.1
1420
1421-//import "../Common"
1422
1423 ContactDetailGroupWithTypeView {
1424 id: root
1425
1426- title: i18n.tr("Professional details")
1427+ title: i18n.tr("Professional Details")
1428 defaultIcon: "image://theme/location"
1429 detailType: QtContacts.ContactDetail.Organization
1430 typeModel: null
1431
1432=== renamed file 'src/imports/ContactView/ContactDetailPhoneNumberView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberView.qml'
1433--- src/imports/ContactView/ContactDetailPhoneNumberView.qml 2014-07-20 20:23:20 +0000
1434+++ src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberView.qml 2014-08-15 21:50:36 +0000
1435@@ -15,10 +15,6 @@
1436 */
1437
1438 import QtQuick 2.2
1439-import Ubuntu.Components 1.1
1440-import QtContacts 5.0
1441-import Ubuntu.Components.ListItems 1.0 as ListItem
1442-import "../Common"
1443
1444 ContactDetailBase {
1445 id: root
1446
1447=== renamed file 'src/imports/ContactView/ContactDetailPhoneNumbersView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailPhoneNumbersView.qml'
1448--- src/imports/ContactView/ContactDetailPhoneNumbersView.qml 2014-07-20 20:23:20 +0000
1449+++ src/imports/Ubuntu/Contacts/ContactDetailPhoneNumbersView.qml 2014-08-15 21:50:36 +0000
1450@@ -16,10 +16,6 @@
1451
1452 import QtQuick 2.2
1453 import QtContacts 5.0 as QtContacts
1454-import Ubuntu.Components 1.1
1455-import Ubuntu.Contacts 0.1
1456-
1457-import "../Common"
1458
1459 ContactDetailGroupWithTypeView {
1460 id: root
1461
1462=== modified file 'src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml'
1463--- src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2014-07-31 10:46:27 +0000
1464+++ src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2014-08-15 21:50:36 +0000
1465@@ -79,7 +79,7 @@
1466 right: parent.right
1467 }
1468
1469- text: i18n.tr("Add number...")
1470+ text: i18n.dtr("address-book-app", "Add number...")
1471 color: UbuntuColors.lightAubergine
1472 }
1473 visible: phoneNumberEntries.count == 0
1474
1475=== renamed file 'src/imports/ContactView/ContactDetailWithTypeView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailWithTypeView.qml'
1476--- src/imports/ContactView/ContactDetailWithTypeView.qml 2014-07-20 20:23:20 +0000
1477+++ src/imports/Ubuntu/Contacts/ContactDetailWithTypeView.qml 2014-08-15 21:50:36 +0000
1478@@ -15,11 +15,7 @@
1479 */
1480
1481 import QtQuick 2.2
1482-import Ubuntu.Components 1.1
1483 import QtContacts 5.0
1484-import Ubuntu.Components.ListItems 1.0 as ListItem
1485-
1486-import "../Common"
1487
1488 ContactDetailBase {
1489 id: root
1490
1491=== modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml'
1492--- src/imports/Ubuntu/Contacts/ContactListView.qml 2014-07-31 20:16:08 +0000
1493+++ src/imports/Ubuntu/Contacts/ContactListView.qml 2014-08-15 21:50:36 +0000
1494@@ -427,7 +427,7 @@
1495 Label {
1496 anchors.fill: parent
1497 verticalAlignment: Text.AlignVCenter
1498- text: i18n.tr("Frequently called")
1499+ text: i18n.dtr("address-book-app", "Frequently called")
1500 font.pointSize: 76
1501 }
1502 ListItem.ThinDivider {
1503
1504=== added file 'src/imports/Ubuntu/Contacts/ContactPreviewPage.qml'
1505--- src/imports/Ubuntu/Contacts/ContactPreviewPage.qml 1970-01-01 00:00:00 +0000
1506+++ src/imports/Ubuntu/Contacts/ContactPreviewPage.qml 2014-08-15 21:50:36 +0000
1507@@ -0,0 +1,138 @@
1508+/*
1509+ * Copyright (C) 2012-2013 Canonical, Ltd.
1510+ *
1511+ * This program is free software; you can redistribute it and/or modify
1512+ * it under the terms of the GNU General Public License as published by
1513+ * the Free Software Foundation; version 3.
1514+ *
1515+ * This program is distributed in the hope that it will be useful,
1516+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1517+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1518+ * GNU General Public License for more details.
1519+ *
1520+ * You should have received a copy of the GNU General Public License
1521+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1522+ */
1523+
1524+import QtQuick 2.2
1525+import QtContacts 5.0
1526+import Ubuntu.Components 1.1
1527+import Ubuntu.Components.ListItems 1.0 as ListItem
1528+import Ubuntu.Contacts 0.1 as ContactsUI
1529+import Ubuntu.Components.Popups 1.0 as Popups
1530+
1531+Page {
1532+ id: root
1533+
1534+ property QtObject contact: null
1535+ property alias extensions: extensionsContents.children
1536+
1537+ function formatNameToDisplay(contact) {
1538+ if (!contact) {
1539+ return ""
1540+ }
1541+ if (contact.name) {
1542+ var detail = contact.name
1543+ return (detail.firstName + " " + detail.lastName).trim()
1544+ } else if (contact.displayLabel && contact.displayLabel.label && contact.displayLabel.label !== "") {
1545+ return contact.displayLabel.label
1546+ } else {
1547+ return ""
1548+ }
1549+ }
1550+
1551+ title: formatNameToDisplay(contact)
1552+
1553+ Flickable {
1554+ id: flickable
1555+
1556+ flickableDirection: Flickable.VerticalFlick
1557+ anchors.fill: parent
1558+ //WORKAROUND: There is a bug on SDK page that causes the page to appear flicked with small contents
1559+ // see bug #1223050
1560+ contentHeight: Math.max(contents.height, parent.height) + units.gu(2)
1561+ contentWidth: parent.width
1562+
1563+ Column {
1564+ id: contents
1565+
1566+ height: childrenRect.height
1567+ anchors {
1568+ top: parent.top
1569+ topMargin: units.gu(2)
1570+ left: parent.left
1571+ right: parent.right
1572+ }
1573+
1574+ ContactDetailAvatarView {
1575+ contact: root.contact
1576+ anchors.left: parent.left
1577+ height: implicitHeight
1578+ width: implicitWidth
1579+ }
1580+
1581+ ContactDetailPhoneNumbersView {
1582+ objectName: "phones"
1583+
1584+ contact: root.contact
1585+ anchors {
1586+ left: parent.left
1587+ right: parent.right
1588+ }
1589+ height: implicitHeight
1590+ }
1591+
1592+ ContactDetailEmailsView {
1593+ objectName: "emails"
1594+
1595+ contact: root.contact
1596+ anchors {
1597+ left: parent.left
1598+ right: parent.right
1599+ }
1600+ height: implicitHeight
1601+ }
1602+
1603+ ContactDetailOnlineAccountsView {
1604+ contact: root.contact
1605+ anchors {
1606+ left: parent.left
1607+ right: parent.right
1608+ }
1609+ height: implicitHeight
1610+ }
1611+
1612+ ContactDetailAddressesView {
1613+ objectName: "addresses"
1614+
1615+ contact: root.contact
1616+ anchors {
1617+ left: parent.left
1618+ right: parent.right
1619+ }
1620+ height: implicitHeight
1621+ }
1622+
1623+ ContactDetailOrganizationsView {
1624+ objectName: "organizations"
1625+
1626+ contact: root.contact
1627+ anchors {
1628+ left: parent.left
1629+ right: parent.right
1630+ }
1631+ height: implicitHeight
1632+ }
1633+
1634+ Item {
1635+ id: extensionsContents
1636+
1637+ anchors {
1638+ left: parent.left
1639+ right: parent.right
1640+ }
1641+ height: childrenRect.height
1642+ }
1643+ }
1644+ }
1645+}
1646
1647=== removed file 'src/imports/Ubuntu/Contacts/DialogButtons.qml'
1648--- src/imports/Ubuntu/Contacts/DialogButtons.qml 2014-07-20 20:23:20 +0000
1649+++ src/imports/Ubuntu/Contacts/DialogButtons.qml 1970-01-01 00:00:00 +0000
1650@@ -1,62 +0,0 @@
1651-/*
1652- * Copyright (C) 2012-2013 Canonical, Ltd.
1653- *
1654- * This program is free software; you can redistribute it and/or modify
1655- * it under the terms of the GNU General Public License as published by
1656- * the Free Software Foundation; version 3.
1657- *
1658- * This program is distributed in the hope that it will be useful,
1659- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1660- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1661- * GNU General Public License for more details.
1662- *
1663- * You should have received a copy of the GNU General Public License
1664- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1665- */
1666-
1667-import QtQuick 2.2
1668-import Ubuntu.Components 1.1
1669-import Ubuntu.Components.ListItems 1.0 as ListItem
1670-
1671-Rectangle {
1672- id: root
1673-
1674- signal reject()
1675- signal accept()
1676-
1677- property alias acceptAction: accept.action
1678- property alias rejectAction: reject.action
1679-
1680- color: "gray"
1681-
1682- Button {
1683- id: reject
1684- objectName: "DialogButtons.rejectButton"
1685-
1686- action: Action {
1687- text: i18n.dtr("address-book-app", "Cancel")
1688- }
1689- anchors {
1690- left: parent.left
1691- leftMargin: units.gu(1)
1692- verticalCenter: parent.verticalCenter
1693- }
1694- color: UbuntuColors.warmGrey
1695- onClicked: root.reject()
1696- }
1697-
1698- Button {
1699- id: accept
1700- objectName: "DialogButtons.acceptButton"
1701-
1702- action: Action {
1703- text: i18n.dtr("address-book-app", "Done")
1704- }
1705- anchors {
1706- right: parent.right
1707- rightMargin: units.gu(1)
1708- verticalCenter: parent.verticalCenter
1709- }
1710- onClicked: root.accept()
1711- }
1712-}
1713
1714=== modified file 'src/imports/Ubuntu/Contacts/FastScroll.qml'
1715--- src/imports/Ubuntu/Contacts/FastScroll.qml 2014-07-24 12:42:38 +0000
1716+++ src/imports/Ubuntu/Contacts/FastScroll.qml 2014-08-15 21:50:36 +0000
1717@@ -140,7 +140,7 @@
1718 id: rail
1719
1720 property bool isVisible: root.enabled &&
1721- (listView.moving || dragArea.pressed) &&
1722+ (listView.flicking || dragArea.pressed) &&
1723 (listView.currentIndex == -1)
1724 anchors {
1725 right: parent.right
1726@@ -178,9 +178,9 @@
1727 width: pinSize
1728 verticalAlignment: Text.AlignVCenter
1729 horizontalAlignment: Text.AlignHCenter
1730- text: internal.fastScrolling && internal.targetSection == modelData ? "" : modelData
1731+ text: modelData
1732 fontSize: "x-small"
1733- color: internal.currentItem && (internal.currentItem.text === text) ? Theme.palette.selected.foregroundText : Theme.palette.selected.backgroundText
1734+ color: cursor.y === y ? "white" : Theme.palette.selected.backgroundText
1735 opacity: !internal.modelDirty && Sections.contains(text) ? 1.0 : 0.5
1736 }
1737 }
1738
1739=== modified file 'src/imports/Ubuntu/Contacts/ListItemWithActions.qml'
1740--- src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2014-07-30 08:21:52 +0000
1741+++ src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2014-08-15 21:50:36 +0000
1742@@ -41,6 +41,9 @@
1743 readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"
1744 readonly property alias swipping: mainItemMoving.running
1745
1746+ /* internal */
1747+ property var _visibleRightSideActions: filterVisibleActions(rightSideActions)
1748+
1749 signal itemClicked(var mouse)
1750 signal itemPressAndHold(var mouse)
1751
1752@@ -48,12 +51,12 @@
1753 {
1754 var actionFullWidth = actionWidth + units.gu(2)
1755 var xOffset = Math.abs(main.x)
1756- var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length)
1757+ var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
1758
1759 if (index < 1) {
1760 main.x = 0
1761- } else if (index === rightSideActions.length) {
1762- main.x = -rightActionsView.width
1763+ } else if (index === _visibleRightSideActions.length) {
1764+ main.x = -(rightActionsView.width - units.gu(2))
1765 } else {
1766 main.x = -(actionFullWidth * index)
1767 }
1768@@ -100,15 +103,15 @@
1769
1770 function updateActiveAction()
1771 {
1772- if ((main.x <= -root.actionWidth) &&
1773- (main.x > -rightActionsView.width)) {
1774+ if ((main.x <= -(root.actionWidth + units.gu(2))) &&
1775+ (main.x > -(rightActionsView.width - units.gu(2)))) {
1776 var actionFullWidth = actionWidth + units.gu(2)
1777 var xOffset = Math.abs(main.x)
1778- var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length)
1779+ var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
1780 index = index - 1
1781 if (index > -1) {
1782 root.activeItem = rightActionsRepeater.itemAt(index)
1783- root.activeAction = root.rightSideActions[index]
1784+ root.activeAction = root._visibleRightSideActions[index]
1785 }
1786 } else {
1787 root.activeAction = null
1788@@ -120,6 +123,18 @@
1789 main.x = 0
1790 }
1791
1792+ function filterVisibleActions(actions)
1793+ {
1794+ var visibleActions = []
1795+ for(var i = 0; i < actions.length; i++) {
1796+ var action = actions[i]
1797+ if (action.visible) {
1798+ visibleActions.push(action)
1799+ }
1800+ }
1801+ return visibleActions
1802+ }
1803+
1804 states: [
1805 State {
1806 name: "select"
1807@@ -167,31 +182,35 @@
1808 }
1809 }
1810
1811- Item {
1812+ Rectangle {
1813 id: rightActionsView
1814
1815 anchors {
1816 top: main.top
1817 left: main.right
1818- leftMargin: units.gu(1)
1819 bottom: main.bottom
1820 }
1821- visible: rightSideActions.length > 0
1822- width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + actionThreshold : 0
1823+ visible: _visibleRightSideActions.length > 0
1824+ width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(2) : 0
1825+ color: "white"
1826 Row {
1827- anchors.fill: parent
1828+ anchors{
1829+ top: parent.top
1830+ left: parent.left
1831+ leftMargin: units.gu(2)
1832+ right: parent.right
1833+ rightMargin: units.gu(2)
1834+ bottom: parent.bottom
1835+ }
1836 spacing: units.gu(2)
1837 Repeater {
1838 id: rightActionsRepeater
1839
1840- model: rightSideActions
1841+ model: _visibleRightSideActions
1842 Item {
1843 property alias image: img
1844
1845- anchors {
1846- top: parent.top
1847- bottom: parent.bottom
1848- }
1849+ height: rightActionsView.height
1850 width: root.actionWidth
1851
1852 Icon {
1853@@ -200,10 +219,10 @@
1854 anchors.centerIn: parent
1855 width: units.gu(3)
1856 height: units.gu(3)
1857- name: iconName
1858+ name: modelData.iconName
1859 color: root.activeAction === modelData || !root.triggerActionOnMouseRelease ? UbuntuColors.lightAubergine : Theme.palette.selected.background
1860 }
1861- }
1862+ }
1863 }
1864 }
1865 }
1866@@ -317,14 +336,14 @@
1867 MouseArea {
1868 id: mouseArea
1869
1870- property bool locked: root.locked || ((root.leftSideAction === null) && (root.rightSideActions.count === 0))
1871+ property bool locked: root.locked || ((root.leftSideAction === null) && (root._visibleRightSideActions.count === 0))
1872 property bool manual: false
1873
1874 anchors.fill: parent
1875 drag {
1876 target: locked ? null : main
1877 axis: Drag.XAxis
1878- minimumX: rightActionsView.visible ? -(rightActionsView.width + root.actionThreshold) : 0
1879+ minimumX: rightActionsView.visible ? -(rightActionsView.width) : 0
1880 maximumX: leftActionView.visible ? leftActionView.width : 0
1881 }
1882
1883@@ -348,7 +367,7 @@
1884 var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))
1885 if (actionIndex !== -1) {
1886 root.activeItem = rightActionsRepeater.itemAt(actionIndex)
1887- root.activeAction = root.rightSideActions[actionIndex]
1888+ root.activeAction = root._visibleRightSideActions[actionIndex]
1889 triggerAction.start()
1890 return
1891 }
1892
1893=== added file 'src/imports/Ubuntu/Contacts/VCardParser.qml'
1894--- src/imports/Ubuntu/Contacts/VCardParser.qml 1970-01-01 00:00:00 +0000
1895+++ src/imports/Ubuntu/Contacts/VCardParser.qml 2014-08-15 21:50:36 +0000
1896@@ -0,0 +1,57 @@
1897+/*
1898+ * Copyright (C) 2014 Canonical, Ltd.
1899+ *
1900+ * This program is free software; you can redistribute it and/or modify
1901+ * it under the terms of the GNU General Public License as published by
1902+ * the Free Software Foundation; version 3.
1903+ *
1904+ * This program is distributed in the hope that it will be useful,
1905+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1906+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1907+ * GNU General Public License for more details.
1908+ *
1909+ * You should have received a copy of the GNU General Public License
1910+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1911+ */
1912+
1913+import QtQuick 2.2
1914+import QtContacts 5.0
1915+
1916+QtObject {
1917+ id: root
1918+
1919+ property string vCardUrl
1920+ property alias contacts: contactsModel.contacts
1921+ property var _model
1922+
1923+ signal vcardParsed(int error)
1924+
1925+ function clearModel()
1926+ {
1927+ if (contactsModel.contacts.length === 0)
1928+ return;
1929+
1930+ var ids = []
1931+ for(var i=0, iMax=contactsModel.contacts.length; i < iMax; i++) {
1932+ ids.push(contactsModel.contacts[i].contactId)
1933+ }
1934+ contactsModel.removeContacts(ids)
1935+ }
1936+
1937+
1938+
1939+ _model: ContactModel {
1940+ id: contactsModel
1941+
1942+ manager: "memory"
1943+
1944+ onImportCompleted: vcardParsed(error)
1945+ }
1946+
1947+ onVCardUrlChanged: {
1948+ if (vCardUrl.length > 0) {
1949+ clearModel()
1950+ contactsModel.importContacts(vCardUrl)
1951+ }
1952+ }
1953+}
1954
1955=== modified file 'src/imports/Ubuntu/Contacts/qmldir'
1956--- src/imports/Ubuntu/Contacts/qmldir 2014-07-31 10:46:27 +0000
1957+++ src/imports/Ubuntu/Contacts/qmldir 2014-08-15 21:50:36 +0000
1958@@ -7,19 +7,36 @@
1959 ContactDetailPhoneNumberTypeModel 0.1 ContactDetailPhoneNumberTypeModel.qml
1960 ContactFetch 0.1 ContactFetch.qml
1961 ContactListView 0.1 ContactListView.qml
1962+ContactPreviewPage 0.1 ContactPreviewPage.qml
1963 ListItemWithActions 0.1 ListItemWithActions.qml
1964 MultipleSelectionListView 0.1 MultipleSelectionListView.qml
1965 PageWithBottomEdge 0.1 PageWithBottomEdge.qml
1966-
1967-internal ContactSimpleListView ContactSimpleListView.qml
1968+VCardParser 0.1 VCardParser.qml
1969+
1970+# this is necessary for contact app does not use this on external apps
1971+ActionButton 0.1 ActionButton.qml
1972+ContactDetailBase 0.1 ContactDetailBase.qml
1973+ContactDetailGroupBase 0.1 ContactDetailGroupBase.qml
1974+ContactDetailGroupWithTypeBase 0.1 ContactDetailGroupWithTypeBase.qml
1975+ContactDetailGroupWithTypeView 0.1 ContactDetailGroupWithTypeView.qml
1976+
1977+internal BasicFieldView BasicFieldView.qml
1978+internal ContactAvatar ContactAvatar.qml
1979 internal ContactDelegate ContactDelegate.qml
1980+internal ContactDetailAddressesView ContactDetailAddressesView.qml
1981+internal ContactDetailAvatarView ContactDetailAvatarView.qml
1982+internal ContactDetailEmailsView ContactDetailEmailsView.qml
1983+internal ContactDetailOnlineAccountsView ContactDetailOnlineAccountsView.qml
1984+internal ContactDetailOrganizationsView ContactDetailOrganizationsView.qml
1985+internal ContactDetailPhoneNumbersView ContactDetailPhoneNumbersView.qml
1986+internal ContactDetailPhoneNumberView ContactDetailPhoneNumberView.qml
1987 internal ContactDetailPickerPhoneNumberDelegate ContactDetailPickerPhoneNumberDelegate.qml
1988-internal DialogButtons DialogButtons.qml
1989-internal OrganicView OrganicView.qml
1990+internal ContactDetailWithTypeView ContactDetailWithTypeView.qml
1991 internal ContactList ContactList.js
1992+internal ContactSimpleListView ContactSimpleListView.qml
1993 internal ContactJs Contacts.js
1994+internal FastScrollJs FastScroll.js
1995 internal FastScroll FastScroll.qml
1996-internal FastScrollJs FastScroll.js
1997 internal ListItemWithActionsCheckBox ListItemWithActionsCheckBox.qml
1998 internal MostCalledModel MostCalledModel.qml
1999 internal SubtitledWithColors SubtitledWithColors.qml
2000
2001=== modified file 'tests/data/CMakeLists.txt'
2002--- tests/data/CMakeLists.txt 2013-12-12 15:55:57 +0000
2003+++ tests/data/CMakeLists.txt 2014-08-15 21:50:36 +0000
2004@@ -1,3 +1,5 @@
2005+project(test_data)
2006+
2007 set(AUTOPILOT_DATA
2008 vcard.vcf
2009 )
2010
2011=== added file 'tests/data/vcard_single.vcf'
2012--- tests/data/vcard_single.vcf 1970-01-01 00:00:00 +0000
2013+++ tests/data/vcard_single.vcf 2014-08-15 21:50:36 +0000
2014@@ -0,0 +1,16 @@
2015+BEGIN:VCARD
2016+VERSION:3.0
2017+N:Gump;Forrest;;Mr.
2018+FN:Forrest Gump
2019+ORG:Bubba Gump Shrimp Co.
2020+TITLE:Shrimp Man
2021+PHOTO;VALUE=URL;http://assets.ubuntu.com/sites/ubuntu/1166/u/img/pictograms/picto-pack/picto-canonical.svg
2022+TEL;TYPE=WORK,VOICE:(111) 555-12121
2023+TEL;TYPE=HOME,VOICE:(404) 555-1212
2024+ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
2025+LABEL;TYPE=WORK:100 Waters Edge\nBaytown, LA 30314\nUnited States of America
2026+ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
2027+LABEL;TYPE=HOME:42 Plantation St.\nBaytown, LA 30314\nUnited States of America
2028+EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com
2029+REV:2008-04-24T19:52:43Z
2030+END:VCARD
2031
2032=== modified file 'tests/qml/CMakeLists.txt'
2033--- tests/qml/CMakeLists.txt 2014-07-17 15:51:20 +0000
2034+++ tests/qml/CMakeLists.txt 2014-08-15 21:50:36 +0000
2035@@ -24,6 +24,8 @@
2036 declare_qml_test("contact_editor" tst_ContactEditor.qml)
2037 declare_qml_test("contact_avatar" tst_ContactAvatar.qml)
2038 declare_qml_test("list_with_actions" tst_ListWithActions.qml)
2039+ declare_qml_test("contact_preview_page" tst_ContactPreviewPage.qml)
2040+ declare_qml_test("vcard_parser" tst_VCardParser.qml)
2041 else()
2042 if (NOT QMLTESTRUNNER_BIN)
2043 message(WARNING "Qml tests disabled: qmltestrunner not found")
2044@@ -37,5 +39,7 @@
2045 tst_ContactEditor.qml
2046 tst_ContactAvatar.qml
2047 tst_ListWithActions.qml
2048+ tst_ContactPreviewPage.qml
2049+ tst_VCardParser.qml
2050 )
2051 add_custom_target(tst_QmlFiles ALL SOURCES ${QML_TST_FILES})
2052
2053=== added file 'tests/qml/tst_ContactPreviewPage.qml'
2054--- tests/qml/tst_ContactPreviewPage.qml 1970-01-01 00:00:00 +0000
2055+++ tests/qml/tst_ContactPreviewPage.qml 2014-08-15 21:50:36 +0000
2056@@ -0,0 +1,208 @@
2057+/*
2058+ * Copyright (C) 2014 Canonical, Ltd.
2059+ *
2060+ * This program is free software; you can redistribute it and/or modify
2061+ * it under the terms of the GNU General Public License as published by
2062+ * the Free Software Foundation; version 3.
2063+ *
2064+ * This program is distributed in the hope that it will be useful,
2065+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2066+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2067+ * GNU General Public License for more details.
2068+ *
2069+ * You should have received a copy of the GNU General Public License
2070+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2071+ */
2072+
2073+import QtQuick 2.2
2074+import QtTest 1.0
2075+import Ubuntu.Test 0.1
2076+import QtContacts 5.0
2077+import Ubuntu.Components 1.1
2078+import Ubuntu.Contacts 0.1
2079+
2080+import "ContactUtil.js" as ContactUtilJS
2081+
2082+Item {
2083+ id: root
2084+
2085+ function createContactWithName() {
2086+ var details = [
2087+ {detail: 'Name', field: 'firstName', value: 'Fulano'},
2088+ ];
2089+ return ContactUtilJS.createContact(details, root)
2090+ }
2091+
2092+ function createContactWithNameAndAvatar() {
2093+ var details = [
2094+ {detail: 'Name', field: 'firstName', value: 'Fulano'},
2095+ {detail: 'Avatar', field: 'imageUrl', value: 'image://theme/address-book-app'}
2096+ ];
2097+ return ContactUtilJS.createContact(details, root)
2098+ }
2099+
2100+ VCardParser {
2101+ id: vcardParser
2102+
2103+ vCardUrl: Qt.resolvedUrl("../data/vcard_single.vcf")
2104+ }
2105+
2106+
2107+ width: units.gu(40)
2108+ height: units.gu(80)
2109+
2110+ MainView {
2111+ id: mainView
2112+ anchors.fill: parent
2113+ useDeprecatedToolbar: false
2114+
2115+ ContactPreviewPage {
2116+ id: contactPreviewPage
2117+ anchors.fill: parent
2118+ }
2119+ }
2120+
2121+
2122+ UbuntuTestCase {
2123+ id: contactPreviewPageTestCase
2124+ name: 'contactPreviewPageTestCase'
2125+
2126+ when: windowShown
2127+
2128+ function findChildOfType(obj, typeName) {
2129+ var childs = new Array(0)
2130+ var result = new Array(0)
2131+ childs.push(obj)
2132+ while (childs.length > 0) {
2133+ var objTypeName = String(childs[0]).split("_")[0]
2134+ if (objTypeName === typeName) {
2135+ result.push(childs[0])
2136+ }
2137+ for (var i in childs[0].children) {
2138+ childs.push(childs[0].children[i])
2139+ }
2140+ childs.splice(0, 1)
2141+ }
2142+ return result
2143+ }
2144+
2145+
2146+ function init()
2147+ {
2148+ waitForRendering(mainView);
2149+ contactPreviewPage.contact = null
2150+ }
2151+
2152+ function test_preview_contact_with_name()
2153+ {
2154+ contactPreviewPage.contact = createContactWithName()
2155+ tryCompare(contactPreviewPage, "title", "Fulano")
2156+ }
2157+
2158+ function test_preview_contact_with_name_and_avatar()
2159+ {
2160+ contactPreviewPage.contact = createContactWithNameAndAvatar()
2161+ tryCompare(contactPreviewPage, "title", "Fulano")
2162+ var avatarField = findChild(root, "contactAvatarDetail")
2163+ tryCompare(avatarField, "avatarUrl", "image://theme/address-book-app")
2164+ }
2165+
2166+ function test_preview_with_full_contact()
2167+ {
2168+ compare(vcardParser.contacts.length, 1)
2169+ var contact = vcardParser.contacts[0]
2170+ console.debug("Contact: " + contact.phoneNumber.number)
2171+ contactPreviewPage.contact = contact
2172+ tryCompare(contactPreviewPage, "title", "Forrest Gump")
2173+ // PhoneNumbers
2174+ // TEL;TYPE=WORK,VOICE:(111) 555-12121
2175+ // TEL;TYPE=HOME,VOICE:(404) 555-1212
2176+
2177+ // number of phones
2178+ var phoneNumberGroup = findChild(root, "phones")
2179+ var phoneNumbers = findChildOfType(phoneNumberGroup, "BasicFieldView")
2180+ compare(phoneNumbers.length, 2)
2181+
2182+ // first phone
2183+ var phoneNumber = findChild(phoneNumberGroup, "label_phoneNumber_0.0")
2184+ var phoneNumberType = findChild(phoneNumberGroup, "type_phoneNumber_0")
2185+ compare(phoneNumber.text, "(111) 555-12121")
2186+ compare(phoneNumberType.text, "Work")
2187+
2188+ // second phone
2189+ phoneNumber = findChild(phoneNumberGroup, "label_phoneNumber_1.0")
2190+ phoneNumberType = findChild(phoneNumberGroup, "type_phoneNumber_1")
2191+ compare(phoneNumber.text, "(404) 555-1212")
2192+ compare(phoneNumberType.text, "Home")
2193+
2194+ // E-mails
2195+ // EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com
2196+
2197+ // number of e-mails
2198+ var emailGroup = findChild(root, "emails")
2199+ var emails = findChildOfType(emailGroup, "BasicFieldView")
2200+ compare(emails.length, 1)
2201+
2202+ // e-mail address
2203+ var email = findChild(emailGroup, "label_emailAddress_0.0")
2204+ var emailType = findChild(emailGroup, "type_email_0")
2205+ compare(email.text, "forrestgump@example.com")
2206+ compare(emailType.text, "Home")
2207+
2208+ // Address
2209+ // ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
2210+ // ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
2211+
2212+ // number of addresses
2213+ var addressGroup = findChild(root, "addresses")
2214+ var addresses = findChildOfType(addressGroup, "BasicFieldView")
2215+ compare(addresses.length, 2)
2216+
2217+ // first address
2218+ var address_street = findChild(addressGroup, "label_streetAddress_0.0")
2219+ var address_locality = findChild(addressGroup, "label_localityAddress_0.1")
2220+ var address_region = findChild(addressGroup, "label_regionAddress_0.2")
2221+ var address_postCode = findChild(addressGroup, "label_postcodeAddress_0.3")
2222+ var address_country = findChild(addressGroup, "label_countryAddress_0.4")
2223+ var address_type = findChild(addressGroup, "type_address_0")
2224+ compare(address_street.text, "100 Waters Edge")
2225+ compare(address_locality.text, "Baytown")
2226+ compare(address_region.text, "LA")
2227+ compare(address_postCode.text, "30314")
2228+ compare(address_country.text, "United States of America")
2229+ compare(address_type.text, "Work")
2230+
2231+ // second address
2232+ address_street = findChild(addressGroup, "label_streetAddress_1.0")
2233+ address_locality = findChild(addressGroup, "label_localityAddress_1.1")
2234+ address_region = findChild(addressGroup, "label_regionAddress_1.2")
2235+ address_postCode = findChild(addressGroup, "label_postcodeAddress_1.3")
2236+ address_country = findChild(addressGroup, "label_countryAddress_1.4")
2237+ address_type = findChild(addressGroup, "type_address_1")
2238+ compare(address_street.text, "42 Plantation St.")
2239+ compare(address_locality.text, "Baytown")
2240+ compare(address_region.text, "LA")
2241+ compare(address_postCode.text, "30314")
2242+ compare(address_country.text, "United States of America")
2243+ compare(address_type.text, "Home")
2244+
2245+ // Organization
2246+ // ORG:Bubba Gump Shrimp Co.
2247+ // TITLE:Shrimp Man
2248+
2249+ // number of organizations
2250+ var orgGroup = findChild(root, "organizations")
2251+ var orgs = findChildOfType(orgGroup, "BasicFieldView")
2252+ compare(orgs.length, 1)
2253+
2254+ var org_name = findChild(orgGroup, "label_orgName_0.0")
2255+ var org_role = findChild(orgGroup, "label_orgRole_0.1")
2256+ var org_title = findChild(orgGroup, "label_orgTitle_0.2")
2257+
2258+ compare(org_name.text, "Bubba Gump Shrimp Co.")
2259+ compare(org_role.text, "")
2260+ compare(org_title.text, "Shrimp Man")
2261+ }
2262+ }
2263+}
2264+
2265
2266=== modified file 'tests/qml/tst_ListWithActions.qml'
2267--- tests/qml/tst_ListWithActions.qml 2014-07-20 20:26:54 +0000
2268+++ tests/qml/tst_ListWithActions.qml 2014-08-15 21:50:36 +0000
2269@@ -46,7 +46,7 @@
2270 anchors.fill: parent
2271
2272 Repeater {
2273- model: 5
2274+ model: 3
2275
2276 ListItemWithActions {
2277 id: listWithActions
2278@@ -60,7 +60,7 @@
2279 triggerActionOnMouseRelease: true
2280 Rectangle {
2281 anchors.fill: parent
2282- color: "blue"
2283+ color: "green"
2284 }
2285
2286 leftSideAction: Action {
2287@@ -95,7 +95,7 @@
2288 }
2289
2290 Repeater {
2291- model: 5
2292+ model: 3
2293
2294 ListItemWithActions {
2295 id: listWithNoRightActions
2296@@ -109,6 +109,33 @@
2297 triggerActionOnMouseRelease: true
2298 Rectangle {
2299 anchors.fill: parent
2300+ color: "pink"
2301+ }
2302+
2303+ leftSideAction: Action {
2304+ objectName: "deleteAction2"
2305+
2306+ iconName: "delete"
2307+ onTriggered: itemList.actionTriggered(deleteAction, value)
2308+ }
2309+ }
2310+ }
2311+
2312+ Repeater {
2313+ model: 3
2314+
2315+ ListItemWithActions {
2316+ id: listWithInvisibleActions
2317+ objectName: "listWithInvisibleActions"+ index
2318+
2319+ anchors {
2320+ left: parent.left
2321+ right: parent.right
2322+ }
2323+ height: units.gu(8)
2324+ triggerActionOnMouseRelease: true
2325+ Rectangle {
2326+ anchors.fill: parent
2327 color: "blue"
2328 }
2329
2330@@ -118,6 +145,35 @@
2331 iconName: "delete"
2332 onTriggered: itemList.actionTriggered(deleteAction, value)
2333 }
2334+
2335+ rightSideActions: [
2336+ Action {
2337+ id: messageAction2
2338+
2339+ iconName: "message"
2340+ onTriggered: itemList.actionTriggered(messageAction2)
2341+ },
2342+ Action {
2343+ id: shareAction2
2344+
2345+ iconName: "share"
2346+ visible: false
2347+ onTriggered: itemList.actionTriggered(shareAction2)
2348+ },
2349+ Action {
2350+ id: contactAction2
2351+
2352+ iconName: "stock_contact"
2353+ onTriggered: itemList.actionTriggered(contactAction2)
2354+ },
2355+ Action {
2356+ id: infoAction2
2357+
2358+ iconName: "info"
2359+ visible: false
2360+ onTriggered: itemList.actionTriggered(shareAction2)
2361+ }
2362+ ]
2363 }
2364 }
2365 }
2366@@ -277,5 +333,15 @@
2367 var mainItem = findChild(item, "mainItem")
2368 compare(mainItem.x, 0)
2369 }
2370+
2371+ function test_not_visibleActions()
2372+ {
2373+ var item = swipeToLeft("listWithInvisibleActions2", -1, true)
2374+ compare(item._visibleRightSideActions.length, 2)
2375+
2376+ // check if only 2 actions is visible
2377+ var mainItem = findChild(item, "mainItem")
2378+ tryCompare(mainItem, "x", (item.actionWidth * -2) - units.gu(6))
2379+ }
2380 }
2381 }
2382
2383=== added file 'tests/qml/tst_VCardParser.qml'
2384--- tests/qml/tst_VCardParser.qml 1970-01-01 00:00:00 +0000
2385+++ tests/qml/tst_VCardParser.qml 2014-08-15 21:50:36 +0000
2386@@ -0,0 +1,63 @@
2387+/*
2388+ * Copyright (C) 2014 Canonical, Ltd.
2389+ *
2390+ * This program is free software; you can redistribute it and/or modify
2391+ * it under the terms of the GNU General Public License as published by
2392+ * the Free Software Foundation; version 3.
2393+ *
2394+ * This program is distributed in the hope that it will be useful,
2395+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2396+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2397+ * GNU General Public License for more details.
2398+ *
2399+ * You should have received a copy of the GNU General Public License
2400+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2401+ */
2402+
2403+import QtQuick 2.2
2404+import QtTest 1.0
2405+import Ubuntu.Test 0.1
2406+import QtContacts 5.0
2407+
2408+Item {
2409+ id: root
2410+
2411+ width: units.gu(40)
2412+ height: units.gu(80)
2413+
2414+ property var vcardParserComponent
2415+ property var spy
2416+
2417+ UbuntuTestCase {
2418+ id: vcardParser
2419+ name: 'vcardParserTestCase'
2420+
2421+ function init()
2422+ {
2423+ vcardParserComponent = Qt.createQmlObject('import Ubuntu.Contacts 0.1; VCardParser{ }', root);
2424+ spy = Qt.createQmlObject('import QtTest 1.0; SignalSpy{ }', root);
2425+ spy.target = vcardParserComponent
2426+ spy.signalName = "vcardParsed"
2427+ }
2428+
2429+ function cleanup()
2430+ {
2431+ if (vcardParserComponent) {
2432+ vcardParserComponent.destroy()
2433+ vcardParserComponent = null
2434+ }
2435+ if (spy) {
2436+ spy.destroy()
2437+ spy = null
2438+ }
2439+ }
2440+
2441+ function test_import_file()
2442+ {
2443+ vcardParserComponent.vCardUrl = Qt.resolvedUrl("../data/vcard.vcf")
2444+ tryCompare(spy, "count", 1)
2445+ compare(spy.signalArguments[0][0], ContactModel.ImportNoError)
2446+ compare(vcardParserComponent.contacts.length, 3)
2447+ }
2448+ }
2449+}

Subscribers

People subscribed via source and target branches