Merge lp:~fboucault/address-book-app/startup_time into lp:address-book-app

Proposed by Florian Boucault
Status: Merged
Approved by: Florian Boucault
Approved revision: 646
Merged at revision: 645
Proposed branch: lp:~fboucault/address-book-app/startup_time
Merge into: lp:address-book-app
Diff against target: 1233 lines (+458/-313)
32 files modified
debian/control (+1/-1)
debian/control.in (+1/-1)
src/imports/ABContactEditorPageWithEmptyContact.qml (+27/-0)
src/imports/ABContactListPage.qml (+15/-69)
src/imports/ABContactViewPage.qml (+11/-19)
src/imports/ABEmptyState.qml (+1/-0)
src/imports/ABMultiColumnEmptyState.qml (+11/-9)
src/imports/ABNewContactBottomEdge.qml (+22/-17)
src/imports/BusyImportingDialog.qml (+48/-0)
src/imports/CMakeLists.txt (+3/-0)
src/imports/MainWindow.qml (+0/-17)
src/imports/RemoveContactsDialog.qml (+36/-0)
src/imports/Ubuntu/AddressBook/Base/BusyExportingDialog.qml (+31/-0)
src/imports/Ubuntu/AddressBook/Base/CMakeLists.txt (+1/-0)
src/imports/Ubuntu/AddressBook/Base/ContactExporter.qml (+1/-16)
src/imports/Ubuntu/AddressBook/ContactEditor/AlertMessageDialog.qml (+53/-0)
src/imports/Ubuntu/AddressBook/ContactEditor/AvatarImport.qml (+5/-82)
src/imports/Ubuntu/AddressBook/ContactEditor/AvatarImportDialog.qml (+98/-0)
src/imports/Ubuntu/AddressBook/ContactEditor/CMakeLists.txt (+3/-0)
src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml (+7/-77)
src/imports/Ubuntu/AddressBook/ContactEditor/RemoveContactsDialog.qml (+60/-0)
src/imports/Ubuntu/AddressBook/ContactEditor/ValueSelector.qml (+2/-0)
src/imports/Ubuntu/AddressBook/ContactView/ActionButton.qml (+1/-0)
src/imports/Ubuntu/AddressBook/ContactView/ContactDetailAvatarView.qml (+1/-0)
src/imports/Ubuntu/AddressBook/ContactView/ContactDetailWithTypeView.qml (+1/-0)
src/imports/Ubuntu/AddressBook/ContactView/ContactViewPage.qml (+1/-5)
src/imports/Ubuntu/Contacts/ActionButton.qml (+1/-0)
src/imports/Ubuntu/Contacts/ContactAvatar.qml (+1/-0)
src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml (+1/-0)
src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml (+2/-0)
src/imports/Ubuntu/Contacts/ListItemWithActions.qml (+2/-0)
tests/qml/tst_ContactList.qml (+10/-0)
To merge this branch: bzr merge lp:~fboucault/address-book-app/startup_time
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
system-apps-ci-bot continuous-integration Needs Fixing
Review via email: mp+306886@code.launchpad.net

Commit message

Reduced startup time (by 600ms on krillin):
- Bottom edge: delay compiling contact editor page.
- Load Icons asynchronously.
- Made all Components compile asynchronously when possible.

Made startup time overhead when lots of contacts in address book as small as possible

Description of the change

Reduced startup time (by 600ms on krillin):
- Bottom edge: delay compiling contact editor page.
- Load Icons asynchronously.
- Made all Components compile asynchronously when possible.

