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

Proposed by Florian Boucault
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 474
Merged at revision: 490
Proposed branch: lp:~fboucault/address-book-app/multicolumns
Merge into: lp:address-book-app
Prerequisite: lp:~fboucault/address-book-app/toolkit13
Diff against target: 349 lines (+63/-59)
11 files modified
src/imports/ABContactListPage.qml (+25/-18)
src/imports/ABContactViewPage.qml (+14/-9)
src/imports/MainWindow.qml (+8/-16)
src/imports/Settings/SettingsPage.qml (+1/-1)
src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml (+3/-4)
src/imports/Ubuntu/AddressBook/ContactShare/ContactSharePage.qml (+2/-2)
src/imports/Ubuntu/Contacts/ContactListView.qml (+4/-4)
src/imports/Ubuntu/Contacts/ContactSimpleListView.qml (+2/-1)
src/imports/Ubuntu/Contacts/ListItemWithActions.qml (+1/-1)
src/imports/Ubuntu/Contacts/PageWithBottomEdge.qml (+1/-1)
src/imports/Ubuntu/Contacts/SIMCardImportPage.qml (+2/-2)
To merge this branch: bzr merge lp:~fboucault/address-book-app/multicolumns
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+270113@code.launchpad.net

Commit message

Use AdaptivePageLayout instead of PageStack to support multi column layouts.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
472. By Florian Boucault

Merged from toolkit13

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

- Is correct that the edit page has a small header than other pages?
- Is correct that when opening the edit page from the bottom edge it fills only the right side page? Keeping the left side page empty?

473. By Florian Boucault

Merged from toolkit13

Revision history for this message
Florian Boucault (fboucault) wrote :

> - Is correct that the edit page has a small header than other pages?

I'm not sure why the new contact page has a smaller header. That will probably be fixed anyway with the next MR that changes the bottom edge.

> - Is correct that when opening the edit page from the bottom edge it fills
> only the right side page? Keeping the left side page empty?

I intend to fix that in the next merge request as this is not good UX wise but not a regression.

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

