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
=== modified file 'po/address-book-app.pot'
--- po/address-book-app.pot 2014-07-16 12:56:19 +0000
+++ po/address-book-app.pot 2014-08-15 21:50:36 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: address-book-app\n"9"Project-Id-Version: address-book-app\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2014-07-16 09:55-0300\n"11"POT-Creation-Date: 2014-08-13 09:13-0300\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -22,25 +22,30 @@
22msgid "%1 vCards imported"22msgid "%1 vCards imported"
23msgstr ""23msgstr ""
2424
25#: src/imports/ContactList/ContactListPage.qml:20225#. TRANSLATORS: this refers to creating a new contact
26msgid "+ New Contact"26#: src/imports/ContactList/ContactListPage.qml:240
27msgid "+ Create New"
27msgstr ""28msgstr ""
2829
29#: src/imports/ContactEdit/ContactEditor.qml:32230#: src/imports/ContactEdit/ContactEditor.qml:322
30msgid "Add Field"31msgid "Add Field"
31msgstr ""32msgstr ""
3233
33#: src/imports/ContactList/ContactListPage.qml:46234#: src/imports/ContactList/ContactListPage.qml:527
34msgid "Add contact"35msgid "Add contact"
35msgstr ""36msgstr ""
3637
38#: src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml:82
39msgid "Add number..."
40msgstr ""
41
37#: src/imports/ContactEdit/AddFieldDialog.qml:5942#: src/imports/ContactEdit/AddFieldDialog.qml:59
38#: src/imports/ContactEdit/ContactDetailAddressesEditor.qml:2343#: src/imports/ContactEdit/ContactDetailAddressesEditor.qml:23
39#: src/imports/ContactView/ContactDetailAddressesView.qml:2444#: src/imports/ContactView/ContactDetailAddressesView.qml:24
40msgid "Address"45msgid "Address"
41msgstr ""46msgstr ""
4247
43#: src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml:7748#: src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml:76
44#: src/imports/ContactView/ContactDetailSyncTargetView.qml:4849#: src/imports/ContactView/ContactDetailSyncTargetView.qml:48
45msgid "Addressbook"50msgid "Addressbook"
46msgstr ""51msgstr ""
@@ -49,7 +54,8 @@
49msgid "Aim"54msgid "Aim"
50msgstr ""55msgstr ""
5156
52#: src/imports/Ubuntu/Contacts/ContactListView.qml:31657#. TRANSLATORS: this refers to all contacts
58#: src/imports/ContactList/ContactListPage.qml:410
53msgid "All"59msgid "All"
54msgstr ""60msgstr ""
5561
@@ -62,13 +68,14 @@
62msgstr ""68msgstr ""
6369
64#: src/imports/ContactEdit/AddFieldDialog.qml:13370#: src/imports/ContactEdit/AddFieldDialog.qml:133
65#: src/imports/ContactEdit/ContactEditor.qml:37271#: src/imports/ContactEdit/ContactEditor.qml:373
66#: src/imports/ContactList/ContactListPage.qml:41872#: src/imports/ContactList/ContactListPage.qml:423
73#: src/imports/MainWindow.qml:133
67#: src/imports/Ubuntu/Contacts/DialogButtons.qml:3774#: src/imports/Ubuntu/Contacts/DialogButtons.qml:37
68msgid "Cancel"75msgid "Cancel"
69msgstr ""76msgstr ""
7077
71#: src/imports/ContactList/ContactListPage.qml:33078#: src/imports/ContactList/ContactListPage.qml:447
72msgid "Cancel selection"79msgid "Cancel selection"
73msgstr ""80msgstr ""
7481
@@ -89,8 +96,8 @@
89msgstr ""96msgstr ""
9097
91#: src/imports/ContactEdit/ContactEditor.qml:33798#: src/imports/ContactEdit/ContactEditor.qml:337
92#: src/imports/ContactList/ContactListPage.qml:23599#: src/imports/ContactList/ContactListPage.qml:267
93#: src/imports/ContactList/ContactListPage.qml:355100#: src/imports/ContactList/ContactListPage.qml:487
94msgid "Delete"101msgid "Delete"
95msgstr ""102msgstr ""
96103
@@ -123,7 +130,7 @@
123msgstr ""130msgstr ""
124131
125#: src/imports/ContactView/ContactFetchError.qml:25132#: src/imports/ContactView/ContactFetchError.qml:25
126#: src/imports/MainWindow.qml:112133#: src/imports/MainWindow.qml:129
127msgid "Error"134msgid "Error"
128msgstr ""135msgstr ""
129136
@@ -131,20 +138,20 @@
131msgid "Favorite"138msgid "Favorite"
132msgstr ""139msgstr ""
133140
134#: src/imports/Ubuntu/Contacts/ContactListView.qml:348141#: src/imports/ContactList/ContactListPage.qml:410
135msgid "Favourites"142msgid "Favorites"
136msgstr ""143msgstr ""
137144
138#: src/imports/ContactEdit/ContactDetailNameEditor.qml:83145#: src/imports/ContactEdit/ContactDetailNameEditor.qml:83
139msgid "First name"146msgid "First name"
140msgstr ""147msgstr ""
141148
142#: src/imports/Ubuntu/Contacts/ContactListView.qml:442149#: src/imports/Ubuntu/Contacts/ContactListView.qml:430
143msgid "Frequently called"150msgid "Frequently called"
144msgstr ""151msgstr ""
145152
146#: src/imports/Common/ContactDetailGroupWithTypeBase.qml:116153#: src/imports/Common/ContactDetailGroupWithTypeBase.qml:116
147#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:99154#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:103
148msgid "Home"155msgid "Home"
149msgstr ""156msgstr ""
150157
@@ -172,11 +179,7 @@
172msgid "Last name"179msgid "Last name"
173msgstr ""180msgstr ""
174181
175#: src/imports/ContactEdit/AvatarImport.qml:71182#: src/imports/ContactList/ContactListPage.qml:338
176msgid "Loading"
177msgstr ""
178
179#: src/imports/ContactList/ContactListPage.qml:320
180msgid "Loading..."183msgid "Loading..."
181msgstr ""184msgstr ""
182185
@@ -188,7 +191,7 @@
188msgid "MSN"191msgid "MSN"
189msgstr ""192msgstr ""
190193
191#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:103194#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:107
192msgid "Mobile"195msgid "Mobile"
193msgstr ""196msgstr ""
194197
@@ -214,7 +217,7 @@
214msgstr ""217msgstr ""
215218
216#: src/imports/Common/ContactDetailGroupWithTypeBase.qml:118219#: src/imports/Common/ContactDetailGroupWithTypeBase.qml:118
217#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:107220#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:111
218msgid "Other"221msgid "Other"
219msgstr ""222msgstr ""
220223
@@ -229,15 +232,12 @@
229msgstr ""232msgstr ""
230233
231#: src/imports/ContactEdit/AddFieldDialog.qml:63234#: src/imports/ContactEdit/AddFieldDialog.qml:63
232msgid "Professional Details"
233msgstr ""
234
235#: src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml:23235#: src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml:23
236#: src/imports/ContactView/ContactDetailOrganizationsView.qml:27236#: src/imports/ContactView/ContactDetailOrganizationsView.qml:27
237msgid "Professional details"237msgid "Professional Details"
238msgstr ""238msgstr ""
239239
240#: src/imports/ContactList/ContactListPage.qml:372240#: src/imports/ContactList/ContactListPage.qml:382
241msgid "Quit"241msgid "Quit"
242msgstr ""242msgstr ""
243243
@@ -249,30 +249,27 @@
249msgid "Role"249msgid "Role"
250msgstr ""250msgstr ""
251251
252#: src/imports/ContactEdit/ContactEditor.qml:385252#: src/imports/ContactEdit/ContactEditor.qml:386
253msgid "Save"253msgid "Save"
254msgstr ""254msgstr ""
255255
256#: src/imports/ContactList/ContactListPage.qml:396256#: src/imports/ContactList/ContactListPage.qml:397
257msgid "Search"257msgid "Search"
258msgstr ""258msgstr ""
259259
260#: src/imports/ContactList/ContactListPage.qml:355260#: src/imports/ContactList/ContactListPage.qml:353
261msgid "Select"261msgid "Search..."
262msgstr ""262msgstr ""
263263
264#: src/imports/ContactList/ContactListPage.qml:339264#: src/imports/ContactList/ContactListPage.qml:453
265msgid "Select All"265msgid "Select All"
266msgstr ""266msgstr ""
267267
268#: src/imports/ContactList/ContactListPage.qml:512
269msgid "Select Contacts"
270msgstr ""
271
272#: src/imports/ContactEdit/AddFieldDialog.qml:116268#: src/imports/ContactEdit/AddFieldDialog.qml:116
273msgid "Select a field"269msgid "Select a field"
274msgstr ""270msgstr ""
275271
272#: src/imports/ContactList/ContactListPage.qml:466
276#: src/imports/ContactView/ContactView.qml:206273#: src/imports/ContactView/ContactView.qml:206
277msgid "Share"274msgid "Share"
278msgstr ""275msgstr ""
@@ -290,15 +287,15 @@
290msgid "Street"287msgid "Street"
291msgstr ""288msgstr ""
292289
293#: src/imports/ContactList/ContactListPage.qml:387290#: src/imports/ContactList/ContactListPage.qml:391
294msgid "Sync"291msgid "Sync"
295msgstr ""292msgstr ""
296293
297#: src/imports/ContactList/ContactListPage.qml:387294#: src/imports/ContactList/ContactListPage.qml:391
298msgid "Syncing"295msgid "Syncing"
299msgstr ""296msgstr ""
300297
301#: src/imports/ContactList/ContactListPage.qml:320298#: src/imports/ContactList/ContactListPage.qml:338
302msgid "Syncing..."299msgid "Syncing..."
303msgstr ""300msgstr ""
304301
@@ -311,11 +308,11 @@
311msgstr ""308msgstr ""
312309
313#: src/imports/Common/ContactDetailGroupWithTypeBase.qml:117310#: src/imports/Common/ContactDetailGroupWithTypeBase.qml:117
314#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:101311#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:105
315msgid "Work"312msgid "Work"
316msgstr ""313msgstr ""
317314
318#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:105315#: src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberTypeModel.qml:109
319msgid "Work Mobile"316msgid "Work Mobile"
320msgstr ""317msgstr ""
321318
322319
=== modified file 'src/imports/Common/CMakeLists.txt'
--- src/imports/Common/CMakeLists.txt 2014-06-05 16:46:28 +0000
+++ src/imports/Common/CMakeLists.txt 2014-08-15 21:50:36 +0000
@@ -1,8 +1,5 @@
1set(CONTACT_COMMON_QMLS1set(CONTACT_COMMON_QMLS
2 ContactDetailBase.qml
3 ContactDetailItem.qml2 ContactDetailItem.qml
4 ContactDetailGroupBase.qml
5 ContactDetailGroupWithTypeBase.qml
6 KeyboardRectangle.qml3 KeyboardRectangle.qml
7 RemoveContactsDialog.qml4 RemoveContactsDialog.qml
8 StandardAnimation.qml5 StandardAnimation.qml
96
=== modified file 'src/imports/Common/ContactDetailItem.qml'
--- src/imports/Common/ContactDetailItem.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Common/ContactDetailItem.qml 2014-08-15 21:50:36 +0000
@@ -15,8 +15,9 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18
18import Ubuntu.Components 1.119import Ubuntu.Components 1.1
19import Ubuntu.Components.ListItems 1.0 as ListItem20import Ubuntu.Contacts 0.1
2021
21ContactDetailBase {22ContactDetailBase {
22 id: root23 id: root
2324
=== modified file 'src/imports/Common/RemoveContactsDialog.qml'
--- src/imports/Common/RemoveContactsDialog.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Common/RemoveContactsDialog.qml 2014-08-15 21:50:36 +0000
@@ -16,9 +16,9 @@
1616
17import QtQuick 2.217import QtQuick 2.2
18import Ubuntu.Components 1.118import Ubuntu.Components 1.1
19import Ubuntu.Components.Popups 1.0 as Popups19import Ubuntu.Components.Popups 1.0
2020
21Popups.Dialog {21Dialog {
22 objectName: "removeContactsDialog"22 objectName: "removeContactsDialog"
2323
24 property var contacts: []24 property var contacts: []
2525
=== modified file 'src/imports/ContactEdit/AddFieldDialog.qml'
--- src/imports/ContactEdit/AddFieldDialog.qml 2014-07-20 20:23:20 +0000
+++ src/imports/ContactEdit/AddFieldDialog.qml 2014-08-15 21:50:36 +0000
@@ -15,9 +15,10 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0
19
18import Ubuntu.Components 1.120import Ubuntu.Components 1.1
19import QtContacts 5.021import Ubuntu.Components.Popups 1.0
20import Ubuntu.Components.Popups 1.0 as Popups
2122
2223
23Item {24Item {
@@ -109,7 +110,7 @@
109 Component {110 Component {
110 id: addFieldDialog111 id: addFieldDialog
111112
112 Popups.Dialog {113 Dialog {
113 id: dialogue114 id: dialogue
114 objectName: "addFieldDialog"115 objectName: "addFieldDialog"
115116
116117
=== modified file 'src/imports/ContactEdit/AvatarImport.qml'
--- src/imports/ContactEdit/AvatarImport.qml 2014-07-20 20:23:20 +0000
+++ src/imports/ContactEdit/AvatarImport.qml 2014-08-15 21:50:36 +0000
@@ -15,64 +15,106 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18
18import Ubuntu.Components 1.119import Ubuntu.Components 1.1
19import Ubuntu.Components.Popups 1.0 as Popups20import Ubuntu.Components.Popups 1.0
20import Ubuntu.Content 0.1 as ContentHub21import Ubuntu.Content 0.1
2122
22Item {23Item {
23 id: root24 id: root
2425
25 property var activeTransfer: null26 property var importDialog: null
26 property var loadingDialog: null
2727
28 signal avatarReceived(string avatarUrl)28 signal avatarReceived(string avatarUrl)
2929
30 function requestNewAvatar()30 function requestNewAvatar()
31 {31 {
32 if (!root.loadingDialog) {32 if (!root.importDialog) {
33 root.loadingDialog = PopupUtils.open(loadingDialog, null)33 root.importDialog = PopupUtils.open(contentHubDialog, null)
34 root.activeTransfer = defaultSource.request();34 } else {
35 }35 console.warn("Import dialog already running")
36 }
37
38 ContentHub.ContentPeer {
39 id: defaultSource
40
41 contentType: ContentHub.ContentType.Pictures
42 handler: ContentHub.ContentHandler.Source
43 selectionType: ContentHub.ContentTransfer.Single
44 }
45
46 Connections {
47 target: root.activeTransfer
48 onStateChanged: {
49 var done = ((root.activeTransfer.state === ContentHub.ContentTransfer.Charged) ||
50 (root.activeTransfer.state === ContentHub.ContentTransfer.Aborted));
51
52 if (root.activeTransfer.state === ContentHub.ContentTransfer.Charged) {
53 if (root.activeTransfer.items.length > 0) {
54 root.avatarReceived(root.activeTransfer.items[0].url)
55 }
56 }
57
58 if (done) {
59 PopupUtils.close(root.loadingDialog)
60 root.loadingDialog = null
61 }
62 }36 }
63 }37 }
6438
65 Component {39 Component {
66 id: loadingDialog40 id: contentHubDialog
6741
68 Popups.Dialog {42 PopupBase {
69 id: dialogue43 id: dialogue
7044
71 title: i18n.tr("Loading")45 property alias activeTransfer: signalConnections.target
72 ActivityIndicator {46
73 running: true47 parent: QuickUtils.rootItem(this)
74 visible: running48 focus: true
75 }49
50 Rectangle {
51 anchors.fill: parent
52
53 ContentTransferHint {
54 anchors.fill: parent
55 activeTransfer: dialogue.activeTransfer
56 }
57
58 ContentPeerPicker {
59 id: peerPicker
60
61 anchors.fill: parent
62 visible: dialogue.done
63 contentType: ContentType.Pictures
64 handler: ContentHandler.Source
65
66 onPeerSelected: {
67 peer.selectionType = ContentTransfer.Single
68 dialogue.activeTransfer = peer.request()
69 }
70
71 onCancelPressed: {
72 PopupUtils.close(root.importDialog)
73 }
74 }
75 }
76
77 Connections {
78 id: signalConnections
79
80 target: dialogue.activeTransfer
81 onStateChanged: {
82 var done = ((dialogue.activeTransfer.state === ContentTransfer.Charged) ||
83 (dialogue.activeTransfer.state === ContentTransfer.Aborted))
84
85 if (dialogue.activeTransfer.state === ContentTransfer.Charged) {
86 dialogue.hide()
87 if (dialogue.activeTransfer.items.length > 0) {
88 root.avatarReceived(dialogue.activeTransfer.items[0].url)
89 }
90 }
91
92 if (done) {
93 acceptTimer.restart()
94 }
95 }
96 }
97
98 // WORKAROUND: Work around for application becoming insensitive to touch events
99 // if the dialog is dismissed while the application is inactive.
100 // Just listening for changes to Qt.application.active doesn't appear
101 // to be enough to resolve this, so it seems that something else needs
102 // to be happening first. As such there's a potential for a race
103 // condition here, although as yet no problem has been encountered.
104 Timer {
105 id: acceptTimer
106
107 interval: 100
108 repeat: true
109 running: false
110 onTriggered: {
111 if(Qt.application.active) {
112 PopupUtils.close(root.importDialog)
113 }
114 }
115 }
116
117 Component.onDestruction: root.importDialog = null
76 }118 }
77 }119 }
78}120}
79121
=== modified file 'src/imports/ContactEdit/ContactDetailAddressesEditor.qml'
--- src/imports/ContactEdit/ContactDetailAddressesEditor.qml 2014-05-06 13:18:07 +0000
+++ src/imports/ContactEdit/ContactDetailAddressesEditor.qml 2014-08-15 21:50:36 +0000
@@ -15,19 +15,19 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0 as QtContacts18import QtContacts 5.0
1919
20import "../Common"20import Ubuntu.Contacts 0.1
2121
22ContactDetailGroupWithTypeEditor {22ContactDetailGroupWithTypeEditor {
23 title: i18n.tr("Address")23 title: i18n.tr("Address")
24 detailQmlTypeName: "Address"24 detailQmlTypeName: "Address"
25 detailType: QtContacts.ContactDetail.Address25 detailType: ContactDetail.Address
26 fields: [ QtContacts.Address.Street,26 fields: [ Address.Street,
27 QtContacts.Address.Locality,27 Address.Locality,
28 QtContacts.Address.Region,28 Address.Region,
29 QtContacts.Address.Postcode,29 Address.Postcode,
30 QtContacts.Address.Country ]30 Address.Country ]
31 placeholderTexts: [ i18n.tr("Street"),31 placeholderTexts: [ i18n.tr("Street"),
32 i18n.tr("Locality"),32 i18n.tr("Locality"),
33 i18n.tr("Region"),33 i18n.tr("Region"),
3434
=== modified file 'src/imports/ContactEdit/ContactDetailAvatarEditor.qml'
--- src/imports/ContactEdit/ContactDetailAvatarEditor.qml 2014-07-28 23:12:24 +0000
+++ src/imports/ContactEdit/ContactDetailAvatarEditor.qml 2014-08-15 21:50:36 +0000
@@ -15,10 +15,10 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0
19
18import Ubuntu.Components 1.120import Ubuntu.Components 1.1
19import QtContacts 5.021import Ubuntu.Contacts 0.1
20
21import "../Common"
2222
23ContactDetailBase {23ContactDetailBase {
24 id: root24 id: root
@@ -89,6 +89,12 @@
89 }89 }
90 }90 }
9191
92 ActivityIndicator {
93 anchors.centerIn: avatar
94 running: (avatarImport.importDialog != null)
95 visible: running
96 }
97
92 AvatarImport {98 AvatarImport {
93 id: avatarImport99 id: avatarImport
94100
95101
=== modified file 'src/imports/ContactEdit/ContactDetailEmailsEditor.qml'
--- src/imports/ContactEdit/ContactDetailEmailsEditor.qml 2014-05-06 13:18:07 +0000
+++ src/imports/ContactEdit/ContactDetailEmailsEditor.qml 2014-08-15 21:50:36 +0000
@@ -15,14 +15,15 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0 as QtContacts18import QtContacts 5.0
1919
20import "../Common"20import Ubuntu.Contacts 0.1
21
2122
22ContactDetailGroupWithTypeEditor {23ContactDetailGroupWithTypeEditor {
23 title: i18n.tr("Email")24 title: i18n.tr("Email")
24 detailQmlTypeName: "EmailAddress"25 detailQmlTypeName: "EmailAddress"
25 detailType: QtContacts.ContactDetail.Email26 detailType: ContactDetail.Email
26 fields: [ 0 ]27 fields: [ 0 ]
27 placeholderTexts: [ i18n.tr("Enter an email address") ]28 placeholderTexts: [ i18n.tr("Enter an email address") ]
28 inputMethodHints: Qt.ImhEmailCharactersOnly29 inputMethodHints: Qt.ImhEmailCharactersOnly
2930
=== modified file 'src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml'
--- src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2014-07-20 20:23:20 +0000
+++ src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2014-08-15 21:50:36 +0000
@@ -15,18 +15,18 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0
19
18import Ubuntu.Components 1.120import Ubuntu.Components 1.1
19import QtContacts 5.0 as QtContacts21import Ubuntu.Components.ListItems 1.0
20import Ubuntu.Components.ListItems 1.0 as ListItem22import Ubuntu.Contacts 0.1
21
22import "../Common"
2323
24ContactDetailGroupWithTypeBase {24ContactDetailGroupWithTypeBase {
25 id: root25 id: root
2626
27 property string detailQmlTypeName27 property string detailQmlTypeName
28 property int currentItem: -128 property int currentItem: -1
29 property int fieldType: QtContacts.ContactDetail.FieldContext29 property int fieldType: ContactDetail.FieldContext
30 property variant placeholderTexts: []30 property variant placeholderTexts: []
31 property int inputMethodHints: Qt.ImhNone31 property int inputMethodHints: Qt.ImhNone
32 property variant newDetails: []32 property variant newDetails: []
@@ -96,7 +96,7 @@
96 return changed96 return changed
97 }97 }
9898
99 headerDelegate: ListItem.Empty {99 headerDelegate: Empty {
100 id: header100 id: header
101 highlightWhenPressed: false101 highlightWhenPressed: false
102102
103103
=== modified file 'src/imports/ContactEdit/ContactDetailNameEditor.qml'
--- src/imports/ContactEdit/ContactDetailNameEditor.qml 2014-07-20 20:23:20 +0000
+++ src/imports/ContactEdit/ContactDetailNameEditor.qml 2014-08-15 21:50:36 +0000
@@ -15,8 +15,9 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0
19
18import Ubuntu.Components 1.120import Ubuntu.Components 1.1
19import QtContacts 5.0 as QtContacts
2021
21import "../Common"22import "../Common"
2223
@@ -53,11 +54,11 @@
5354
54 spacing: units.gu(1)55 spacing: units.gu(1)
55 detail: root.contact ? root.contact.name : null56 detail: root.contact ? root.contact.name : null
56 fields: [ QtContacts.Name.FirstName, QtContacts.Name.LastName ]57 fields: [ Name.FirstName, Name.LastName ]
5758
58 fieldDelegate: TextInputDetail {59 fieldDelegate: TextInputDetail {
59 id: textInputDetail60 id: textInputDetail
60 objectName: detailToString(QtContacts.ContactDetail.Name, field)61 objectName: detailToString(ContactDetail.Name, field)
6162
62 function checkIsEmpty() {63 function checkIsEmpty() {
63 if (field == -1) {64 if (field == -1) {
@@ -80,7 +81,7 @@
80 x: units.gu(2)81 x: units.gu(2)
81 detail: root.detail82 detail: root.detail
82 height: units.gu(4)83 height: units.gu(4)
83 placeholderText: field == QtContacts.Name.FirstName ? i18n.tr("First name") : i18n.tr("Last name")84 placeholderText: field == Name.FirstName ? i18n.tr("First name") : i18n.tr("Last name")
84 inputMethodHints: Qt.ImhNoPredictiveText85 inputMethodHints: Qt.ImhNoPredictiveText
85 onTextChanged: checkIsEmpty()86 onTextChanged: checkIsEmpty()
86 onFieldChanged: checkIsEmpty()87 onFieldChanged: checkIsEmpty()
8788
=== modified file 'src/imports/ContactEdit/ContactDetailOnlineAccountsEditor.qml'
--- src/imports/ContactEdit/ContactDetailOnlineAccountsEditor.qml 2014-05-06 13:18:07 +0000
+++ src/imports/ContactEdit/ContactDetailOnlineAccountsEditor.qml 2014-08-15 21:50:36 +0000
@@ -15,16 +15,15 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0 as QtContacts18import QtContacts 5.0
19
19import Ubuntu.Contacts 0.120import Ubuntu.Contacts 0.1
2021
21import "../Common"
22
23ContactDetailGroupWithTypeEditor {22ContactDetailGroupWithTypeEditor {
24 title: i18n.tr("IM")23 title: i18n.tr("IM")
25 detailType: QtContacts.ContactDetail.OnlineAccount24 detailType: ContactDetail.OnlineAccount
26 detailQmlTypeName: "OnlineAccount"25 detailQmlTypeName: "OnlineAccount"
27 fields: [ QtContacts.OnlineAccount.AccountUri ]26 fields: [ OnlineAccount.AccountUri ]
28 placeholderTexts: [ i18n.tr("Enter a social alias") ]27 placeholderTexts: [ i18n.tr("Enter a social alias") ]
29 typeModel: ContactDetailOnlineAccountTypeModel { }28 typeModel: ContactDetailOnlineAccountTypeModel { }
30 inputMethodHints: Qt.ImhEmailCharactersOnly29 inputMethodHints: Qt.ImhEmailCharactersOnly
3130
=== modified file 'src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml'
--- src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml 2014-05-06 13:18:07 +0000
+++ src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml 2014-08-15 21:50:36 +0000
@@ -15,18 +15,16 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0 as QtContacts18import QtContacts 5.0
19
20import "../Common"
2119
22ContactDetailGroupWithTypeEditor {20ContactDetailGroupWithTypeEditor {
23 title: i18n.tr("Professional details")21 title: i18n.tr("Professional Details")
24 typeModel: null22 typeModel: null
25 detailQmlTypeName: "Organization"23 detailQmlTypeName: "Organization"
26 detailType: QtContacts.ContactDetail.Organization24 detailType: ContactDetail.Organization
27 fields: [ QtContacts.Organization.Name,25 fields: [ Organization.Name,
28 QtContacts.Organization.Role,26 Organization.Role,
29 QtContacts.Organization.Title ]27 Organization.Title ]
30 placeholderTexts: [ i18n.tr("Organization"),28 placeholderTexts: [ i18n.tr("Organization"),
31 i18n.tr("Role"),29 i18n.tr("Role"),
32 i18n.tr("Title")30 i18n.tr("Title")
3331
=== modified file 'src/imports/ContactEdit/ContactDetailPhoneNumbersEditor.qml'
--- src/imports/ContactEdit/ContactDetailPhoneNumbersEditor.qml 2014-05-13 18:53:02 +0000
+++ src/imports/ContactEdit/ContactDetailPhoneNumbersEditor.qml 2014-08-15 21:50:36 +0000
@@ -15,16 +15,15 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0 as QtContacts18import QtContacts 5.0
19
19import Ubuntu.Contacts 0.120import Ubuntu.Contacts 0.1
2021
21import "../Common"
22
23ContactDetailGroupWithTypeEditor {22ContactDetailGroupWithTypeEditor {
24 title: i18n.tr("Phone")23 title: i18n.tr("Phone")
25 detailType: QtContacts.ContactDetail.PhoneNumber24 detailType: ContactDetail.PhoneNumber
26 detailQmlTypeName: "PhoneNumber"25 detailQmlTypeName: "PhoneNumber"
27 fields: [ QtContacts.PhoneNumber.Number ]26 fields: [ PhoneNumber.Number ]
28 placeholderTexts: [ i18n.tr("Enter a number") ]27 placeholderTexts: [ i18n.tr("Enter a number") ]
29 typeModel: ContactDetailPhoneNumberTypeModel { }28 typeModel: ContactDetailPhoneNumberTypeModel { }
30 inputMethodHints: Qt.ImhDialableCharactersOnly29 inputMethodHints: Qt.ImhDialableCharactersOnly
3130
=== modified file 'src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml'
--- src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml 2014-07-20 20:26:54 +0000
+++ src/imports/ContactEdit/ContactDetailSyncTargetEditor.qml 2014-08-15 21:50:36 +0000
@@ -16,10 +16,10 @@
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.018import QtContacts 5.0
19
19import Ubuntu.Components 1.120import Ubuntu.Components 1.1
20import Ubuntu.Components.ListItems 1.0 as ListItem21import Ubuntu.Components.ListItems 1.0
2122import Ubuntu.Contacts 0.1
22import "../Common"
2323
24ContactDetailBase {24ContactDetailBase {
25 id: root25 id: root
@@ -83,7 +83,7 @@
83 height: units.gu(4)83 height: units.gu(4)
84 }84 }
8585
86 ListItem.ThinDivider {86 ThinDivider {
87 id: divider87 id: divider
8888
89 anchors.top: label.bottom89 anchors.top: label.bottom
9090
=== modified file 'src/imports/ContactEdit/ContactDetailWithTypeEditor.qml'
--- src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2014-07-20 20:23:20 +0000
+++ src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2014-08-15 21:50:36 +0000
@@ -15,11 +15,10 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0
19
18import Ubuntu.Components 1.120import Ubuntu.Components 1.1
19import QtContacts 5.021import Ubuntu.Contacts 0.1
20import Ubuntu.Components.ListItems 1.0 as ListItem
21
22import "../Common"
2322
24ContactDetailBase {23ContactDetailBase {
25 id: root24 id: root
2625
=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
--- src/imports/ContactEdit/ContactEditor.qml 2014-07-22 10:39:49 +0000
+++ src/imports/ContactEdit/ContactEditor.qml 2014-08-15 21:50:36 +0000
@@ -16,9 +16,10 @@
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.018import QtContacts 5.0
19
19import Ubuntu.Components 1.120import Ubuntu.Components 1.1
20import Ubuntu.Components.ListItems 1.0 as ListItem21import Ubuntu.Components.ListItems 1.0
21import Ubuntu.Components.Popups 1.0 as Popups22import Ubuntu.Components.Popups 1.0
2223
23import "../Common"24import "../Common"
2425
@@ -288,7 +289,7 @@
288 height: implicitHeight289 height: implicitHeight
289 }290 }
290291
291 ListItem.ThinDivider {}292 ThinDivider {}
292293
293 Item {294 Item {
294 anchors {295 anchors {
@@ -320,7 +321,7 @@
320 objectName: "addNewFieldButton"321 objectName: "addNewFieldButton"
321322
322 text: i18n.tr("Add Field")323 text: i18n.tr("Add Field")
323 gradient: UbuntuColors.greyGradient324 strokeColor: UbuntuColors.warmGrey
324 anchors {325 anchors {
325 top: parent.top326 top: parent.top
326 bottom: parent.bottom327 bottom: parent.bottom
@@ -336,6 +337,7 @@
336337
337 text: i18n.tr("Delete")338 text: i18n.tr("Delete")
338 visible: !contactEditor.isNewContact339 visible: !contactEditor.isNewContact
340 color: "red"
339 anchors {341 anchors {
340 top: parent.top342 top: parent.top
341 bottom: parent.bottom343 bottom: parent.bottom
@@ -343,7 +345,7 @@
343 }345 }
344 width: (parent.width / 2) - units.gu(1)346 width: (parent.width / 2) - units.gu(1)
345 onClicked: {347 onClicked: {
346 var dialog = Popups.PopupUtils.open(removeContactDialog, null)348 var dialog = PopupUtils.open(removeContactDialog, null)
347 dialog.contacts = [contactEditor.contact]349 dialog.contacts = [contactEditor.contact]
348 }350 }
349 }351 }
@@ -427,13 +429,13 @@
427 property var popPages: false429 property var popPages: false
428430
429 onCanceled: {431 onCanceled: {
430 Popups.PopupUtils.close(removeContactsDialogMessage)432 PopupUtils.close(removeContactsDialogMessage)
431 }433 }
432434
433 onAccepted: {435 onAccepted: {
434 popPages = true436 popPages = true
435 removeContacts(contactEditor.model)437 removeContacts(contactEditor.model)
436 Popups.PopupUtils.close(removeContactsDialogMessage)438 PopupUtils.close(removeContactsDialogMessage)
437 }439 }
438440
439 // hide virtual keyboard if necessary441 // hide virtual keyboard if necessary
440442
=== modified file 'src/imports/ContactList/ContactListPage.qml'
--- src/imports/ContactList/ContactListPage.qml 2014-07-31 07:56:49 +0000
+++ src/imports/ContactList/ContactListPage.qml 2014-08-15 21:50:36 +0000
@@ -236,6 +236,7 @@
236 rightMargin: units.gu(2)236 rightMargin: units.gu(2)
237 }237 }
238 color: UbuntuColors.lightAubergine238 color: UbuntuColors.lightAubergine
239 // TRANSLATORS: this refers to creating a new contact
239 text: i18n.tr("+ Create New")240 text: i18n.tr("+ Create New")
240 elide: Text.ElideRight241 elide: Text.ElideRight
241 }242 }
@@ -301,6 +302,7 @@
301302
302 onAddDetailClicked: mainPage.addPhoneToContact(contact.contactId, " ")303 onAddDetailClicked: mainPage.addPhoneToContact(contact.contactId, " ")
303304
305 onIsInSelectionModeChanged: mainPage.state = isInSelectionMode ? "selection" : "default"
304 onSelectionCanceled: {306 onSelectionCanceled: {
305 if (pickMode) {307 if (pickMode) {
306 if (contentHubTransfer) {308 if (contentHubTransfer) {
@@ -308,7 +310,6 @@
308 }310 }
309 pickMode = false311 pickMode = false
310 contentHubTransfer = null312 contentHubTransfer = null
311 console.debug("UPDATE STATE:" + mainPage.state )
312 application.returnVcard("")313 application.returnVcard("")
313 }314 }
314 mainPage.state = "default"315 mainPage.state = "default"
@@ -369,7 +370,6 @@
369 }370 }
370371
371 state: "default"372 state: "default"
372 onStateChanged: console.debug("STATE CHANGEDDDDD" + state)
373 states: [373 states: [
374 PageHeadState {374 PageHeadState {
375 id: defaultState375 id: defaultState
@@ -405,7 +405,8 @@
405 target: mainPage.head405 target: mainPage.head
406 backAction: defaultState.backAction406 backAction: defaultState.backAction
407 actions: defaultState.actions407 actions: defaultState.actions
408 sections.model: ["All", "Favorites"]408 // TRANSLATORS: this refers to all contacts
409 sections.model: [i18n.tr("All"), i18n.tr("Favorites")]
409 }410 }
410 PropertyChanges {411 PropertyChanges {
411 target: searchField412 target: searchField
@@ -440,7 +441,6 @@
440 id: selectionState441 id: selectionState
441442
442 name: "selection"443 name: "selection"
443 when: contactList.isInSelectionMode
444 backAction: Action {444 backAction: Action {
445 text: i18n.tr("Cancel selection")445 text: i18n.tr("Cancel selection")
446 iconName: "close"446 iconName: "close"
@@ -468,16 +468,18 @@
468 var contacts = []468 var contacts = []
469 var items = contactList.selectedItems469 var items = contactList.selectedItems
470470
471 for (var i=0; i < items.count; i++) {471 for (var i=0, iMax=items.count; i < iMax; i++) {
472 contacts.push(items.get(i).model.contact)472 contacts.push(items.get(i).model.contact)
473 }473 }
474
474 if (mainPage.pickMode) {475 if (mainPage.pickMode) {
475 contactExporter.exportContacts(contacts)476 contactExporter.exportContacts(contacts)
476 mainPage.pickMode = false477 mainPage.pickMode = false
477 } else {478 } else {
478 pageStack.push(Qt.resolvedUrl("../ContactShare/ContactSharePage.qml"),479 pageStack.push(Qt.resolvedUrl("../ContactShare/ContactSharePage.qml"),
479 { contactModel: contactList.model, contacts: contacts })480 { contactModel: contactList.listModel, contacts: contacts })
480 }481 }
482 contactList.endSelection()
481 }483 }
482 },484 },
483 Action {485 Action {
@@ -486,7 +488,6 @@
486 iconName: "delete"488 iconName: "delete"
487 visible: contactList.isInSelectionMode && !mainPage.pickMode489 visible: contactList.isInSelectionMode && !mainPage.pickMode
488 onTriggered: {490 onTriggered: {
489
490 var contacts = []491 var contacts = []
491 var items = contactList.selectedItems492 var items = contactList.selectedItems
492493
493494
=== modified file 'src/imports/ContactView/CMakeLists.txt'
--- src/imports/ContactView/CMakeLists.txt 2014-06-12 17:21:38 +0000
+++ src/imports/ContactView/CMakeLists.txt 2014-08-15 21:50:36 +0000
@@ -1,19 +1,6 @@
1set(CONTACT_VIEW_QMLS1set(CONTACT_VIEW_QMLS
2 ActionButton.qml
3 BasicFieldView.qml
4 ContactDetailAddressesView.qml
5 ContactDetailAvatarView.qml
6 ContactDetailEmailsView.qml
7 ContactDetailGroupWithTypeView.qml
8 ContactDetailNameView.qml
9 ContactDetailOnlineAccountsView.qml
10 ContactDetailOrganizationsView.qml
11 ContactDetailPhoneNumbersView.qml
12 ContactDetailPhoneNumberView.qml
13 ContactDetailSyncTargetView.qml2 ContactDetailSyncTargetView.qml
14 ContactDetailWithTypeView.qml
15 ContactFetchError.qml3 ContactFetchError.qml
16 ContactHeaderView.qml
17 ContactView.qml4 ContactView.qml
18)5)
196
207
=== modified file 'src/imports/ContactView/ContactDetailSyncTargetView.qml'
--- src/imports/ContactView/ContactDetailSyncTargetView.qml 2014-07-20 20:23:20 +0000
+++ src/imports/ContactView/ContactDetailSyncTargetView.qml 2014-08-15 21:50:36 +0000
@@ -17,6 +17,7 @@
17import QtQuick 2.217import QtQuick 2.2
18import Ubuntu.Components 1.118import Ubuntu.Components 1.1
19import QtContacts 5.019import QtContacts 5.0
20import Ubuntu.Contacts 0.1
2021
21ContactDetailGroupWithTypeView {22ContactDetailGroupWithTypeView {
22 id: root23 id: root
2324
=== modified file 'src/imports/ContactView/ContactView.qml'
--- src/imports/ContactView/ContactView.qml 2014-07-28 16:59:18 +0000
+++ src/imports/ContactView/ContactView.qml 2014-08-15 21:50:36 +0000
@@ -15,37 +15,19 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0
19import Ubuntu.Components 1.118import Ubuntu.Components 1.1
20import Ubuntu.Components.ListItems 1.0 as ListItem
21import Ubuntu.Contacts 0.1 as ContactsUI
22import Ubuntu.Components.Popups 1.0 as Popups19import Ubuntu.Components.Popups 1.0 as Popups
20import Ubuntu.Contacts 0.1
2321
24Page {22ContactPreviewPage {
25 id: root23 id: root
26 objectName: "contactViewPage"24 objectName: "contactViewPage"
2725
28 property QtObject contact: null
29 property alias model: contactFetch.model26 property alias model: contactFetch.model
30 // used by main page to open the contact view on app startup27 // used by main page to open the contact view on app startup
31 property string contactId: ""28 property string contactId: ""
32 property string addPhoneToContact: ""29 property string addPhoneToContact: ""
3330
34 function formatNameToDisplay(contact) {
35 if (!contact) {
36 return ""
37 }
38 if (contact.name) {
39 var detail = contact.name
40 return detail.firstName +" " + detail.lastName
41 } else if (contact.displayLabel && contact.displayLabel.label && contact.displayLabel.label !== "") {
42 return contact.displayLabel.label
43 } else {
44 return ""
45 }
46 }
47
48 title: formatNameToDisplay(contact)
49 onActiveChanged: {31 onActiveChanged: {
50 if (active) {32 if (active) {
51 //WORKAROUND: to correct scroll back the page33 //WORKAROUND: to correct scroll back the page
@@ -60,98 +42,20 @@
60 }42 }
61 }43 }
6244
63 Flickable {45 extensions: ContactDetailSyncTargetView {
64 id: flickable46 contact: root.contact
6547 anchors {
66 flickableDirection: Flickable.VerticalFlick48 left: parent.left
67 anchors.fill: parent49 right: parent.right
68 //WORKAROUND: There is a bug on SDK page that causes the page to appear flicked with small contents
69 // see bug #1223050
70 contentHeight: Math.max(contents.height, parent.height) + units.gu(2)
71 contentWidth: parent.width
72 visible: !busyIndicator.visible
73
74 Column {
75 id: contents
76
77 height: childrenRect.height
78 anchors {
79 top: parent.top
80 topMargin: units.gu(2)
81 left: parent.left
82 right: parent.right
83 }
84
85 ContactDetailAvatarView {
86 contact: root.contact
87 anchors.left: parent.left
88 height: implicitHeight
89 width: implicitWidth
90 }
91
92 ContactDetailPhoneNumbersView {
93 objectName: "phones"
94
95 contact: root.contact
96 anchors {
97 left: parent.left
98 right: parent.right
99 }
100 height: implicitHeight
101 }
102
103 ContactDetailEmailsView {
104 objectName: "emails"
105
106 contact: root.contact
107 anchors {
108 left: parent.left
109 right: parent.right
110 }
111 height: implicitHeight
112 }
113
114 ContactDetailOnlineAccountsView {
115 contact: root.contact
116 anchors {
117 left: parent.left
118 right: parent.right
119 }
120 height: implicitHeight
121 }
122
123 ContactDetailAddressesView {
124 contact: root.contact
125 anchors {
126 left: parent.left
127 right: parent.right
128 }
129 height: implicitHeight
130 }
131
132 ContactDetailOrganizationsView {
133 contact: root.contact
134 anchors {
135 left: parent.left
136 right: parent.right
137 }
138 height: implicitHeight
139 }
140
141 ContactDetailSyncTargetView {
142 contact: root.contact
143 anchors {
144 left: parent.left
145 right: parent.right
146 }
147 height: implicitHeight
148 }
149 }50 }
51 height: implicitHeight
150 }52 }
15153
152 ActivityIndicator {54 ActivityIndicator {
153 id: busyIndicator55 id: busyIndicator
15456
57 parent: root
58
155 running: (root.contact === null) && contactFetch.running59 running: (root.contact === null) && contactFetch.running
156 visible: running60 visible: running
157 anchors.centerIn: parent61 anchors.centerIn: parent
@@ -161,7 +65,7 @@
161 id: fetchErrorDialog65 id: fetchErrorDialog
162 }66 }
16367
164 ContactsUI.ContactFetch {68 ContactFetch {
165 id: contactFetch69 id: contactFetch
16670
167 onContactRemoved: {71 onContactRemoved: {
16872
=== removed file 'src/imports/ContentHubProxy.qml.moved'
--- src/imports/ContentHubProxy.qml.moved 2014-07-28 23:12:24 +0000
+++ src/imports/ContentHubProxy.qml.moved 1970-01-01 00:00:00 +0000
@@ -1,42 +0,0 @@
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.2
18import Ubuntu.Content 0.1 as ContentHub
19
20QtObject {
21 property QtObject pageStack: null
22 property list<QtObject> objects: [
23 Connections {
24 target: ContentHub.ContentHub
25 onExportRequested: {
26 // enter in pick mode
27 pageStack.push(Qt.createComponent("ContactList/ContactListPage.qml"),
28 {pickMode: true,
29 contentHubTransfer: transfer})
30 }
31 onImportRequested: {
32 if (transfer.state === ContentHub.ContentTransfer.Charged) {
33 var urls = []
34 for(var i=0; i < transfer.items.length; i++) {
35 urls.push(transfer.items[i].url)
36 }
37 pageStack.contactList.importContact(urls)
38 }
39 }
40 }
41 ]
42}
430
=== modified file 'src/imports/MainWindow.qml'
--- src/imports/MainWindow.qml 2014-07-28 23:12:24 +0000
+++ src/imports/MainWindow.qml 2014-08-15 21:50:36 +0000
@@ -130,7 +130,7 @@
130 text: mainWindow.modelErrorMessage130 text: mainWindow.modelErrorMessage
131131
132 Button {132 Button {
133 text: "Cancel"133 text: i18n.tr("Cancel")
134 gradient: UbuntuColors.greyGradient134 gradient: UbuntuColors.greyGradient
135 onClicked: PopupUtils.close(dialogue)135 onClicked: PopupUtils.close(dialogue)
136 }136 }
@@ -165,11 +165,4 @@
165 mainStack.contactListPage.returnToNormalState()165 mainStack.contactListPage.returnToNormalState()
166 }166 }
167 }167 }
168
169 Image {
170 source: Qt.resolvedUrl("grid.jpg")
171 asynchronous: true
172 anchors.fill: parent
173 opacity: 0.3
174 }
175}168}
176169
=== renamed file 'src/imports/ContactView/ActionButton.qml' => 'src/imports/Ubuntu/Contacts/ActionButton.qml'
=== renamed file 'src/imports/ContactView/BasicFieldView.qml' => 'src/imports/Ubuntu/Contacts/BasicFieldView.qml'
--- src/imports/ContactView/BasicFieldView.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/BasicFieldView.qml 2014-08-15 21:50:36 +0000
@@ -17,8 +17,6 @@
17import QtQuick 2.217import QtQuick 2.2
18import Ubuntu.Components 1.118import Ubuntu.Components 1.1
1919
20import "../Common"
21
22 Item {20 Item {
23 id: root21 id: root
2422
2523
=== modified file 'src/imports/Ubuntu/Contacts/CMakeLists.txt'
--- src/imports/Ubuntu/Contacts/CMakeLists.txt 2014-07-31 10:46:27 +0000
+++ src/imports/Ubuntu/Contacts/CMakeLists.txt 2014-08-15 21:50:36 +0000
@@ -1,27 +1,42 @@
1set(CONTACT_COMPONENTS_PLUGIN "ubuntu-contacts-qml")1set(CONTACT_COMPONENTS_PLUGIN "ubuntu-contacts-qml")
22
3set(CONTACT_COMPONENTS_QMLS3set(CONTACT_COMPONENTS_QMLS
4 ContactList.js4 ActionButton.qml
5 BasicFieldView.qml
5 ContactAvatar.qml6 ContactAvatar.qml
6 ContactDelegate.qml7 ContactDelegate.qml
8 ContactDetailAddressesView.qml
9 ContactDetailAvatarView.qml
10 ContactDetailBase.qml
11 ContactDetailEmailsView.qml
12 ContactDetailGroupBase.qml
13 ContactDetailGroupWithTypeBase.qml
14 ContactDetailGroupWithTypeView.qml
15 ContactDetailOnlineAccountsView.qml
7 ContactDetailOnlineAccountTypeModel.qml16 ContactDetailOnlineAccountTypeModel.qml
17 ContactDetailOrganizationsView.qml
18 ContactDetailPhoneNumbersView.qml
8 ContactDetailPhoneNumberTypeModel.qml19 ContactDetailPhoneNumberTypeModel.qml
20 ContactDetailPhoneNumberView.qml
9 ContactDetailPickerPhoneNumberDelegate.qml21 ContactDetailPickerPhoneNumberDelegate.qml
22 ContactDetailWithTypeView.qml
10 ContactFetch.qml23 ContactFetch.qml
24 ContactList.js
11 ContactListView.qml25 ContactListView.qml
26 ContactPreviewPage.qml
27 ContactSimpleListView.qml
12 Contacts.js28 Contacts.js
13 ContactSimpleListView.qml29 FastScroll.js
14 DialogButtons.qml
15 FastScroll.qml30 FastScroll.qml
16 FastScroll.js31 ListItemWithActionsCheckBox.qml
17 ListItemWithActions.qml32 ListItemWithActions.qml
18 ListItemWithActionsCheckBox.qml
19 MostCalledModel.qml33 MostCalledModel.qml
20 MultipleSelectionListView.qml34 MultipleSelectionListView.qml
21 MultipleSelectionVisualModel.qml35 MultipleSelectionVisualModel.qml
22 PageWithBottomEdge.qml36 PageWithBottomEdge.qml
37 qmldir
23 SubtitledWithColors.qml38 SubtitledWithColors.qml
24 qmldir39 VCardParser.qml
25)40)
2641
27set(CONTACT_COMPONENTS_SRC42set(CONTACT_COMPONENTS_SRC
@@ -60,3 +75,4 @@
60if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})75if (NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
61 add_dependencies(${CONTACT_COMPONENTS_PLUGIN} copy_qml)76 add_dependencies(${CONTACT_COMPONENTS_PLUGIN} copy_qml)
62endif()77endif()
78
6379
=== modified file 'src/imports/Ubuntu/Contacts/ContactAvatar.qml'
--- src/imports/Ubuntu/Contacts/ContactAvatar.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactAvatar.qml 2014-08-15 21:50:36 +0000
@@ -29,7 +29,7 @@
29 property bool showAvatarPicture: (avatarUrl != fallbackAvatarUrl) || (initials.length === 0)29 property bool showAvatarPicture: (avatarUrl != fallbackAvatarUrl) || (initials.length === 0)
3030
31 readonly property alias initials: initialsLabel.text31 readonly property alias initials: initialsLabel.text
32 readonly property string displayName: ContactsJS.formatToDisplay(contactElement, ContactDetail.Name, [Name.FirstName, Name.LastName], fallbackDisplayName)32 readonly property alias displayName: initialsLabel.contactDisplayName
33 readonly property alias avatarUrl: img.avatarUrl33 readonly property alias avatarUrl: img.avatarUrl
3434
35 // this is necessary because the object does not monitor changes on avatarDetail object this will be very expesive and only happens in few cases,35 // this is necessary because the object does not monitor changes on avatarDetail object this will be very expesive and only happens in few cases,
@@ -37,6 +37,7 @@
37 function reload()37 function reload()
38 {38 {
39 img.avatarUrl = Qt.binding(function() { return ContactsJS.getAvatar(contactElement, fallbackAvatarUrl) })39 img.avatarUrl = Qt.binding(function() { return ContactsJS.getAvatar(contactElement, fallbackAvatarUrl) })
40 initialsLabel.contactDisplayName = Qt.binding(function() { return ContactsJS.formatToDisplay(contactElement, ContactDetail.Name, [Name.FirstName, Name.LastName], fallbackDisplayName) })
40 }41 }
4142
42 radius: "medium"43 radius: "medium"
@@ -46,8 +47,10 @@
46 id: initialsLabel47 id: initialsLabel
47 objectName: "avatarInitials"48 objectName: "avatarInitials"
4849
50 property string contactDisplayName: ContactsJS.formatToDisplay(contactElement, ContactDetail.Name, [Name.FirstName, Name.LastName], fallbackDisplayName)
51
49 anchors.centerIn: parent52 anchors.centerIn: parent
50 text: Contacts.contactInitialsFromString(displayName)53 text: Contacts.contactInitialsFromString(contactDisplayName)
51 font.pointSize: 8854 font.pointSize: 88
52 color: UbuntuColors.lightAubergine55 color: UbuntuColors.lightAubergine
53 visible: (img.status != Image.Ready)56 visible: (img.status != Image.Ready)
5457
=== renamed file 'src/imports/ContactView/ContactDetailAddressesView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailAddressesView.qml'
--- src/imports/ContactView/ContactDetailAddressesView.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailAddressesView.qml 2014-08-15 21:50:36 +0000
@@ -21,7 +21,7 @@
21ContactDetailGroupWithTypeView {21ContactDetailGroupWithTypeView {
22 id: root22 id: root
2323
24 title: i18n.tr("Address")24 title: i18n.dtr("address-book-app", "Address")
25 defaultIcon: "image://theme/location"25 defaultIcon: "image://theme/location"
26 detailType: QtContacts.ContactDetail.Address26 detailType: QtContacts.ContactDetail.Address
27 fields: [ QtContacts.Address.Street,27 fields: [ QtContacts.Address.Street,
2828
=== renamed file 'src/imports/ContactView/ContactDetailAvatarView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailAvatarView.qml'
--- src/imports/ContactView/ContactDetailAvatarView.qml 2014-07-28 23:12:24 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailAvatarView.qml 2014-08-15 21:50:36 +0000
@@ -16,10 +16,6 @@
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.018import QtContacts 5.0
19import Ubuntu.Components 1.1
20import Ubuntu.Contacts 0.1 as ContactsUI
21
22import "../Common"
2319
24ContactDetailBase {20ContactDetailBase {
25 id: root21 id: root
@@ -30,39 +26,14 @@
30 Connections {26 Connections {
31 id: connections27 id: connections
3228
33 function updateTarget()29 target: avatar.contactElement
34 {
35 if (root.contact) {
36 var avatarDetail = root.contact.detail(ContactDetail.Avatar)
37 if (avatarDetail) {
38 return avatarDetail
39 } else {
40 return root.contact
41 }
42 }
43 return null
44 }
45
46 target: updateTarget()
47 ignoreUnknownSignals: true30 ignoreUnknownSignals: true
48 onContactChanged: {31 onContactChanged: avatar.reload()
49 var avatarDetail = root.contact.detail(ContactDetail.Avatar)
50 if (avatarDetail) {
51 avatar.reload()
52 connections.target = avatarDetail
53 }
54 }
55 onDetailChanged: {
56 var avatarDetail = root.contact.detail(ContactDetail.Avatar)
57 if (avatarDetail === null) {
58 connections.target = root.contact
59 }
60 avatar.reload()
61 }
62 }32 }
6333
64 ContactsUI.ContactAvatar {34 ContactAvatar {
65 id: avatar35 id: avatar
36 objectName: "contactAvatarDetail"
6637
67 contactElement: root.contact38 contactElement: root.contact
68 anchors {39 anchors {
6940
=== renamed file 'src/imports/Common/ContactDetailBase.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailBase.qml'
--- src/imports/Common/ContactDetailBase.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailBase.qml 2014-08-15 21:50:36 +0000
@@ -16,7 +16,6 @@
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0 as QtContacts18import QtContacts 5.0 as QtContacts
19import Ubuntu.Components 1.1
20import Ubuntu.Components.ListItems 1.0 as ListItem19import Ubuntu.Components.ListItems 1.0 as ListItem
2120
22ListItem.Empty {21ListItem.Empty {
2322
=== renamed file 'src/imports/ContactView/ContactDetailEmailsView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailEmailsView.qml'
=== renamed file 'src/imports/Common/ContactDetailGroupBase.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailGroupBase.qml'
--- src/imports/Common/ContactDetailGroupBase.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailGroupBase.qml 2014-08-15 21:50:36 +0000
@@ -15,8 +15,6 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import Ubuntu.Components 1.1
19import Ubuntu.Components.ListItems 1.0 as ListItem
2018
21FocusScope {19FocusScope {
22 id: root20 id: root
2321
=== renamed file 'src/imports/Common/ContactDetailGroupWithTypeBase.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeBase.qml'
--- src/imports/Common/ContactDetailGroupWithTypeBase.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeBase.qml 2014-08-15 21:50:36 +0000
@@ -15,7 +15,6 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import Ubuntu.Components 1.1
19import QtContacts 5.0 as QtContacts18import QtContacts 5.0 as QtContacts
2019
21ContactDetailGroupBase {20ContactDetailGroupBase {
2221
=== renamed file 'src/imports/ContactView/ContactDetailGroupWithTypeView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeView.qml'
--- src/imports/ContactView/ContactDetailGroupWithTypeView.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailGroupWithTypeView.qml 2014-08-15 21:50:36 +0000
@@ -19,8 +19,6 @@
19import Ubuntu.Components.ListItems 1.0 as ListItem19import Ubuntu.Components.ListItems 1.0 as ListItem
20import QtContacts 5.0 as QtContacts20import QtContacts 5.0 as QtContacts
2121
22import "../Common"
23
24ContactDetailGroupWithTypeBase {22ContactDetailGroupWithTypeBase {
25 id: root23 id: root
2624
2725
=== renamed file 'src/imports/ContactView/ContactDetailOnlineAccountsView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailOnlineAccountsView.qml'
--- src/imports/ContactView/ContactDetailOnlineAccountsView.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailOnlineAccountsView.qml 2014-08-15 21:50:36 +0000
@@ -17,9 +17,6 @@
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0 as QtContacts18import QtContacts 5.0 as QtContacts
19import Ubuntu.Components 1.119import Ubuntu.Components 1.1
20import Ubuntu.Contacts 0.1
21
22import "../Common"
2320
24ContactDetailGroupWithTypeView {21ContactDetailGroupWithTypeView {
25 detailType: QtContacts.ContactDetail.OnlineAccount22 detailType: QtContacts.ContactDetail.OnlineAccount
2623
=== renamed file 'src/imports/ContactView/ContactDetailOrganizationsView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailOrganizationsView.qml'
--- src/imports/ContactView/ContactDetailOrganizationsView.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailOrganizationsView.qml 2014-08-15 21:50:36 +0000
@@ -16,15 +16,12 @@
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0 as QtContacts18import QtContacts 5.0 as QtContacts
19import Ubuntu.Components 1.1
20import Ubuntu.Contacts 0.1
2119
22//import "../Common"
2320
24ContactDetailGroupWithTypeView {21ContactDetailGroupWithTypeView {
25 id: root22 id: root
2623
27 title: i18n.tr("Professional details")24 title: i18n.tr("Professional Details")
28 defaultIcon: "image://theme/location"25 defaultIcon: "image://theme/location"
29 detailType: QtContacts.ContactDetail.Organization26 detailType: QtContacts.ContactDetail.Organization
30 typeModel: null27 typeModel: null
3128
=== renamed file 'src/imports/ContactView/ContactDetailPhoneNumberView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberView.qml'
--- src/imports/ContactView/ContactDetailPhoneNumberView.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailPhoneNumberView.qml 2014-08-15 21:50:36 +0000
@@ -15,10 +15,6 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import Ubuntu.Components 1.1
19import QtContacts 5.0
20import Ubuntu.Components.ListItems 1.0 as ListItem
21import "../Common"
2218
23ContactDetailBase {19ContactDetailBase {
24 id: root20 id: root
2521
=== renamed file 'src/imports/ContactView/ContactDetailPhoneNumbersView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailPhoneNumbersView.qml'
--- src/imports/ContactView/ContactDetailPhoneNumbersView.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailPhoneNumbersView.qml 2014-08-15 21:50:36 +0000
@@ -16,10 +16,6 @@
1616
17import QtQuick 2.217import QtQuick 2.2
18import QtContacts 5.0 as QtContacts18import QtContacts 5.0 as QtContacts
19import Ubuntu.Components 1.1
20import Ubuntu.Contacts 0.1
21
22import "../Common"
2319
24ContactDetailGroupWithTypeView {20ContactDetailGroupWithTypeView {
25 id: root21 id: root
2622
=== modified file 'src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml'
--- src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2014-07-31 10:46:27 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2014-08-15 21:50:36 +0000
@@ -79,7 +79,7 @@
79 right: parent.right79 right: parent.right
80 }80 }
8181
82 text: i18n.tr("Add number...")82 text: i18n.dtr("address-book-app", "Add number...")
83 color: UbuntuColors.lightAubergine83 color: UbuntuColors.lightAubergine
84 }84 }
85 visible: phoneNumberEntries.count == 085 visible: phoneNumberEntries.count == 0
8686
=== renamed file 'src/imports/ContactView/ContactDetailWithTypeView.qml' => 'src/imports/Ubuntu/Contacts/ContactDetailWithTypeView.qml'
--- src/imports/ContactView/ContactDetailWithTypeView.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailWithTypeView.qml 2014-08-15 21:50:36 +0000
@@ -15,11 +15,7 @@
15 */15 */
1616
17import QtQuick 2.217import QtQuick 2.2
18import Ubuntu.Components 1.1
19import QtContacts 5.018import QtContacts 5.0
20import Ubuntu.Components.ListItems 1.0 as ListItem
21
22import "../Common"
2319
24ContactDetailBase {20ContactDetailBase {
25 id: root21 id: root
2622
=== modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml'
--- src/imports/Ubuntu/Contacts/ContactListView.qml 2014-07-31 20:16:08 +0000
+++ src/imports/Ubuntu/Contacts/ContactListView.qml 2014-08-15 21:50:36 +0000
@@ -427,7 +427,7 @@
427 Label {427 Label {
428 anchors.fill: parent428 anchors.fill: parent
429 verticalAlignment: Text.AlignVCenter429 verticalAlignment: Text.AlignVCenter
430 text: i18n.tr("Frequently called")430 text: i18n.dtr("address-book-app", "Frequently called")
431 font.pointSize: 76431 font.pointSize: 76
432 }432 }
433 ListItem.ThinDivider {433 ListItem.ThinDivider {
434434
=== added file 'src/imports/Ubuntu/Contacts/ContactPreviewPage.qml'
--- src/imports/Ubuntu/Contacts/ContactPreviewPage.qml 1970-01-01 00:00:00 +0000
+++ src/imports/Ubuntu/Contacts/ContactPreviewPage.qml 2014-08-15 21:50:36 +0000
@@ -0,0 +1,138 @@
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.2
18import QtContacts 5.0
19import Ubuntu.Components 1.1
20import Ubuntu.Components.ListItems 1.0 as ListItem
21import Ubuntu.Contacts 0.1 as ContactsUI
22import Ubuntu.Components.Popups 1.0 as Popups
23
24Page {
25 id: root
26
27 property QtObject contact: null
28 property alias extensions: extensionsContents.children
29
30 function formatNameToDisplay(contact) {
31 if (!contact) {
32 return ""
33 }
34 if (contact.name) {
35 var detail = contact.name
36 return (detail.firstName + " " + detail.lastName).trim()
37 } else if (contact.displayLabel && contact.displayLabel.label && contact.displayLabel.label !== "") {
38 return contact.displayLabel.label
39 } else {
40 return ""
41 }
42 }
43
44 title: formatNameToDisplay(contact)
45
46 Flickable {
47 id: flickable
48
49 flickableDirection: Flickable.VerticalFlick
50 anchors.fill: parent
51 //WORKAROUND: There is a bug on SDK page that causes the page to appear flicked with small contents
52 // see bug #1223050
53 contentHeight: Math.max(contents.height, parent.height) + units.gu(2)
54 contentWidth: parent.width
55
56 Column {
57 id: contents
58
59 height: childrenRect.height
60 anchors {
61 top: parent.top
62 topMargin: units.gu(2)
63 left: parent.left
64 right: parent.right
65 }
66
67 ContactDetailAvatarView {
68 contact: root.contact
69 anchors.left: parent.left
70 height: implicitHeight
71 width: implicitWidth
72 }
73
74 ContactDetailPhoneNumbersView {
75 objectName: "phones"
76
77 contact: root.contact
78 anchors {
79 left: parent.left
80 right: parent.right
81 }
82 height: implicitHeight
83 }
84
85 ContactDetailEmailsView {
86 objectName: "emails"
87
88 contact: root.contact
89 anchors {
90 left: parent.left
91 right: parent.right
92 }
93 height: implicitHeight
94 }
95
96 ContactDetailOnlineAccountsView {
97 contact: root.contact
98 anchors {
99 left: parent.left
100 right: parent.right
101 }
102 height: implicitHeight
103 }
104
105 ContactDetailAddressesView {
106 objectName: "addresses"
107
108 contact: root.contact
109 anchors {
110 left: parent.left
111 right: parent.right
112 }
113 height: implicitHeight
114 }
115
116 ContactDetailOrganizationsView {
117 objectName: "organizations"
118
119 contact: root.contact
120 anchors {
121 left: parent.left
122 right: parent.right
123 }
124 height: implicitHeight
125 }
126
127 Item {
128 id: extensionsContents
129
130 anchors {
131 left: parent.left
132 right: parent.right
133 }
134 height: childrenRect.height
135 }
136 }
137 }
138}
0139
=== removed file 'src/imports/Ubuntu/Contacts/DialogButtons.qml'
--- src/imports/Ubuntu/Contacts/DialogButtons.qml 2014-07-20 20:23:20 +0000
+++ src/imports/Ubuntu/Contacts/DialogButtons.qml 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
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.2
18import Ubuntu.Components 1.1
19import Ubuntu.Components.ListItems 1.0 as ListItem
20
21Rectangle {
22 id: root
23
24 signal reject()
25 signal accept()
26
27 property alias acceptAction: accept.action
28 property alias rejectAction: reject.action
29
30 color: "gray"
31
32 Button {
33 id: reject
34 objectName: "DialogButtons.rejectButton"
35
36 action: Action {
37 text: i18n.dtr("address-book-app", "Cancel")
38 }
39 anchors {
40 left: parent.left
41 leftMargin: units.gu(1)
42 verticalCenter: parent.verticalCenter
43 }
44 color: UbuntuColors.warmGrey
45 onClicked: root.reject()
46 }
47
48 Button {
49 id: accept
50 objectName: "DialogButtons.acceptButton"
51
52 action: Action {
53 text: i18n.dtr("address-book-app", "Done")
54 }
55 anchors {
56 right: parent.right
57 rightMargin: units.gu(1)
58 verticalCenter: parent.verticalCenter
59 }
60 onClicked: root.accept()
61 }
62}
630
=== modified file 'src/imports/Ubuntu/Contacts/FastScroll.qml'
--- src/imports/Ubuntu/Contacts/FastScroll.qml 2014-07-24 12:42:38 +0000
+++ src/imports/Ubuntu/Contacts/FastScroll.qml 2014-08-15 21:50:36 +0000
@@ -140,7 +140,7 @@
140 id: rail140 id: rail
141141
142 property bool isVisible: root.enabled &&142 property bool isVisible: root.enabled &&
143 (listView.moving || dragArea.pressed) &&143 (listView.flicking || dragArea.pressed) &&
144 (listView.currentIndex == -1)144 (listView.currentIndex == -1)
145 anchors {145 anchors {
146 right: parent.right146 right: parent.right
@@ -178,9 +178,9 @@
178 width: pinSize178 width: pinSize
179 verticalAlignment: Text.AlignVCenter179 verticalAlignment: Text.AlignVCenter
180 horizontalAlignment: Text.AlignHCenter180 horizontalAlignment: Text.AlignHCenter
181 text: internal.fastScrolling && internal.targetSection == modelData ? "" : modelData181 text: modelData
182 fontSize: "x-small"182 fontSize: "x-small"
183 color: internal.currentItem && (internal.currentItem.text === text) ? Theme.palette.selected.foregroundText : Theme.palette.selected.backgroundText183 color: cursor.y === y ? "white" : Theme.palette.selected.backgroundText
184 opacity: !internal.modelDirty && Sections.contains(text) ? 1.0 : 0.5184 opacity: !internal.modelDirty && Sections.contains(text) ? 1.0 : 0.5
185 }185 }
186 }186 }
187187
=== modified file 'src/imports/Ubuntu/Contacts/ListItemWithActions.qml'
--- src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2014-07-30 08:21:52 +0000
+++ src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2014-08-15 21:50:36 +0000
@@ -41,6 +41,9 @@
41 readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"41 readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"
42 readonly property alias swipping: mainItemMoving.running42 readonly property alias swipping: mainItemMoving.running
4343
44 /* internal */
45 property var _visibleRightSideActions: filterVisibleActions(rightSideActions)
46
44 signal itemClicked(var mouse)47 signal itemClicked(var mouse)
45 signal itemPressAndHold(var mouse)48 signal itemPressAndHold(var mouse)
4649
@@ -48,12 +51,12 @@
48 {51 {
49 var actionFullWidth = actionWidth + units.gu(2)52 var actionFullWidth = actionWidth + units.gu(2)
50 var xOffset = Math.abs(main.x)53 var xOffset = Math.abs(main.x)
51 var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length)54 var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
5255
53 if (index < 1) {56 if (index < 1) {
54 main.x = 057 main.x = 0
55 } else if (index === rightSideActions.length) {58 } else if (index === _visibleRightSideActions.length) {
56 main.x = -rightActionsView.width59 main.x = -(rightActionsView.width - units.gu(2))
57 } else {60 } else {
58 main.x = -(actionFullWidth * index)61 main.x = -(actionFullWidth * index)
59 }62 }
@@ -100,15 +103,15 @@
100103
101 function updateActiveAction()104 function updateActiveAction()
102 {105 {
103 if ((main.x <= -root.actionWidth) &&106 if ((main.x <= -(root.actionWidth + units.gu(2))) &&
104 (main.x > -rightActionsView.width)) {107 (main.x > -(rightActionsView.width - units.gu(2)))) {
105 var actionFullWidth = actionWidth + units.gu(2)108 var actionFullWidth = actionWidth + units.gu(2)
106 var xOffset = Math.abs(main.x)109 var xOffset = Math.abs(main.x)
107 var index = Math.min(Math.floor(xOffset / actionFullWidth), rightSideActions.length)110 var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
108 index = index - 1111 index = index - 1
109 if (index > -1) {112 if (index > -1) {
110 root.activeItem = rightActionsRepeater.itemAt(index)113 root.activeItem = rightActionsRepeater.itemAt(index)
111 root.activeAction = root.rightSideActions[index]114 root.activeAction = root._visibleRightSideActions[index]
112 }115 }
113 } else {116 } else {
114 root.activeAction = null117 root.activeAction = null
@@ -120,6 +123,18 @@
120 main.x = 0123 main.x = 0
121 }124 }
122125
126 function filterVisibleActions(actions)
127 {
128 var visibleActions = []
129 for(var i = 0; i < actions.length; i++) {
130 var action = actions[i]
131 if (action.visible) {
132 visibleActions.push(action)
133 }
134 }
135 return visibleActions
136 }
137
123 states: [138 states: [
124 State {139 State {
125 name: "select"140 name: "select"
@@ -167,31 +182,35 @@
167 }182 }
168 }183 }
169184
170 Item {185 Rectangle {
171 id: rightActionsView186 id: rightActionsView
172187
173 anchors {188 anchors {
174 top: main.top189 top: main.top
175 left: main.right190 left: main.right
176 leftMargin: units.gu(1)
177 bottom: main.bottom191 bottom: main.bottom
178 }192 }
179 visible: rightSideActions.length > 0193 visible: _visibleRightSideActions.length > 0
180 width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + actionThreshold : 0194 width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(2) : 0
195 color: "white"
181 Row {196 Row {
182 anchors.fill: parent197 anchors{
198 top: parent.top
199 left: parent.left
200 leftMargin: units.gu(2)
201 right: parent.right
202 rightMargin: units.gu(2)
203 bottom: parent.bottom
204 }
183 spacing: units.gu(2)205 spacing: units.gu(2)
184 Repeater {206 Repeater {
185 id: rightActionsRepeater207 id: rightActionsRepeater
186208
187 model: rightSideActions209 model: _visibleRightSideActions
188 Item {210 Item {
189 property alias image: img211 property alias image: img
190212
191 anchors {213 height: rightActionsView.height
192 top: parent.top
193 bottom: parent.bottom
194 }
195 width: root.actionWidth214 width: root.actionWidth
196215
197 Icon {216 Icon {
@@ -200,10 +219,10 @@
200 anchors.centerIn: parent219 anchors.centerIn: parent
201 width: units.gu(3)220 width: units.gu(3)
202 height: units.gu(3)221 height: units.gu(3)
203 name: iconName222 name: modelData.iconName
204 color: root.activeAction === modelData || !root.triggerActionOnMouseRelease ? UbuntuColors.lightAubergine : Theme.palette.selected.background223 color: root.activeAction === modelData || !root.triggerActionOnMouseRelease ? UbuntuColors.lightAubergine : Theme.palette.selected.background
205 }224 }
206 }225 }
207 }226 }
208 }227 }
209 }228 }
@@ -317,14 +336,14 @@
317 MouseArea {336 MouseArea {
318 id: mouseArea337 id: mouseArea
319338
320 property bool locked: root.locked || ((root.leftSideAction === null) && (root.rightSideActions.count === 0))339 property bool locked: root.locked || ((root.leftSideAction === null) && (root._visibleRightSideActions.count === 0))
321 property bool manual: false340 property bool manual: false
322341
323 anchors.fill: parent342 anchors.fill: parent
324 drag {343 drag {
325 target: locked ? null : main344 target: locked ? null : main
326 axis: Drag.XAxis345 axis: Drag.XAxis
327 minimumX: rightActionsView.visible ? -(rightActionsView.width + root.actionThreshold) : 0346 minimumX: rightActionsView.visible ? -(rightActionsView.width) : 0
328 maximumX: leftActionView.visible ? leftActionView.width : 0347 maximumX: leftActionView.visible ? leftActionView.width : 0
329 }348 }
330349
@@ -348,7 +367,7 @@
348 var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))367 var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))
349 if (actionIndex !== -1) {368 if (actionIndex !== -1) {
350 root.activeItem = rightActionsRepeater.itemAt(actionIndex)369 root.activeItem = rightActionsRepeater.itemAt(actionIndex)
351 root.activeAction = root.rightSideActions[actionIndex]370 root.activeAction = root._visibleRightSideActions[actionIndex]
352 triggerAction.start()371 triggerAction.start()
353 return372 return
354 }373 }
355374
=== added file 'src/imports/Ubuntu/Contacts/VCardParser.qml'
--- src/imports/Ubuntu/Contacts/VCardParser.qml 1970-01-01 00:00:00 +0000
+++ src/imports/Ubuntu/Contacts/VCardParser.qml 2014-08-15 21:50:36 +0000
@@ -0,0 +1,57 @@
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.2
18import QtContacts 5.0
19
20QtObject {
21 id: root
22
23 property string vCardUrl
24 property alias contacts: contactsModel.contacts
25 property var _model
26
27 signal vcardParsed(int error)
28
29 function clearModel()
30 {
31 if (contactsModel.contacts.length === 0)
32 return;
33
34 var ids = []
35 for(var i=0, iMax=contactsModel.contacts.length; i < iMax; i++) {
36 ids.push(contactsModel.contacts[i].contactId)
37 }
38 contactsModel.removeContacts(ids)
39 }
40
41
42
43 _model: ContactModel {
44 id: contactsModel
45
46 manager: "memory"
47
48 onImportCompleted: vcardParsed(error)
49 }
50
51 onVCardUrlChanged: {
52 if (vCardUrl.length > 0) {
53 clearModel()
54 contactsModel.importContacts(vCardUrl)
55 }
56 }
57}
058
=== modified file 'src/imports/Ubuntu/Contacts/qmldir'
--- src/imports/Ubuntu/Contacts/qmldir 2014-07-31 10:46:27 +0000
+++ src/imports/Ubuntu/Contacts/qmldir 2014-08-15 21:50:36 +0000
@@ -7,19 +7,36 @@
7ContactDetailPhoneNumberTypeModel 0.1 ContactDetailPhoneNumberTypeModel.qml7ContactDetailPhoneNumberTypeModel 0.1 ContactDetailPhoneNumberTypeModel.qml
8ContactFetch 0.1 ContactFetch.qml8ContactFetch 0.1 ContactFetch.qml
9ContactListView 0.1 ContactListView.qml9ContactListView 0.1 ContactListView.qml
10ContactPreviewPage 0.1 ContactPreviewPage.qml
10ListItemWithActions 0.1 ListItemWithActions.qml11ListItemWithActions 0.1 ListItemWithActions.qml
11MultipleSelectionListView 0.1 MultipleSelectionListView.qml12MultipleSelectionListView 0.1 MultipleSelectionListView.qml
12PageWithBottomEdge 0.1 PageWithBottomEdge.qml13PageWithBottomEdge 0.1 PageWithBottomEdge.qml
1314VCardParser 0.1 VCardParser.qml
14internal ContactSimpleListView ContactSimpleListView.qml15
16# this is necessary for contact app does not use this on external apps
17ActionButton 0.1 ActionButton.qml
18ContactDetailBase 0.1 ContactDetailBase.qml
19ContactDetailGroupBase 0.1 ContactDetailGroupBase.qml
20ContactDetailGroupWithTypeBase 0.1 ContactDetailGroupWithTypeBase.qml
21ContactDetailGroupWithTypeView 0.1 ContactDetailGroupWithTypeView.qml
22
23internal BasicFieldView BasicFieldView.qml
24internal ContactAvatar ContactAvatar.qml
15internal ContactDelegate ContactDelegate.qml25internal ContactDelegate ContactDelegate.qml
26internal ContactDetailAddressesView ContactDetailAddressesView.qml
27internal ContactDetailAvatarView ContactDetailAvatarView.qml
28internal ContactDetailEmailsView ContactDetailEmailsView.qml
29internal ContactDetailOnlineAccountsView ContactDetailOnlineAccountsView.qml
30internal ContactDetailOrganizationsView ContactDetailOrganizationsView.qml
31internal ContactDetailPhoneNumbersView ContactDetailPhoneNumbersView.qml
32internal ContactDetailPhoneNumberView ContactDetailPhoneNumberView.qml
16internal ContactDetailPickerPhoneNumberDelegate ContactDetailPickerPhoneNumberDelegate.qml33internal ContactDetailPickerPhoneNumberDelegate ContactDetailPickerPhoneNumberDelegate.qml
17internal DialogButtons DialogButtons.qml34internal ContactDetailWithTypeView ContactDetailWithTypeView.qml
18internal OrganicView OrganicView.qml
19internal ContactList ContactList.js35internal ContactList ContactList.js
36internal ContactSimpleListView ContactSimpleListView.qml
20internal ContactJs Contacts.js37internal ContactJs Contacts.js
38internal FastScrollJs FastScroll.js
21internal FastScroll FastScroll.qml39internal FastScroll FastScroll.qml
22internal FastScrollJs FastScroll.js
23internal ListItemWithActionsCheckBox ListItemWithActionsCheckBox.qml40internal ListItemWithActionsCheckBox ListItemWithActionsCheckBox.qml
24internal MostCalledModel MostCalledModel.qml41internal MostCalledModel MostCalledModel.qml
25internal SubtitledWithColors SubtitledWithColors.qml42internal SubtitledWithColors SubtitledWithColors.qml
2643
=== modified file 'tests/data/CMakeLists.txt'
--- tests/data/CMakeLists.txt 2013-12-12 15:55:57 +0000
+++ tests/data/CMakeLists.txt 2014-08-15 21:50:36 +0000
@@ -1,3 +1,5 @@
1project(test_data)
2
1set(AUTOPILOT_DATA3set(AUTOPILOT_DATA
2 vcard.vcf4 vcard.vcf
3)5)
46
=== added file 'tests/data/vcard_single.vcf'
--- tests/data/vcard_single.vcf 1970-01-01 00:00:00 +0000
+++ tests/data/vcard_single.vcf 2014-08-15 21:50:36 +0000
@@ -0,0 +1,16 @@
1BEGIN:VCARD
2VERSION:3.0
3N:Gump;Forrest;;Mr.
4FN:Forrest Gump
5ORG:Bubba Gump Shrimp Co.
6TITLE:Shrimp Man
7PHOTO;VALUE=URL;http://assets.ubuntu.com/sites/ubuntu/1166/u/img/pictograms/picto-pack/picto-canonical.svg
8TEL;TYPE=WORK,VOICE:(111) 555-12121
9TEL;TYPE=HOME,VOICE:(404) 555-1212
10ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
11LABEL;TYPE=WORK:100 Waters Edge\nBaytown, LA 30314\nUnited States of America
12ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
13LABEL;TYPE=HOME:42 Plantation St.\nBaytown, LA 30314\nUnited States of America
14EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com
15REV:2008-04-24T19:52:43Z
16END:VCARD
017
=== modified file 'tests/qml/CMakeLists.txt'
--- tests/qml/CMakeLists.txt 2014-07-17 15:51:20 +0000
+++ tests/qml/CMakeLists.txt 2014-08-15 21:50:36 +0000
@@ -24,6 +24,8 @@
24 declare_qml_test("contact_editor" tst_ContactEditor.qml)24 declare_qml_test("contact_editor" tst_ContactEditor.qml)
25 declare_qml_test("contact_avatar" tst_ContactAvatar.qml)25 declare_qml_test("contact_avatar" tst_ContactAvatar.qml)
26 declare_qml_test("list_with_actions" tst_ListWithActions.qml)26 declare_qml_test("list_with_actions" tst_ListWithActions.qml)
27 declare_qml_test("contact_preview_page" tst_ContactPreviewPage.qml)
28 declare_qml_test("vcard_parser" tst_VCardParser.qml)
27else()29else()
28 if (NOT QMLTESTRUNNER_BIN)30 if (NOT QMLTESTRUNNER_BIN)
29 message(WARNING "Qml tests disabled: qmltestrunner not found")31 message(WARNING "Qml tests disabled: qmltestrunner not found")
@@ -37,5 +39,7 @@
37 tst_ContactEditor.qml39 tst_ContactEditor.qml
38 tst_ContactAvatar.qml40 tst_ContactAvatar.qml
39 tst_ListWithActions.qml41 tst_ListWithActions.qml
42 tst_ContactPreviewPage.qml
43 tst_VCardParser.qml
40)44)
41add_custom_target(tst_QmlFiles ALL SOURCES ${QML_TST_FILES})45add_custom_target(tst_QmlFiles ALL SOURCES ${QML_TST_FILES})
4246
=== added file 'tests/qml/tst_ContactPreviewPage.qml'
--- tests/qml/tst_ContactPreviewPage.qml 1970-01-01 00:00:00 +0000
+++ tests/qml/tst_ContactPreviewPage.qml 2014-08-15 21:50:36 +0000
@@ -0,0 +1,208 @@
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.2
18import QtTest 1.0
19import Ubuntu.Test 0.1
20import QtContacts 5.0
21import Ubuntu.Components 1.1
22import Ubuntu.Contacts 0.1
23
24import "ContactUtil.js" as ContactUtilJS
25
26Item {
27 id: root
28
29 function createContactWithName() {
30 var details = [
31 {detail: 'Name', field: 'firstName', value: 'Fulano'},
32 ];
33 return ContactUtilJS.createContact(details, root)
34 }
35
36 function createContactWithNameAndAvatar() {
37 var details = [
38 {detail: 'Name', field: 'firstName', value: 'Fulano'},
39 {detail: 'Avatar', field: 'imageUrl', value: 'image://theme/address-book-app'}
40 ];
41 return ContactUtilJS.createContact(details, root)
42 }
43
44 VCardParser {
45 id: vcardParser
46
47 vCardUrl: Qt.resolvedUrl("../data/vcard_single.vcf")
48 }
49
50
51 width: units.gu(40)
52 height: units.gu(80)
53
54 MainView {
55 id: mainView
56 anchors.fill: parent
57 useDeprecatedToolbar: false
58
59 ContactPreviewPage {
60 id: contactPreviewPage
61 anchors.fill: parent
62 }
63 }
64
65
66 UbuntuTestCase {
67 id: contactPreviewPageTestCase
68 name: 'contactPreviewPageTestCase'
69
70 when: windowShown
71
72 function findChildOfType(obj, typeName) {
73 var childs = new Array(0)
74 var result = new Array(0)
75 childs.push(obj)
76 while (childs.length > 0) {
77 var objTypeName = String(childs[0]).split("_")[0]
78 if (objTypeName === typeName) {
79 result.push(childs[0])
80 }
81 for (var i in childs[0].children) {
82 childs.push(childs[0].children[i])
83 }
84 childs.splice(0, 1)
85 }
86 return result
87 }
88
89
90 function init()
91 {
92 waitForRendering(mainView);
93 contactPreviewPage.contact = null
94 }
95
96 function test_preview_contact_with_name()
97 {
98 contactPreviewPage.contact = createContactWithName()
99 tryCompare(contactPreviewPage, "title", "Fulano")
100 }
101
102 function test_preview_contact_with_name_and_avatar()
103 {
104 contactPreviewPage.contact = createContactWithNameAndAvatar()
105 tryCompare(contactPreviewPage, "title", "Fulano")
106 var avatarField = findChild(root, "contactAvatarDetail")
107 tryCompare(avatarField, "avatarUrl", "image://theme/address-book-app")
108 }
109
110 function test_preview_with_full_contact()
111 {
112 compare(vcardParser.contacts.length, 1)
113 var contact = vcardParser.contacts[0]
114 console.debug("Contact: " + contact.phoneNumber.number)
115 contactPreviewPage.contact = contact
116 tryCompare(contactPreviewPage, "title", "Forrest Gump")
117 // PhoneNumbers
118 // TEL;TYPE=WORK,VOICE:(111) 555-12121
119 // TEL;TYPE=HOME,VOICE:(404) 555-1212
120
121 // number of phones
122 var phoneNumberGroup = findChild(root, "phones")
123 var phoneNumbers = findChildOfType(phoneNumberGroup, "BasicFieldView")
124 compare(phoneNumbers.length, 2)
125
126 // first phone
127 var phoneNumber = findChild(phoneNumberGroup, "label_phoneNumber_0.0")
128 var phoneNumberType = findChild(phoneNumberGroup, "type_phoneNumber_0")
129 compare(phoneNumber.text, "(111) 555-12121")
130 compare(phoneNumberType.text, "Work")
131
132 // second phone
133 phoneNumber = findChild(phoneNumberGroup, "label_phoneNumber_1.0")
134 phoneNumberType = findChild(phoneNumberGroup, "type_phoneNumber_1")
135 compare(phoneNumber.text, "(404) 555-1212")
136 compare(phoneNumberType.text, "Home")
137
138 // E-mails
139 // EMAIL;TYPE=PREF,INTERNET:forrestgump@example.com
140
141 // number of e-mails
142 var emailGroup = findChild(root, "emails")
143 var emails = findChildOfType(emailGroup, "BasicFieldView")
144 compare(emails.length, 1)
145
146 // e-mail address
147 var email = findChild(emailGroup, "label_emailAddress_0.0")
148 var emailType = findChild(emailGroup, "type_email_0")
149 compare(email.text, "forrestgump@example.com")
150 compare(emailType.text, "Home")
151
152 // Address
153 // ADR;TYPE=WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
154 // ADR;TYPE=HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
155
156 // number of addresses
157 var addressGroup = findChild(root, "addresses")
158 var addresses = findChildOfType(addressGroup, "BasicFieldView")
159 compare(addresses.length, 2)
160
161 // first address
162 var address_street = findChild(addressGroup, "label_streetAddress_0.0")
163 var address_locality = findChild(addressGroup, "label_localityAddress_0.1")
164 var address_region = findChild(addressGroup, "label_regionAddress_0.2")
165 var address_postCode = findChild(addressGroup, "label_postcodeAddress_0.3")
166 var address_country = findChild(addressGroup, "label_countryAddress_0.4")
167 var address_type = findChild(addressGroup, "type_address_0")
168 compare(address_street.text, "100 Waters Edge")
169 compare(address_locality.text, "Baytown")
170 compare(address_region.text, "LA")
171 compare(address_postCode.text, "30314")
172 compare(address_country.text, "United States of America")
173 compare(address_type.text, "Work")
174
175 // second address
176 address_street = findChild(addressGroup, "label_streetAddress_1.0")
177 address_locality = findChild(addressGroup, "label_localityAddress_1.1")
178 address_region = findChild(addressGroup, "label_regionAddress_1.2")
179 address_postCode = findChild(addressGroup, "label_postcodeAddress_1.3")
180 address_country = findChild(addressGroup, "label_countryAddress_1.4")
181 address_type = findChild(addressGroup, "type_address_1")
182 compare(address_street.text, "42 Plantation St.")
183 compare(address_locality.text, "Baytown")
184 compare(address_region.text, "LA")
185 compare(address_postCode.text, "30314")
186 compare(address_country.text, "United States of America")
187 compare(address_type.text, "Home")
188
189 // Organization
190 // ORG:Bubba Gump Shrimp Co.
191 // TITLE:Shrimp Man
192
193 // number of organizations
194 var orgGroup = findChild(root, "organizations")
195 var orgs = findChildOfType(orgGroup, "BasicFieldView")
196 compare(orgs.length, 1)
197
198 var org_name = findChild(orgGroup, "label_orgName_0.0")
199 var org_role = findChild(orgGroup, "label_orgRole_0.1")
200 var org_title = findChild(orgGroup, "label_orgTitle_0.2")
201
202 compare(org_name.text, "Bubba Gump Shrimp Co.")
203 compare(org_role.text, "")
204 compare(org_title.text, "Shrimp Man")
205 }
206 }
207}
208
0209
=== modified file 'tests/qml/tst_ListWithActions.qml'
--- tests/qml/tst_ListWithActions.qml 2014-07-20 20:26:54 +0000
+++ tests/qml/tst_ListWithActions.qml 2014-08-15 21:50:36 +0000
@@ -46,7 +46,7 @@
46 anchors.fill: parent46 anchors.fill: parent
4747
48 Repeater {48 Repeater {
49 model: 549 model: 3
5050
51 ListItemWithActions {51 ListItemWithActions {
52 id: listWithActions52 id: listWithActions
@@ -60,7 +60,7 @@
60 triggerActionOnMouseRelease: true60 triggerActionOnMouseRelease: true
61 Rectangle {61 Rectangle {
62 anchors.fill: parent62 anchors.fill: parent
63 color: "blue"63 color: "green"
64 }64 }
6565
66 leftSideAction: Action {66 leftSideAction: Action {
@@ -95,7 +95,7 @@
95 }95 }
9696
97 Repeater {97 Repeater {
98 model: 598 model: 3
9999
100 ListItemWithActions {100 ListItemWithActions {
101 id: listWithNoRightActions101 id: listWithNoRightActions
@@ -109,6 +109,33 @@
109 triggerActionOnMouseRelease: true109 triggerActionOnMouseRelease: true
110 Rectangle {110 Rectangle {
111 anchors.fill: parent111 anchors.fill: parent
112 color: "pink"
113 }
114
115 leftSideAction: Action {
116 objectName: "deleteAction2"
117
118 iconName: "delete"
119 onTriggered: itemList.actionTriggered(deleteAction, value)
120 }
121 }
122 }
123
124 Repeater {
125 model: 3
126
127 ListItemWithActions {
128 id: listWithInvisibleActions
129 objectName: "listWithInvisibleActions"+ index
130
131 anchors {
132 left: parent.left
133 right: parent.right
134 }
135 height: units.gu(8)
136 triggerActionOnMouseRelease: true
137 Rectangle {
138 anchors.fill: parent
112 color: "blue"139 color: "blue"
113 }140 }
114141
@@ -118,6 +145,35 @@
118 iconName: "delete"145 iconName: "delete"
119 onTriggered: itemList.actionTriggered(deleteAction, value)146 onTriggered: itemList.actionTriggered(deleteAction, value)
120 }147 }
148
149 rightSideActions: [
150 Action {
151 id: messageAction2
152
153 iconName: "message"
154 onTriggered: itemList.actionTriggered(messageAction2)
155 },
156 Action {
157 id: shareAction2
158
159 iconName: "share"
160 visible: false
161 onTriggered: itemList.actionTriggered(shareAction2)
162 },
163 Action {
164 id: contactAction2
165
166 iconName: "stock_contact"
167 onTriggered: itemList.actionTriggered(contactAction2)
168 },
169 Action {
170 id: infoAction2
171
172 iconName: "info"
173 visible: false
174 onTriggered: itemList.actionTriggered(shareAction2)
175 }
176 ]
121 }177 }
122 }178 }
123 }179 }
@@ -277,5 +333,15 @@
277 var mainItem = findChild(item, "mainItem")333 var mainItem = findChild(item, "mainItem")
278 compare(mainItem.x, 0)334 compare(mainItem.x, 0)
279 }335 }
336
337 function test_not_visibleActions()
338 {
339 var item = swipeToLeft("listWithInvisibleActions2", -1, true)
340 compare(item._visibleRightSideActions.length, 2)
341
342 // check if only 2 actions is visible
343 var mainItem = findChild(item, "mainItem")
344 tryCompare(mainItem, "x", (item.actionWidth * -2) - units.gu(6))
345 }
280 }346 }
281}347}
282348
=== added file 'tests/qml/tst_VCardParser.qml'
--- tests/qml/tst_VCardParser.qml 1970-01-01 00:00:00 +0000
+++ tests/qml/tst_VCardParser.qml 2014-08-15 21:50:36 +0000
@@ -0,0 +1,63 @@
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.2
18import QtTest 1.0
19import Ubuntu.Test 0.1
20import QtContacts 5.0
21
22Item {
23 id: root
24
25 width: units.gu(40)
26 height: units.gu(80)
27
28 property var vcardParserComponent
29 property var spy
30
31 UbuntuTestCase {
32 id: vcardParser
33 name: 'vcardParserTestCase'
34
35 function init()
36 {
37 vcardParserComponent = Qt.createQmlObject('import Ubuntu.Contacts 0.1; VCardParser{ }', root);
38 spy = Qt.createQmlObject('import QtTest 1.0; SignalSpy{ }', root);
39 spy.target = vcardParserComponent
40 spy.signalName = "vcardParsed"
41 }
42
43 function cleanup()
44 {
45 if (vcardParserComponent) {
46 vcardParserComponent.destroy()
47 vcardParserComponent = null
48 }
49 if (spy) {
50 spy.destroy()
51 spy = null
52 }
53 }
54
55 function test_import_file()
56 {
57 vcardParserComponent.vCardUrl = Qt.resolvedUrl("../data/vcard.vcf")
58 tryCompare(spy, "count", 1)
59 compare(spy.signalArguments[0][0], ContactModel.ImportNoError)
60 compare(vcardParserComponent.contacts.length, 3)
61 }
62 }
63}

Subscribers

People subscribed via source and target branches