Made startup time overhead when lots of contacts in address book as small as possible

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:643
https://jenkins.canonical.com/system-apps/job/lp-address-book-app-ci/28/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1642/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1642
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1488
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1488
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1488/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1488/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1488
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1488
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1488
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1488/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1488/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1488
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1488
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1488/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-address-book-app-ci/28/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:644
https://jenkins.canonical.com/system-apps/job/lp-address-book-app-ci/29/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1765/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1765
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1609
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1609/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1609
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1609/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1609
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1609/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1609/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1609/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1609
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1609/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1609
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1609/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1609
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1609/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1609
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1609/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-address-book-app-ci/29/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2016-09-29 07:45:50 +0000
+++ debian/control 2016-11-08 15:35:55 +0000
@@ -15,7 +15,7 @@
15 dh-translations,15 dh-translations,
16 libgl1-mesa-dev | libgl-dev,16 libgl1-mesa-dev | libgl-dev,
17 libgles2-mesa-dev,17 libgles2-mesa-dev,
18 python3,18 python3:any,
19 pkg-config,19 pkg-config,
20 qml-module-qttest [amd64 armhf i386],20 qml-module-qttest [amd64 armhf i386],
21 qtdeclarative5-dev-tools [amd64 armhf i386],21 qtdeclarative5-dev-tools [amd64 armhf i386],
2222
=== modified file 'debian/control.in'
--- debian/control.in 2016-09-29 07:45:50 +0000
+++ debian/control.in 2016-11-08 15:35:55 +0000
@@ -8,7 +8,7 @@
8 dh-translations,8 dh-translations,
9 libgl1-mesa-dev | libgl-dev,9 libgl1-mesa-dev | libgl-dev,
10 libgles2-mesa-dev,10 libgles2-mesa-dev,
11 python3,11 python3:any,
12 pkg-config,12 pkg-config,
13 qml-module-qttest [@ARCHS@],13 qml-module-qttest [@ARCHS@],
14 qtdeclarative5-dev-tools [@ARCHS@],14 qtdeclarative5-dev-tools [@ARCHS@],
1515
=== added file 'src/imports/ABContactEditorPageWithEmptyContact.qml'
--- src/imports/ABContactEditorPageWithEmptyContact.qml 1970-01-01 00:00:00 +0000
+++ src/imports/ABContactEditorPageWithEmptyContact.qml 2016-11-08 15:35:55 +0000
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2016 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.4
18
19import Ubuntu.AddressBook.ContactEditor 0.1
20import Ubuntu.Contacts 0.1 as ContactsUI
21
22ABContactEditorPage {
23 id: contactEditorPage
24 contact: ContactsUI.ContactsJS.createEmptyContact("", contactEditorPage)
25 onCanceled: contactEditorPage.pageStack.removePages(contactEditorPage)
26 onContactSaved: contactEditorPage.pageStack.removePages(contactEditorPage)
27}
028
=== modified file 'src/imports/ABContactListPage.qml'
--- src/imports/ABContactListPage.qml 2016-09-19 18:03:45 +0000
+++ src/imports/ABContactListPage.qml 2016-11-08 15:35:55 +0000
@@ -24,7 +24,6 @@
24import Ubuntu.Content 1.3 as ContentHub24import Ubuntu.Content 1.3 as ContentHub
2525
26import Ubuntu.AddressBook.Base 0.126import Ubuntu.AddressBook.Base 0.1
27import Ubuntu.AddressBook.ContactShare 0.1
2827
2928
30Page {29Page {
@@ -183,7 +182,8 @@
183182
184 function importContact(urls)183 function importContact(urls)
185 {184 {
186 mainPage._busyDialog = PopupUtils.open(busyDialogComponent, mainPage)185 mainPage._busyDialog = PopupUtils.open(Qt.resolvedUrl("./BusyImportingDialog.qml"), mainPage)
186 mainPage._busyDialog.destruction.connect(function() {mainPage._busyDialog = null})
187187
188 var importing = false188 var importing = false
189 for(var i=0, iMax=urls.length; i < iMax; i++) {189 for(var i=0, iMax=urls.length; i < iMax; i++) {
@@ -321,7 +321,6 @@
321 mainPage.state = "default"321 mainPage.state = "default"
322 }322 }
323323
324 onError: pageStack.contactModelError(error)
325 onCountChanged: {324 onCountChanged: {
326 if (mainPage.state === "searching") {325 if (mainPage.state === "searching") {
327 currentIndex = 0326 currentIndex = 0
@@ -587,7 +586,9 @@
587 contacts.push(items.get(i).model.contact)586 contacts.push(items.get(i).model.contact)
588 }587 }
589588
590 var dialog = PopupUtils.open(removeContactDialog, null)589 var dialog = PopupUtils.open(Qt.resolvedUrl("RemoveContactsDialog.qml"),
590 null,
591 {"contactListModel": contactList.listModel})
591 dialog.contacts = contacts592 dialog.contacts = contacts
592 contactList.endSelection()593 contactList.endSelection()
593 }594 }
@@ -716,67 +717,13 @@
716 if (!mainPage.pickMode) {717 if (!mainPage.pickMode) {
717 contactExporter.dismissBusyDialog()718 contactExporter.dismissBusyDialog()
718 pageStack.addPageToNextColumn(mainPage,719 pageStack.addPageToNextColumn(mainPage,
719 contactShareComponent,720 Qt.resolvedUrl("ContactShare/ContactSharePage.qml"),
720 {contactModel: contactExporter.contactModel,721 {contactModel: contactExporter.contactModel,
721 contacts: contacts })722 contacts: contacts })
722 }723 }
723 }724 }
724 }725 }
725726
726 Component {
727 id: removeContactDialog
728
729 RemoveContactsDialog {
730 id: removeContactsDialogMessage
731
732 onCanceled: {
733 PopupUtils.close(removeContactsDialogMessage)
734 }
735
736 onAccepted: {
737 removeContacts(contactList.listModel)
738 PopupUtils.close(removeContactsDialogMessage)
739 }
740 }
741 }
742
743 Component {
744 id: busyDialogComponent
745
746 Popups.Dialog {
747 id: busyDialog
748
749 property alias allowToClose: closeButton.visible
750 property alias showActivity: busyIndicator.visible
751
752 title: i18n.tr("Importing...")
753
754 ActivityIndicator {
755 id: busyIndicator
756 running: visible
757 visible: true
758 }
759 Button {
760 id: closeButton
761 text: i18n.tr("Close")
762 visible: false
763 color: UbuntuColors.red
764 onClicked: {
765 PopupUtils.close(mainPage._busyDialog)
766 mainPage._busyDialog = null
767 }
768 }
769 }
770 }
771
772 Component {
773 id: contactShareComponent
774
775 ContactSharePage {
776 objectName: "contactSharePage"
777 }
778 }
779
780 Component.onCompleted: {727 Component.onCompleted: {
781 application.elapsed()728 application.elapsed()
782 if ((typeof(TEST_DATA) !== "undefined") && (TEST_DATA != "")) {729 if ((typeof(TEST_DATA) !== "undefined") && (TEST_DATA != "")) {
@@ -796,16 +743,15 @@
796 enabled: false743 enabled: false
797 active: true744 active: true
798 asynchronous: true745 asynchronous: true
799 sourceComponent: ABNewContactBottomEdge {746 Component.onCompleted: setSource(Qt.resolvedUrl("ABNewContactBottomEdge.qml"),
800 id: bottomEdge747 {"parent": mainPage,
801 parent: mainPage748 "modelToEdit": Qt.binding(function () {return mainPage.contactModel}),
802 modelToEdit: mainPage.contactModel749 "hint.flickable": Qt.binding(function () {return contactList.view}),
803 hint.flickable: contactList.view750 "pageStack": Qt.binding(function () {return mainPage.pageStack}),
804 pageStack: mainPage.pageStack751 "enabled": Qt.binding(function () {return mainPage.active}),
805 enabled: mainPage.active752 "hintVisible": Qt.binding(function () {return mainPage.pageStack.columns === 1}),
806 hintVisible: (pageStack.columns === 1) && bottomEdgeLoader.enabled753 "visible": Qt.binding(function () {return mainPage.pageStack.columns === 1})
807 visible: hintVisible754 })
808 }
809 }755 }
810756
811 Binding {757 Binding {
812758
=== modified file 'src/imports/ABContactViewPage.qml'
--- src/imports/ABContactViewPage.qml 2016-08-17 18:15:07 +0000
+++ src/imports/ABContactViewPage.qml 2016-11-08 15:35:55 +0000
@@ -21,7 +21,6 @@
2121
22import Ubuntu.AddressBook.Base 0.122import Ubuntu.AddressBook.Base 0.1
23import Ubuntu.AddressBook.ContactView 0.123import Ubuntu.AddressBook.ContactView 0.1
24import Ubuntu.AddressBook.ContactShare 0.1
2524
26ContactViewPage {25ContactViewPage {
27 id: root26 id: root
@@ -76,7 +75,7 @@
76 iconName: "share"75 iconName: "share"
77 onTriggered: {76 onTriggered: {
78 pageStack.addPageToCurrentColumn(root,77 pageStack.addPageToCurrentColumn(root,
79 contactShareComponent,78 Qt.resolvedUrl("ContactShare/ContactSharePage.qml"),
80 {contactModel: root.model,79 {contactModel: root.model,
81 contacts: [root.contact]})80 contacts: [root.contact]})
82 }81 }
@@ -115,27 +114,20 @@
115 Qt.openUrlExternally(("%1:%2").arg(action).arg(detail.value(0)))114 Qt.openUrlExternally(("%1:%2").arg(action).arg(detail.value(0)))
116 }115 }
117116
118 Component {
119 id: contactShareComponent
120 ContactSharePage {}
121 }
122
123 Loader {117 Loader {
124 id: bottomEdgeLoader118 id: bottomEdgeLoader
125119
126 asynchronous: true120 asynchronous: true
127 sourceComponent: ABNewContactBottomEdge {121 Component.onCompleted: setSource(Qt.resolvedUrl("ABNewContactBottomEdge.qml"),
128 id: bottomEdge122 {"parent": root,
129123 "height": Qt.binding(function () {return root.height}),
130 parent: root124 "modelToEdit": Qt.binding(function () {return root.model}),
131 height: root.height125 "hint.flickable": Qt.binding(function () {return root.flickable}),
132 modelToEdit: root.model126 "pageStack": Qt.binding(function () {return root.pageStack}),
133 hint.flickable: root.flickable127 "hintVisible": false,
134 pageStack: root.pageStack128 "enabled": Qt.binding(function () {return !root.editing}),
135 hintVisible: false129 "visible": Qt.binding(function () {return root.pageStack.columns > 1})
136 enabled: !root.editing130 })
137 visible: (pageStack.columns > 1)
138 }
139 }131 }
140132
141 Binding {133 Binding {
142134
=== modified file 'src/imports/ABEmptyState.qml'
--- src/imports/ABEmptyState.qml 2015-12-15 20:00:44 +0000
+++ src/imports/ABEmptyState.qml 2016-11-08 15:35:55 +0000
@@ -44,6 +44,7 @@
44 width: units.gu(5)44 width: units.gu(5)
45 opacity: 0.345 opacity: 0.3
46 name: "contact"46 name: "contact"
47 asynchronous: true
47 }48 }
48 Label {49 Label {
49 id: emptyStateLabel50 id: emptyStateLabel
5051
=== modified file 'src/imports/ABMultiColumnEmptyState.qml'
--- src/imports/ABMultiColumnEmptyState.qml 2016-08-17 18:15:07 +0000
+++ src/imports/ABMultiColumnEmptyState.qml 2016-11-08 15:35:55 +0000
@@ -65,16 +65,18 @@
65 id: bottomEdgeLoader65 id: bottomEdgeLoader
6666
67 asynchronous: true67 asynchronous: true
68 sourceComponent: ABNewContactBottomEdge {68 Component.onCompleted: setSource(Qt.resolvedUrl("ABNewContactBottomEdge.qml"),
69 id: bottomEdge69 {"hintVisible": false,
70 "visible": Qt.binding(function () {return mainPage.pageStack.columns > 1}),
71 "parent": root,
72 "height": Qt.binding(function () {return root.height}),
73 "modelToEdit": Qt.binding(function () {return root.model}),
74 "hint.flickable": Qt.binding(function () {return root.flickable}),
75 "pageStack": Qt.binding(function () {return root.pageStack})
76 })
7077
71 hintVisible: false78 Connections {
72 visible: (pageStack.columns > 1)79 target: bottomEdgeLoader.item
73 parent: root
74 height: root.height
75 modelToEdit: root.model
76 hint.flickable: root.flickable
77 pageStack: root.pageStack
78 onCommitCompleted: { root.openBottomEdgeWhenReady = false }80 onCommitCompleted: { root.openBottomEdgeWhenReady = false }
79 }81 }
8082
8183
=== modified file 'src/imports/ABNewContactBottomEdge.qml'
--- src/imports/ABNewContactBottomEdge.qml 2016-08-18 12:50:33 +0000
+++ src/imports/ABNewContactBottomEdge.qml 2016-11-08 15:35:55 +0000
@@ -49,8 +49,9 @@
49 properties[contact] = bottomEdge._contactToEdit49 properties[contact] = bottomEdge._contactToEdit
5050
5151
52 var incubator = pageStack.addPageToNextColumn(bottomEdge.parent, editorPageBottomEdge, properties)52 var incubator = pageStack.addPageToNextColumn(bottomEdge.parent, bottomEdge.contentUrl, properties)
53 incubator.forceCompletion()53 incubator.forceCompletion()
54 setContactEditorPageProperties(incubator.object)
54 pageStack.bottomEdgeFloatingPage = incubator.object55 pageStack.bottomEdgeFloatingPage = incubator.object
55 incubator.object.Component.onDestruction.connect(function() {56 incubator.object.Component.onDestruction.connect(function() {
56 pageStack.bottomEdgeFloatingPage = null57 pageStack.bottomEdgeFloatingPage = null
@@ -68,28 +69,32 @@
68 }69 }
69 }70 }
7071
71 contentComponent: editorPageBottomEdge72 contentUrl: Qt.resolvedUrl("ABContactEditorPageWithEmptyContact.qml")
72 preloadContent: visible73 onContentItemChanged: setContactEditorPageProperties(bottomEdge.contentItem)
74 preloadContent: false
75
76 Timer {
77 interval: 1
78 repeat: false
79 running: bottomEdge.visible
80 onTriggered: bottomEdge.preloadContent = true
81 }
7382
74 onCommitCompleted: {83 onCommitCompleted: {
75 pushPage()84 pushPage()
76 collapse()85 collapse()
77 }86 }
7887
79 Component {88 function setContactEditorPageProperties(contactEditorPage) {
80 id: editorPageBottomEdge89 if (contactEditorPage) {
8190 contactEditorPage.implicitHeight = Qt.binding(function () {return mainWindow.height;});
82 ABContactEditorPage {91 contactEditorPage.implicitWidth = Qt.binding(function () {
83 id: editorPageItem92 return contactEditorPage.parent ? contactEditorPage.parent.width
8493 : bottomEdge.width;
85 implicitHeight: mainWindow.height94 });
86 implicitWidth: parent ? parent.width : bottomEdge.width95 contactEditorPage.enabled = false;
87 enabled: false96 contactEditorPage.model = Qt.binding(function () {return bottomEdge.modelToEdit;});
88 model: bottomEdge.modelToEdit97 contactEditorPage.pageStack = Qt.binding(function () {return bottomEdge.pageStack;});
89 contact: ContactsUI.ContactsJS.createEmptyContact("", editorPageItem)
90 onCanceled: pageStack.removePages(editorPageItem)
91 onContactSaved: pageStack.removePages(editorPageItem)
92 pageStack: bottomEdge.pageStack
93 }98 }
94 }99 }
95}100}
96101
=== added file 'src/imports/BusyImportingDialog.qml'
--- src/imports/BusyImportingDialog.qml 1970-01-01 00:00:00 +0000
+++ src/imports/BusyImportingDialog.qml 2016-11-08 15:35:55 +0000
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2016 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.4
18
19import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.3 as Popups
21
22import Ubuntu.AddressBook.Base 0.1
23
24Popups.Dialog {
25 id: busyImportingDialog
26
27 property alias allowToClose: closeButton.visible
28 property alias showActivity: busyIndicator.visible
29 signal destruction
30
31 title: i18n.tr("Importing...")
32
33 ActivityIndicator {
34 id: busyIndicator
35 running: visible
36 visible: true
37 }
38 Button {
39 id: closeButton
40 text: i18n.tr("Close")
41 visible: false
42 color: UbuntuColors.red
43 onClicked: {
44 busyImportingDialog.destruction()
45 PopupUtils.close(busyImportingDialog)
46 }
47 }
48}
049
=== modified file 'src/imports/CMakeLists.txt'
--- src/imports/CMakeLists.txt 2016-02-12 20:40:02 +0000
+++ src/imports/CMakeLists.txt 2016-11-08 15:35:55 +0000
@@ -4,12 +4,15 @@
4 ABAdaptivePageLayout.qml4 ABAdaptivePageLayout.qml
5 ABContactListPage.qml5 ABContactListPage.qml
6 ABContactEditorPage.qml6 ABContactEditorPage.qml
7 ABContactEditorPageWithEmptyContact.qml
7 ABContactViewPage.qml8 ABContactViewPage.qml
8 ABEmptyState.qml9 ABEmptyState.qml
9 ABNewContactBottomEdge.qml10 ABNewContactBottomEdge.qml
10 ABMultiColumnEmptyState.qml11 ABMultiColumnEmptyState.qml
11 ContentHubProxy.qml12 ContentHubProxy.qml
12 MainWindow.qml13 MainWindow.qml
14 RemoveContactsDialog.qml
15 BusyImportingDialog.qml
13)16)
1417
15install(FILES ${ADDRESS_BOOK_APP_QMLS}18install(FILES ${ADDRESS_BOOK_APP_QMLS}
1619
=== modified file 'src/imports/MainWindow.qml'
--- src/imports/MainWindow.qml 2016-08-17 18:15:07 +0000
+++ src/imports/MainWindow.qml 2016-11-08 15:35:55 +0000
@@ -223,23 +223,6 @@
223 value: mainStack.hasMouse223 value: mainStack.hasMouse
224 }224 }
225225
226 Component {
227 id: errorDialog
228
229 Popups.Dialog {
230 id: dialogue
231
232 title: i18n.tr("Error")
233 text: mainWindow.modelErrorMessage
234
235 Button {
236 text: i18n.tr("Cancel")
237 gradient: UbuntuColors.greyGradient
238 onClicked: PopupUtils.close(dialogue)
239 }
240 }
241 }
242
243 Connections {226 Connections {
244 target: UriHandler227 target: UriHandler
245 onOpened: {228 onOpened: {
246229
=== added file 'src/imports/RemoveContactsDialog.qml'
--- src/imports/RemoveContactsDialog.qml 1970-01-01 00:00:00 +0000
+++ src/imports/RemoveContactsDialog.qml 2016-11-08 15:35:55 +0000
@@ -0,0 +1,36 @@
1/*
2 * Copyright (C) 2016 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.4
18
19import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.3 as Popups
21import Ubuntu.AddressBook.Base 0.1
22
23RemoveContactsDialog {
24 id: removeContactsDialog
25
26 property var contactListModel
27
28 onCanceled: {
29 PopupUtils.close(removeContactsDialog)
30 }
31
32 onAccepted: {
33 removeContactsDialog.removeContacts(removeContactsDialog.contactListModel)
34 PopupUtils.close(removeContactsDialog)
35 }
36}
037
=== added file 'src/imports/Ubuntu/AddressBook/Base/BusyExportingDialog.qml'
--- src/imports/Ubuntu/AddressBook/Base/BusyExportingDialog.qml 1970-01-01 00:00:00 +0000
+++ src/imports/Ubuntu/AddressBook/Base/BusyExportingDialog.qml 2016-11-08 15:35:55 +0000
@@ -0,0 +1,31 @@
1/*
2 * Copyright (C) 2016 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.4
18
19import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.3
21
22Dialog {
23 title: i18n.dtr("address-book-app", "Exporting contacts...")
24
25 ActivityIndicator {
26 id: activity
27
28 anchors.horizontalCenter: parent.horizontalCenter
29 running: true
30 }
31}
032
=== modified file 'src/imports/Ubuntu/AddressBook/Base/CMakeLists.txt'
--- src/imports/Ubuntu/AddressBook/Base/CMakeLists.txt 2015-04-29 18:39:01 +0000
+++ src/imports/Ubuntu/AddressBook/Base/CMakeLists.txt 2016-11-08 15:35:55 +0000
@@ -1,4 +1,5 @@
1set(AB_CONTACT_COMMON_QMLS1set(AB_CONTACT_COMMON_QMLS
2 BusyExportingDialog.qml
2 ContactDetailBase.qml3 ContactDetailBase.qml
3 ContactDetailItem.qml4 ContactDetailItem.qml
4 ContactDetailGroupBase.qml5 ContactDetailGroupBase.qml
56
=== modified file 'src/imports/Ubuntu/AddressBook/Base/ContactExporter.qml'
--- src/imports/Ubuntu/AddressBook/Base/ContactExporter.qml 2016-03-16 16:13:17 +0000
+++ src/imports/Ubuntu/AddressBook/Base/ContactExporter.qml 2016-11-08 15:35:55 +0000
@@ -44,7 +44,7 @@
44 }44 }
4545
46 if (!priv.busyDialog) {46 if (!priv.busyDialog) {
47 priv.busyDialog = PopupUtils.open(busyDialogComponent, root)47 priv.busyDialog = PopupUtils.open(Qt.resolvedUrl("BusyExportingDialog.qml"), root)
48 }48 }
4949
50 var ids = []50 var ids = []
@@ -159,19 +159,4 @@
159 }159 }
160 }160 }
161 }161 }
162
163 Component {
164 id: busyDialogComponent
165
166 Dialog {
167 title: i18n.dtr("address-book-app", "Exporting contacts...")
168
169 ActivityIndicator {
170 id: activity
171
172 anchors.horizontalCenter: parent.horizontalCenter
173 running: true
174 }
175 }
176 }
177}162}
178163
=== added file 'src/imports/Ubuntu/AddressBook/ContactEditor/AlertMessageDialog.qml'
--- src/imports/Ubuntu/AddressBook/ContactEditor/AlertMessageDialog.qml 1970-01-01 00:00:00 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/AlertMessageDialog.qml 2016-11-08 15:35:55 +0000
@@ -0,0 +1,53 @@
1/*
2 * Copyright (C) 2012-2016 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.4
18
19import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.3
21import Ubuntu.Contacts 0.1 as ContactsUI
22
23Dialog {
24 id: alertMessageDialog
25
26 property QtObject contact: null
27 signal destruction
28
29 title: i18n.dtr("address-book-app", "Contact Editor")
30 text: {
31 if (ContactsUI.Contacts.updateIsRunning) {
32 return i18n.dtr("address-book-app",
33 "Your <b>%1</b> contact sync account needs to be upgraded.\nWait until the upgrade is complete to edit contacts.")
34 .arg(alertMessageDialog.contact.syncTarget.syncTarget)
35 }
36 if (Qt.application.name === "AddressBookApp") {
37 i18n.dtr("address-book-app",
38 "Your <b>%1</b> contact sync account needs to be upgraded. Use the sync button to upgrade the Contacts app.\nOnly local contacts will be editable until upgrade is complete.")
39 .arg(alertMessageDialog.contact.syncTarget.syncTarget)
40 } else {
41 i18n.dtr("address-book-app",
42 "Your <b>%1</b> contact sync account needs to be upgraded by running Contacts app.\nOnly local contacts will be editable until upgrade is complete.")
43 .arg(alertMessageDialog.contact.syncTarget.syncTarget);
44 }
45 }
46
47 Button {
48 text: i18n.dtr("address-book-app", "Close")
49 onClicked: PopupUtils.close(alertMessageDialog)
50 }
51
52 Component.onCompleted: Qt.inputMethod.hide()
53}
054
=== modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/AvatarImport.qml'
--- src/imports/Ubuntu/AddressBook/ContactEditor/AvatarImport.qml 2016-03-16 16:13:17 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/AvatarImport.qml 2016-11-08 15:35:55 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2012-2014 Canonical, Ltd.2 * Copyright (C) 2012-2016 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * 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 by5 * it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
1818
19import Ubuntu.Components 1.319import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.320import Ubuntu.Components.Popups 1.3
21import Ubuntu.Content 1.3
2221
23Item {22Item {
24 id: root23 id: root
@@ -30,88 +29,12 @@
30 function requestNewAvatar()29 function requestNewAvatar()
31 {30 {
32 if (!root.importDialog) {31 if (!root.importDialog) {
33 root.importDialog = PopupUtils.open(contentHubDialog, null)32 root.importDialog = PopupUtils.open(Qt.resolvedUrl("AvatarImportDialog.qml"), null)
33 root.importDialog.avatarReceived.connect(root.avatarReceived)
34 root.importDialog.destruction.connect(function () {root.importDialog = null})
35
34 } else {36 } else {
35 console.warn("Import dialog already running")37 console.warn("Import dialog already running")
36 }38 }
37 }39 }
38
39 Component {
40 id: contentHubDialog
41
42 PopupBase {
43 id: dialogue
44
45 property alias activeTransfer: signalConnections.target
46
47 parent: QuickUtils.rootItem(this)
48 focus: true
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 contentType: ContentType.Pictures
63 handler: ContentHandler.Source
64
65 onPeerSelected: {
66 peer.selectionType = ContentTransfer.Single
67 dialogue.activeTransfer = peer.request()
68 }
69
70 onCancelPressed: {
71 PopupUtils.close(root.importDialog)
72 }
73 }
74 }
75
76 Connections {
77 id: signalConnections
78
79 onStateChanged: {
80 var done = ((dialogue.activeTransfer.state === ContentTransfer.Charged) ||
81 (dialogue.activeTransfer.state === ContentTransfer.Aborted))
82
83 if (dialogue.activeTransfer.state === ContentTransfer.Charged) {
84 if (dialogue.activeTransfer.items.length > 0) {
85 root.avatarReceived(dialogue.activeTransfer.items[0].url)
86 }
87 }
88
89 if (done) {
90 acceptTimer.restart()
91 }
92 }
93 }
94
95 // WORKAROUND: Work around for application becoming insensitive to touch events
96 // if the dialog is dismissed while the application is inactive.
97 // Just listening for changes to Qt.application.active doesn't appear
98 // to be enough to resolve this, so it seems that something else needs
99 // to be happening first. As such there's a potential for a race
100 // condition here, although as yet no problem has been encountered.
101 Timer {
102 id: acceptTimer
103
104 interval: 100
105 repeat: true
106 running: false
107 onTriggered: {
108 if(Qt.application.state === Qt.ApplicationActive) {
109 PopupUtils.close(root.importDialog)
110 }
111 }
112 }
113
114 Component.onDestruction: root.importDialog = null
115 }
116 }
117}40}
11841
=== added file 'src/imports/Ubuntu/AddressBook/ContactEditor/AvatarImportDialog.qml'
--- src/imports/Ubuntu/AddressBook/ContactEditor/AvatarImportDialog.qml 1970-01-01 00:00:00 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/AvatarImportDialog.qml 2016-11-08 15:35:55 +0000
@@ -0,0 +1,98 @@
1/*
2 * Copyright (C) 2016 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.4
18
19import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.3
21import Ubuntu.Content 1.3
22
23PopupBase {
24 id: dialogue
25
26 property alias activeTransfer: signalConnections.target
27 signal avatarReceived(string avatarUrl)
28 signal destruction()
29
30 parent: QuickUtils.rootItem(this)
31 focus: true
32
33 Rectangle {
34 anchors.fill: parent
35
36 ContentTransferHint {
37 anchors.fill: parent
38 activeTransfer: dialogue.activeTransfer
39 }
40
41 ContentPeerPicker {
42 id: peerPicker
43
44 anchors.fill: parent
45 contentType: ContentType.Pictures
46 handler: ContentHandler.Source
47
48 onPeerSelected: {
49 peer.selectionType = ContentTransfer.Single
50 dialogue.activeTransfer = peer.request()
51 }
52
53 onCancelPressed: {
54 PopupUtils.close(dialogue)
55 }
56 }
57 }
58
59 Connections {
60 id: signalConnections
61
62 onStateChanged: {
63 var done = ((dialogue.activeTransfer.state === ContentTransfer.Charged) ||
64 (dialogue.activeTransfer.state === ContentTransfer.Aborted))
65
66 if (dialogue.activeTransfer.state === ContentTransfer.Charged) {
67 if (dialogue.activeTransfer.items.length > 0) {
68 dialogue.avatarReceived(dialogue.activeTransfer.items[0].url)
69 }
70 }
71
72 if (done) {
73 acceptTimer.restart()
74 }
75 }
76 }
77
78 // WORKAROUND: Work around for application becoming insensitive to touch events
79 // if the dialog is dismissed while the application is inactive.
80 // Just listening for changes to Qt.application.active doesn't appear
81 // to be enough to resolve this, so it seems that something else needs
82 // to be happening first. As such there's a potential for a race
83 // condition here, although as yet no problem has been encountered.
84 Timer {
85 id: acceptTimer
86
87 interval: 100
88 repeat: true
89 running: false
90 onTriggered: {
91 if(Qt.application.state === Qt.ApplicationActive) {
92 PopupUtils.close(dialogue)
93 }
94 }
95 }
96
97 Component.onDestruction: dialogue.destruction()
98}
099
=== modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/CMakeLists.txt'
--- src/imports/Ubuntu/AddressBook/ContactEditor/CMakeLists.txt 2015-09-24 18:48:34 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/CMakeLists.txt 2016-11-08 15:35:55 +0000
@@ -1,5 +1,7 @@
1set(AB_CONTACT_EDITOR_QMLS1set(AB_CONTACT_EDITOR_QMLS
2 AlertMessageDialog.qml
2 AvatarImport.qml3 AvatarImport.qml
4 AvatarImportDialog.qml
3 ComboButtonAddField.qml5 ComboButtonAddField.qml
4 ContactDetailAddressesEditor.qml6 ContactDetailAddressesEditor.qml
5 ContactDetailAvatarEditor.qml7 ContactDetailAvatarEditor.qml
@@ -12,6 +14,7 @@
12 ContactDetailSyncTargetEditor.qml14 ContactDetailSyncTargetEditor.qml
13 ContactDetailWithTypeEditor.qml15 ContactDetailWithTypeEditor.qml
14 ContactEditorPage.qml16 ContactEditorPage.qml
17 RemoveContactsDialog.qml
15 TextInputDetail.qml18 TextInputDetail.qml
16 ValueSelector.qml19 ValueSelector.qml
17 qmldir20 qmldir
1821
=== modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml'
--- src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2016-08-18 13:24:57 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2016-11-08 15:35:55 +0000
@@ -364,11 +364,15 @@
364 left: parent.left364 left: parent.left
365 right: parent.right365 right: parent.right
366 }366 }
367 property var alertMessageDialog
367 onChanged: {368 onChanged: {
368 if (contactEditor.enabled &&369 if (contactEditor.enabled &&
369 !contactEditor.isNewContact &&370 !contactEditor.isNewContact &&
370 syncTargetEditor.contactIsReadOnly(contactEditor.contact)) {371 syncTargetEditor.contactIsReadOnly(contactEditor.contact)) {
371 PopupUtils.open(alertMessage)372 syncTargetEditor.alertMessageDialog = PopupUtils.open(Qt.resolvedUrl("AlertMessageDialog.qml"),
373 null,
374 {"contact": contactEditor.contact})
375 syncTargetEditor.alertMessageDialog.destruction.connect(contactEditor.close)
372 }376 }
373 }377 }
374 }378 }
@@ -463,7 +467,8 @@
463 enabled: contactEditor.active && deleteButton.visible467 enabled: contactEditor.active && deleteButton.visible
464 shortcut: "Ctrl+Delete"468 shortcut: "Ctrl+Delete"
465 onTriggered: {469 onTriggered: {
466 var dialog = PopupUtils.open(removeContactDialog, null)470 var dialog = PopupUtils.open(Qt.resolvedUrl("RemoveContactsDialog.qml"), null,
471 {"contactEditor": contactEditor})
467 dialog.contacts = [contactEditor.contact]472 dialog.contacts = [contactEditor.contact]
468 }473 }
469 }474 }
@@ -500,79 +505,4 @@
500505
501 focusTimer.restart()506 focusTimer.restart()
502 }507 }
503
504 Component {
505 id: alertMessage
506
507 Dialog {
508 id: aletMessageDialog
509
510 title: i18n.dtr("address-book-app", "Contact Editor")
511 text: {
512 if (ContactsUI.Contacts.updateIsRunning) {
513 return i18n.dtr("address-book-app",
514 "Your <b>%1</b> contact sync account needs to be upgraded.\nWait until the upgrade is complete to edit contacts.")
515 .arg(contactEditor.contact.syncTarget.syncTarget)
516 }
517 if (Qt.application.name === "AddressBookApp") {
518 i18n.dtr("address-book-app",
519 "Your <b>%1</b> contact sync account needs to be upgraded. Use the sync button to upgrade the Contacts app.\nOnly local contacts will be editable until upgrade is complete.")
520 .arg(contactEditor.contact.syncTarget.syncTarget)
521 } else {
522 i18n.dtr("address-book-app",
523 "Your <b>%1</b> contact sync account needs to be upgraded by running Contacts app.\nOnly local contacts will be editable until upgrade is complete.")
524 .arg(contactEditor.contact.syncTarget.syncTarget);
525 }
526 }
527
528 Button {
529 text: i18n.dtr("address-book-app", "Close")
530 onClicked: PopupUtils.close(aletMessageDialog)
531 }
532
533 Component.onCompleted: Qt.inputMethod.hide()
534 Component.onDestruction: contactEditor.pageStack.removePages(contactEditor)
535 }
536 }
537
538 Component {
539 id: removeContactDialog
540
541 RemoveContactsDialog {
542 id: removeContactsDialogMessage
543
544 property bool popPages: false
545
546 onCanceled: {
547 PopupUtils.close(removeContactsDialogMessage)
548 }
549
550 onAccepted: {
551 popPages = true
552 removeContacts(contactEditor.model)
553 PopupUtils.close(removeContactsDialogMessage)
554 }
555
556 // hide virtual keyboard if necessary
557 Component.onCompleted: {
558 contactEditor.enabled = false
559 Qt.inputMethod.hide()
560 }
561
562 // WORKAROUND: SDK element crash if pop the page where the dialog was created
563 Component.onDestruction: {
564 contactEditor.enabled = true
565 if (popPages) {
566 if (contactEditor.pageStack.removePages) {
567 contactEditor.pageStack.removePages(contactEditor)
568 } else {
569 contactEditor.pageStack.pop() // editor page
570 contactEditor.pageStack.pop() // view page
571 }
572 }
573 if (contactEditor.pageStack.primaryPage)
574 contactEditor.pageStack.primaryPage.forceActiveFocus()
575 }
576 }
577 }
578}508}
579509
=== added file 'src/imports/Ubuntu/AddressBook/ContactEditor/RemoveContactsDialog.qml'
--- src/imports/Ubuntu/AddressBook/ContactEditor/RemoveContactsDialog.qml 1970-01-01 00:00:00 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/RemoveContactsDialog.qml 2016-11-08 15:35:55 +0000
@@ -0,0 +1,60 @@
1/*
2 * Copyright (C) 2012-2016 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.4
18
19import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.3
21
22import Ubuntu.AddressBook.Base 0.1
23
24RemoveContactsDialog {
25 id: removeContactsDialogMessage
26
27 property bool popPages: false
28 property var contactEditor
29
30 onCanceled: {
31 PopupUtils.close(removeContactsDialogMessage)
32 }
33
34 onAccepted: {
35 popPages = true
36 removeContacts(contactEditor.model)
37 PopupUtils.close(removeContactsDialogMessage)
38 }
39
40 // hide virtual keyboard if necessary
41 Component.onCompleted: {
42 contactEditor.enabled = false
43 Qt.inputMethod.hide()
44 }
45
46 // WORKAROUND: SDK element crash if pop the page where the dialog was created
47 Component.onDestruction: {
48 contactEditor.enabled = true
49 if (popPages) {
50 if (contactEditor.pageStack.removePages) {
51 contactEditor.pageStack.removePages(contactEditor)
52 } else {
53 contactEditor.pageStack.pop() // editor page
54 contactEditor.pageStack.pop() // view page
55 }
56 }
57 if (contactEditor.pageStack.primaryPage)
58 contactEditor.pageStack.primaryPage.forceActiveFocus()
59 }
60}
061
=== modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ValueSelector.qml'
--- src/imports/Ubuntu/AddressBook/ContactEditor/ValueSelector.qml 2015-10-26 13:18:11 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/ValueSelector.qml 2016-11-08 15:35:55 +0000
@@ -97,6 +97,7 @@
97 color: "black"97 color: "black"
98 height: units.gu(1)98 height: units.gu(1)
99 width: height99 width: height
100 asynchronous: true
100101
101 anchors {102 anchors {
102 verticalCenter: parent.verticalCenter103 verticalCenter: parent.verticalCenter
@@ -169,6 +170,7 @@
169 height: visible ? units.gu(1) : 0170 height: visible ? units.gu(1) : 0
170 width: height171 width: height
171 visible: index < (listView.count - 1)172 visible: index < (listView.count - 1)
173 asynchronous: true
172174
173 anchors {175 anchors {
174 verticalCenter: listLabel.verticalCenter176 verticalCenter: listLabel.verticalCenter
175177
=== modified file 'src/imports/Ubuntu/AddressBook/ContactView/ActionButton.qml'
--- src/imports/Ubuntu/AddressBook/ContactView/ActionButton.qml 2015-11-19 16:38:36 +0000
+++ src/imports/Ubuntu/AddressBook/ContactView/ActionButton.qml 2016-11-08 15:35:55 +0000
@@ -31,5 +31,6 @@
31 height: root.iconSize31 height: root.iconSize
32 width: root.iconSize32 width: root.iconSize
33 color: root.activeFocus ? UbuntuColors.orange : "gray"33 color: root.activeFocus ? UbuntuColors.orange : "gray"
34 asynchronous: true
34 }35 }
35}36}
3637
=== modified file 'src/imports/Ubuntu/AddressBook/ContactView/ContactDetailAvatarView.qml'
--- src/imports/Ubuntu/AddressBook/ContactView/ContactDetailAvatarView.qml 2015-12-10 19:13:20 +0000
+++ src/imports/Ubuntu/AddressBook/ContactView/ContactDetailAvatarView.qml 2016-11-08 15:35:55 +0000
@@ -46,6 +46,7 @@
46 anchors.fill: parent46 anchors.fill: parent
47 fillMode: Image.PreserveAspectCrop47 fillMode: Image.PreserveAspectCrop
48 visible: false48 visible: false
49 asynchronous: true
49 }50 }
5051
51 FastBlur {52 FastBlur {
5253
=== modified file 'src/imports/Ubuntu/AddressBook/ContactView/ContactDetailWithTypeView.qml'
--- src/imports/Ubuntu/AddressBook/ContactView/ContactDetailWithTypeView.qml 2015-12-10 19:13:20 +0000
+++ src/imports/Ubuntu/AddressBook/ContactView/ContactDetailWithTypeView.qml 2016-11-08 15:35:55 +0000
@@ -81,5 +81,6 @@
81 name: root.action ? root.action.iconName : ""81 name: root.action ? root.action.iconName : ""
82 color: root.activeFocus ? UbuntuColors.orange : "gray"82 color: root.activeFocus ? UbuntuColors.orange : "gray"
83 visible: width > 083 visible: width > 0
84 asynchronous: true
84 }85 }
85}86}
8687
=== modified file 'src/imports/Ubuntu/AddressBook/ContactView/ContactViewPage.qml'
--- src/imports/Ubuntu/AddressBook/ContactView/ContactViewPage.qml 2016-03-02 14:32:16 +0000
+++ src/imports/Ubuntu/AddressBook/ContactView/ContactViewPage.qml 2016-11-08 15:35:55 +0000
@@ -82,15 +82,11 @@
82 anchors.centerIn: parent82 anchors.centerIn: parent
83 }83 }
8484
85 ContactFetchError {
86 id: fetchErrorDialog
87 }
88
89 ContactFetch {85 ContactFetch {
90 id: contactFetch86 id: contactFetch
9187
92 onContactRemoved: root.contactRemoved()88 onContactRemoved: root.contactRemoved()
93 onContactNotFound: PopupUtils.open(fetchErrorDialog, root)89 onContactNotFound: PopupUtils.open(Qt.resolvedUrl("ContactFetchError.qml"), root)
94 onContactFetched: {90 onContactFetched: {
95 root.contact = contact91 root.contact = contact
96 root.contactFetched(root.contact)92 root.contactFetched(root.contact)
9793
=== modified file 'src/imports/Ubuntu/Contacts/ActionButton.qml'
--- src/imports/Ubuntu/Contacts/ActionButton.qml 2015-10-26 13:18:11 +0000
+++ src/imports/Ubuntu/Contacts/ActionButton.qml 2016-11-08 15:35:55 +0000
@@ -30,5 +30,6 @@
30 anchors.centerIn: parent30 anchors.centerIn: parent
31 height: root.iconSize31 height: root.iconSize
32 width: root.iconSize32 width: root.iconSize
33 asynchronous: true
33 }34 }
34}35}
3536
=== modified file 'src/imports/Ubuntu/Contacts/ContactAvatar.qml'
--- src/imports/Ubuntu/Contacts/ContactAvatar.qml 2016-05-04 21:00:18 +0000
+++ src/imports/Ubuntu/Contacts/ContactAvatar.qml 2016-11-08 15:35:55 +0000
@@ -85,5 +85,6 @@
85 anchors.centerIn: avatar85 anchors.centerIn: avatar
86 height: units.gu(3)86 height: units.gu(3)
87 width: height87 width: height
88 asynchronous: true
88 }89 }
89}90}
9091
=== modified file 'src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml'
--- src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2016-01-21 21:30:32 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2016-11-08 15:35:55 +0000
@@ -122,6 +122,7 @@
122 height: units.gu(3)122 height: units.gu(3)
123 width: height123 width: height
124 anchors.verticalCenter: parent.verticalCenter124 anchors.verticalCenter: parent.verticalCenter
125 asynchronous: true
125 }126 }
126 }127 }
127 }128 }
128129
=== modified file 'src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml'
--- src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml 2016-01-21 21:30:32 +0000
+++ src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml 2016-11-08 15:35:55 +0000
@@ -52,6 +52,7 @@
52 backgroundColor: Theme.palette.normal.overlay52 backgroundColor: Theme.palette.normal.overlay
53 source: Image {53 source: Image {
54 source: root.expandIcon ? root.iconSource : ""54 source: root.expandIcon ? root.iconSource : ""
55 asynchronous: true
55 }56 }
56 Image {57 Image {
57 anchors.centerIn: parent58 anchors.centerIn: parent
@@ -59,6 +60,7 @@
59 visible: !root.expandIcon60 visible: !root.expandIcon
60 width: units.gu(2)61 width: units.gu(2)
61 height: units.gu(2)62 height: units.gu(2)
63 asynchronous: true
62 }64 }
63 visible: root.showContents65 visible: root.showContents
64 }66 }
6567
=== modified file 'src/imports/Ubuntu/Contacts/ListItemWithActions.qml'
--- src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2016-05-26 18:52:14 +0000
+++ src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2016-11-08 15:35:55 +0000
@@ -205,6 +205,7 @@
205 color: Theme.palette.selected.field205 color: Theme.palette.selected.field
206 height: units.gu(3)206 height: units.gu(3)
207 width: units.gu(3)207 width: units.gu(3)
208 asynchronous: true
208 }209 }
209 }210 }
210211
@@ -247,6 +248,7 @@
247 height: units.gu(3)248 height: units.gu(3)
248 name: modelData.iconName249 name: modelData.iconName
249 color: root.activeAction === modelData ? UbuntuColors.orange : UbuntuColors.lightGrey250 color: root.activeAction === modelData ? UbuntuColors.orange : UbuntuColors.lightGrey
251 asynchronous: true
250 }252 }
251 }253 }
252 }254 }
253255
=== modified file 'tests/qml/tst_ContactList.qml'
--- tests/qml/tst_ContactList.qml 2015-10-26 13:18:11 +0000
+++ tests/qml/tst_ContactList.qml 2016-11-08 15:35:55 +0000
@@ -38,6 +38,7 @@
38 property string callbackApplication: ""38 property string callbackApplication: ""
39 property bool firstRun: true39 property bool firstRun: true
40 property bool disableOnlineAccounts: true40 property bool disableOnlineAccounts: true
41 property bool isOnline: false
4142
42 function elapsed()43 function elapsed()
43 {44 {
@@ -59,6 +60,12 @@
5960
60 MainView {61 MainView {
61 id: mainView62 id: mainView
63 pageStack: Item {
64 property var contactListPage: null
65 readonly property int columns: 1
66 readonly property bool hasKeyboard: false
67 }
68
62 anchors.fill: parent69 anchors.fill: parent
63 }70 }
6471
@@ -86,6 +93,9 @@
8693
87 function cleanup()94 function cleanup()
88 {95 {
96 //WORKAROUND: avoid problems with async object
97 //if the test run too fast it can cause problems with async objects
98 wait(1000)
89 root.contactListPageObj.destroy()99 root.contactListPageObj.destroy()
90 }100 }
91101

Subscribers

People subscribed via source and target branches