Merged from toolkit13

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
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 'src/imports/ABContactListPage.qml'
--- src/imports/ABContactListPage.qml 2015-10-16 13:35:56 +0000
+++ src/imports/ABContactListPage.qml 2015-10-16 13:35:56 +0000
@@ -66,25 +66,29 @@
66 enabled: false,66 enabled: false,
67 initialFocusSection: "name"})67 initialFocusSection: "name"})
68 } else {68 } else {
69 pageStack.push(Qt.resolvedUrl("ABContactEditorPage.qml"),69 pageStack.addPageToNextColumn(mainPage,
70 {model: contactList.listModel,70 Qt.resolvedUrl("ABContactEditorPage.qml"),
71 contact: newContact,71 {model: contactList.listModel,
72 initialFocusSection: "name"})72 contact: newContact,
73 initialFocusSection: "name"})
73 }74 }
74 }75 }
7576
76 function showContact(contactId)77 function showContact(contactId)
77 {78 {
78 pageStack.push(Qt.resolvedUrl("ABContactViewPage.qml"),79 pageStack.addPageToNextColumn(mainPage,
79 {model: contactList.listModel, contactId: contactId})80 Qt.resolvedUrl("ABContactViewPage.qml"),
81 {model: contactList.listModel,
82 contactId: contactId})
80 }83 }
8184
82 function addPhoneToContact(contactId, phoneNumber)85 function addPhoneToContact(contactId, phoneNumber)
83 {86 {
84 pageStack.push(Qt.resolvedUrl("ABContactViewPage.qml"),87 pageStack.addPageToNextColumn(mainPage,
85 {model: contactList.listModel,88 Qt.resolvedUrl("ABContactViewPage.qml"),
86 contactId: contactId,89 {model: contactList.listModel,
87 addPhoneToContact: phoneNumber})90 contactId: contactId,
91 addPhoneToContact: phoneNumber})
88 }92 }
8993
90 function importContact(urls)94 function importContact(urls)
@@ -149,9 +153,10 @@
149153
150 onContactClicked: {154 onContactClicked: {
151 mainPage.state = "default"155 mainPage.state = "default"
152 pageStack.push(Qt.resolvedUrl("ABContactViewPage.qml"),156 pageStack.addPageToNextColumn(mainPage,
153 {model: contactList.listModel,157 Qt.resolvedUrl("ABContactViewPage.qml"),
154 contact: contact})158 {model: contactList.listModel,
159 contact: contact})
155 }160 }
156 onIsInSelectionModeChanged: mainPage.state = isInSelectionMode ? "selection" : "default"161 onIsInSelectionModeChanged: mainPage.state = isInSelectionMode ? "selection" : "default"
157 onSelectionCanceled: {162 onSelectionCanceled: {
@@ -241,8 +246,9 @@
241 Action {246 Action {
242 text: i18n.tr("Settings")247 text: i18n.tr("Settings")
243 iconName: "settings"248 iconName: "settings"
244 onTriggered: pageStack.push(Qt.resolvedUrl("./Settings/SettingsPage.qml"),249 onTriggered: pageStack.addPageToNextColumn(mainPage,
245 {"contactListModel": contactList.listModel})250 Qt.resolvedUrl("./Settings/SettingsPage.qml"),
251 {"contactListModel": contactList.listModel})
246 }252 }
247 ]253 ]
248 PropertyChanges {254 PropertyChanges {
@@ -481,9 +487,10 @@
481 // Share contacts to an application chosen by the user487 // Share contacts to an application chosen by the user
482 if (!mainPage.pickMode) {488 if (!mainPage.pickMode) {
483 contactExporter.dismissBusyDialog()489 contactExporter.dismissBusyDialog()
484 pageStack.push(contactShareComponent,490 pageStack.addPageToNextColumn(mainPage,
485 { contactModel: contactExporter.contactModel,491 contactShareComponent,
486 contacts: contacts })492 {contactModel: contactExporter.contactModel,
493 contacts: contacts })
487 }494 }
488 }495 }
489 }496 }
490497
=== modified file 'src/imports/ABContactViewPage.qml'
--- src/imports/ABContactViewPage.qml 2015-10-16 13:35:56 +0000
+++ src/imports/ABContactViewPage.qml 2015-10-16 13:35:56 +0000
@@ -35,7 +35,10 @@
35 text: i18n.tr("Share")35 text: i18n.tr("Share")
36 iconName: "share"36 iconName: "share"
37 onTriggered: {37 onTriggered: {
38 pageStack.push(contactShareComponent, {contactModel: root.model, contacts: [root.contact]})38 pageStack.addPageToCurrentColumn(root,
39 contactShareComponent,
40 {contactModel: root.model,
41 contacts: [root.contact]})
39 }42 }
40 },43 },
41 Action {44 Action {
@@ -43,13 +46,15 @@
43 text: i18n.tr("Edit")46 text: i18n.tr("Edit")
44 iconName: "edit"47 iconName: "edit"
45 onTriggered: {48 onTriggered: {
46 pageStack.push(Qt.resolvedUrl("ABContactEditorPage.qml"),49 pageStack.addPageToCurrentColumn(root,
47 { model: root.model, contact: root.contact})50 Qt.resolvedUrl("ABContactEditorPage.qml"),
51 {model: root.model,
52 contact: root.contact})
48 }53 }
49 }54 }
50 ]55 ]
5156
52 onContactRemoved: pageStack.pop()57 onContactRemoved: pageStack.removePages(root)
5358
54 extensions: ContactDetailSyncTargetView {59 extensions: ContactDetailSyncTargetView {
55 contact: root.contact60 contact: root.contact
@@ -68,11 +73,11 @@
68 var newDetail = Qt.createQmlObject(detailSourceTemplate, contact)73 var newDetail = Qt.createQmlObject(detailSourceTemplate, contact)
69 if (newDetail) {74 if (newDetail) {
70 contact.addDetail(newDetail)75 contact.addDetail(newDetail)
71 pageStack.push(Qt.resolvedUrl("ABContactEditorPage.qml"),76 pageStack.addPageToCurrentColumn(root, Qt.resolvedUrl("ABContactEditorPage.qml"),
72 { model: root.model,77 { model: root.model,
73 contact: contact,78 contact: contact,
74 initialFocusSection: "phones",79 initialFocusSection: "phones",
75 newDetails: [newDetail]})80 newDetails: [newDetail]})
76 root.addPhoneToContact = ""81 root.addPhoneToContact = ""
77 }82 }
78 }83 }
7984
=== modified file 'src/imports/MainWindow.qml'
--- src/imports/MainWindow.qml 2015-10-16 13:35:56 +0000
+++ src/imports/MainWindow.qml 2015-10-16 13:35:56 +0000
@@ -35,7 +35,6 @@
35 } else {35 } else {
36 console.error("Contact preview requested but ContactListPage not loaded")36 console.error("Contact preview requested but ContactListPage not loaded")
37 }37 }
38 mainStack.quitOnDepth = 1
39 }38 }
4039
41 function create(phoneNumber)40 function create(phoneNumber)
@@ -99,28 +98,19 @@
99 }98 }
100 }99 }
101100
102 width: units.gu(40)101 width: units.gu(90)
103 height: units.gu(71)102 height: units.gu(71)
104 anchorToKeyboard: false103 anchorToKeyboard: false
105104
106 PageStack {105 AdaptivePageLayout {
107 id: mainStack106 id: mainStack
108107
108 primaryPage: contactPage
109 property var contactListPage: null109 property var contactListPage: null
110 property int quitOnDepth: -1
111110
112 function resetStack()111 function resetStack()
113 {112 {
114 while(depth > 1) {113 mainStack.removePages(primaryPage);
115 pop()
116 }
117 }
118
119 onDepthChanged: {
120 if (depth === quitOnDepth) {
121 quitOnDepth = -1
122 application.goBackToSourceApp()
123 }
124 }114 }
125115
126 onContactListPageChanged: {116 onContactListPageChanged: {
@@ -134,11 +124,14 @@
134 anchors.fill: parent124 anchors.fill: parent
135 }125 }
136126
127 ABContactListPage {
128 id: contactPage
129 }
130
137 Component.onCompleted: {131 Component.onCompleted: {
138 application.elapsed()132 application.elapsed()
139 i18n.domain = "address-book-app"133 i18n.domain = "address-book-app"
140 i18n.bindtextdomain("address-book-app", i18nDirectory)134 i18n.bindtextdomain("address-book-app", i18nDirectory)
141 mainStack.push(Qt.resolvedUrl("ABContactListPage.qml"))
142 mainWindow.applicationReady()135 mainWindow.applicationReady()
143 }136 }
144137
@@ -184,7 +177,6 @@
184 // If application was called from uri handler and lost the focus reset the app to normal state177 // If application was called from uri handler and lost the focus reset the app to normal state
185 onAppActiveChanged: {178 onAppActiveChanged: {
186 if (!appActive && mainStack.contactListPage) {179 if (!appActive && mainStack.contactListPage) {
187 mainStack.quitOnDepth = -1
188 mainStack.contactListPage.returnToNormalState()180 mainStack.contactListPage.returnToNormalState()
189 }181 }
190 }182 }
191183
=== modified file 'src/imports/Settings/SettingsPage.qml'
--- src/imports/Settings/SettingsPage.qml 2015-10-16 13:35:56 +0000
+++ src/imports/Settings/SettingsPage.qml 2015-10-16 13:35:56 +0000
@@ -71,7 +71,7 @@
71 ListItem.Standard {71 ListItem.Standard {
72 text: i18n.tr("Import from SIM")72 text: i18n.tr("Import from SIM")
73 progression: true73 progression: true
74 onClicked: pageStack.push(simCardImportPageComponent)74 onClicked: pageStack.addPageToCurrentColumn(root, simCardImportPageComponent)
75 enabled: (simList.sims.length > 0) && (simList.present.length > 0)75 enabled: (simList.sims.length > 0) && (simList.present.length > 0)
76 }76 }
77 }77 }
7878
=== modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml'
--- src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2015-10-16 13:35:56 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2015-10-16 13:35:56 +0000
@@ -55,7 +55,7 @@
55 field.cancel()55 field.cancel()
56 }56 }
57 }57 }
58 pageStack.pop()58 pageStack.removePages(contactEditor)
59 }59 }
6060
61 function save() {61 function save() {
@@ -93,7 +93,7 @@
93 contactEditor.contactSaved(contact)93 contactEditor.contactSaved(contact)
94 }94 }
95 }95 }
96 pageStack.pop()96 pageStack.removePages(contactEditor)
97 }97 }
9898
99 function makeMeVisible(item) {99 function makeMeVisible(item) {
@@ -473,8 +473,7 @@
473 // WORKAROUND: SDK element crash if pop the page where the dialog was created473 // WORKAROUND: SDK element crash if pop the page where the dialog was created
474 Component.onDestruction: {474 Component.onDestruction: {
475 if (popPages) {475 if (popPages) {
476 contactEditor.pageStack.pop() // editor page476 contactEditor.pageStack.removePages(contactEditor)
477 contactEditor.pageStack.pop() // view page
478 }477 }
479 }478 }
480 }479 }
481480
=== modified file 'src/imports/Ubuntu/AddressBook/ContactShare/ContactSharePage.qml'
--- src/imports/Ubuntu/AddressBook/ContactShare/ContactSharePage.qml 2015-10-16 13:35:56 +0000
+++ src/imports/Ubuntu/AddressBook/ContactShare/ContactSharePage.qml 2015-10-16 13:35:56 +0000
@@ -48,13 +48,13 @@
48 if (exporter.activeTransfer) {48 if (exporter.activeTransfer) {
49 exporter.activeTransfer.state = ContentHub.ContentTransfer.Aborted49 exporter.activeTransfer.state = ContentHub.ContentTransfer.Aborted
50 }50 }
51 pageStack.pop()51 pageStack.removePages(root)
52 }52 }
53 }53 }
5454
55 ContactExporter {55 ContactExporter {
56 id: exporter56 id: exporter
5757
58 onDone: pageStack.pop()58 onDone: pageStack.removePages(root)
59 }59 }
60}60}
6161
=== modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml'
--- src/imports/Ubuntu/Contacts/ContactListView.qml 2015-10-16 13:35:56 +0000
+++ src/imports/Ubuntu/Contacts/ContactListView.qml 2015-10-16 13:35:56 +0000
@@ -466,10 +466,10 @@
466 visible: (typeof(pageStack) !== "undefined") &&466 visible: (typeof(pageStack) !== "undefined") &&
467 ((simList.sims.length > 0) && (simList.present.length > 0))467 ((simList.sims.length > 0) && (simList.present.length > 0))
468 onClicked: {468 onClicked: {
469 pageStack.push(Qt.resolvedUrl("SIMCardImportPage.qml"),469 pageStack.addPageToNextColumn(pageStack.primaryPage, Qt.resolvedUrl("SIMCardImportPage.qml"),
470 {"objectName": "simCardImportPage",470 {"objectName": "simCardImportPage",
471 "targetModel": view.listModel,471 "targetModel": view.listModel,
472 "sims": simList.sims})472 "sims": simList.sims})
473 }473 }
474 }474 }
475 }475 }
476476
=== modified file 'src/imports/Ubuntu/Contacts/ContactSimpleListView.qml'
--- src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2015-10-16 13:35:56 +0000
+++ src/imports/Ubuntu/Contacts/ContactSimpleListView.qml 2015-10-16 13:35:56 +0000
@@ -260,7 +260,8 @@
260260
261 flicking: contactListView.flicking261 flicking: contactListView.flicking
262 width: parent.width262 width: parent.width
263 selected: contactListView.multiSelectionEnabled && contactListView.isSelected(contactDelegate)263 selected: (contactListView.multiSelectionEnabled && contactListView.isSelected(contactDelegate))
264 || index === contactListView.currentIndex
264 selectionMode: contactListView.isInSelectionMode265 selectionMode: contactListView.isInSelectionMode
265 defaultAvatarUrl: contactListView.defaultAvatarImageUrl266 defaultAvatarUrl: contactListView.defaultAvatarImageUrl
266 isCurrentItem: ListView.isCurrentItem267 isCurrentItem: ListView.isCurrentItem
267268
=== modified file 'src/imports/Ubuntu/Contacts/ListItemWithActions.qml'
--- src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2015-10-16 13:35:56 +0000
+++ src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2015-10-16 13:35:56 +0000
@@ -164,7 +164,7 @@
164 states: [164 states: [
165 State {165 State {
166 name: "select"166 name: "select"
167 when: selectionMode || selected167 when: selectionMode
168 PropertyChanges {168 PropertyChanges {
169 target: selectionIcon169 target: selectionIcon
170 source: Qt.resolvedUrl("ListItemWithActionsCheckBox.qml")170 source: Qt.resolvedUrl("ListItemWithActionsCheckBox.qml")
171171
=== modified file 'src/imports/Ubuntu/Contacts/PageWithBottomEdge.qml'
--- src/imports/Ubuntu/Contacts/PageWithBottomEdge.qml 2015-10-16 13:35:56 +0000
+++ src/imports/Ubuntu/Contacts/PageWithBottomEdge.qml 2015-10-16 13:35:56 +0000
@@ -103,7 +103,7 @@
103 {103 {
104 if (edgeLoader.status === Loader.Ready) {104 if (edgeLoader.status === Loader.Ready) {
105 edgeLoader.item.active = true105 edgeLoader.item.active = true
106 page.pageStack.push(edgeLoader.item)106 page.pageStack.addPageToCurrentColumn(page, edgeLoader.item)
107 if (edgeLoader.item.flickable) {107 if (edgeLoader.item.flickable) {
108 edgeLoader.item.flickable.contentY = -page.header.height108 edgeLoader.item.flickable.contentY = -page.header.height
109 edgeLoader.item.flickable.returnToBounds()109 edgeLoader.item.flickable.returnToBounds()
110110
=== modified file 'src/imports/Ubuntu/Contacts/SIMCardImportPage.qml'
--- src/imports/Ubuntu/Contacts/SIMCardImportPage.qml 2015-10-16 13:35:56 +0000
+++ src/imports/Ubuntu/Contacts/SIMCardImportPage.qml 2015-10-16 13:35:56 +0000
@@ -100,7 +100,7 @@
100 showBusyIndicator: false100 showBusyIndicator: false
101101
102 manager: "memory"102 manager: "memory"
103 onSelectionCanceled: pageStack.pop()103 onSelectionCanceled: pageStack.removePages(root)
104 }104 }
105105
106 Label {106 Label {
@@ -167,7 +167,7 @@
167 if ((error === ContactModel.ExportNoError) && targetModel) {167 if ((error === ContactModel.ExportNoError) && targetModel) {
168 targetModel.importContacts(url)168 targetModel.importContacts(url)
169 }169 }
170 pageStack.pop()170 pageStack.removePages(root)
171 }171 }
172 }172 }
173173

Subscribers

People subscribed via source and target branches