Merge lp:~renatofilho/address-book-app/fix-1207773 into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 78
Merged at revision: 83
Proposed branch: lp:~renatofilho/address-book-app/fix-1207773
Merge into: lp:address-book-app
Diff against target: 326 lines (+115/-31)
11 files modified
src/imports/Common/ContactDetailGroupBase.qml (+15/-22)
src/imports/ContactEdit/CMakeLists.txt (+1/-0)
src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml (+4/-1)
src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml (+34/-0)
src/imports/ContactEdit/ContactDetailWithTypeEditor.qml (+3/-6)
src/imports/ContactEdit/ContactEditor.qml (+10/-0)
src/imports/ContactEdit/ValueSelector.qml (+1/-1)
src/imports/ContactView/BasicFieldView.qml (+2/-1)
src/imports/ContactView/CMakeLists.txt (+1/-0)
src/imports/ContactView/ContactDetailOrganizationsView.qml (+35/-0)
src/imports/ContactView/ContactView.qml (+9/-0)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/fix-1207773
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Bill Filler (community) Approve
Review via email: mp+185956@code.launchpad.net

Commit message

Added basic organization detail support.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

If I create a new contact and try to scroll to professional details I can't move it up enough to select the "+" button as it stays partially obscured by the Cancel/Save buttons. There needs to be more padding on the bottom so I can select it.

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

the autofocus of fields works only when you create a new contact. But if you edit a contact and press any "+" button it makes the keyboad disappear

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

approved

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

Merged mainline.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/imports/Common/ContactDetailGroupBase.qml'
2--- src/imports/Common/ContactDetailGroupBase.qml 2013-09-11 23:45:59 +0000
3+++ src/imports/Common/ContactDetailGroupBase.qml 2013-09-27 11:32:50 +0000
4@@ -24,6 +24,7 @@
5 readonly property variant details: contact && contact.contactDetails && detailType ? contact.details(detailType) : []
6 readonly property alias detailDelegates: contents.children
7
8+ property variant inputFields: []
9 property QtObject contact: null
10 property int detailType: 0
11 property variant fields
12@@ -33,6 +34,8 @@
13 property int minimumHeight: 0
14 property bool loaded: false
15
16+ signal newFieldAdded(var index)
17+
18 implicitHeight: root.details.length > 0 ? contents.height : minimumHeight
19 visible: implicitHeight > 0
20
21@@ -46,7 +49,6 @@
22 onValuesChanged: {
23 if (!values) {
24 clear()
25- root.loaded = false
26 return
27 }
28
29@@ -55,7 +57,6 @@
30 }
31
32 var modelCount = count
33-
34 for(var i=0; i < values.length; i++) {
35 if (modelCount < i) {
36 append({"detail": values[i]})
37@@ -63,10 +64,6 @@
38 set(i, {"detail": values[i]})
39 }
40 }
41-
42- if (!root.loaded) {
43- loadTimer.restart()
44- }
45 }
46 }
47
48@@ -97,25 +94,21 @@
49 property: "detail"
50 value: root.details[index]
51 }
52- }
53-
54- onItemAdded: {
55- if (root.loaded) {
56- item.forceActiveFocus()
57+ onStatusChanged: {
58+ if (status === Loader.Ready) {
59+ var newFields = root.inputFields
60+ newFields.push(detailItem.item)
61+ root.newFieldAdded(detailItem.item)
62+ root.inputFields = newFields
63+ if (item.focus && root.loaded) {
64+ console.debug("force focus" + item + "has focus:" + item.focus)
65+ item.forceActiveFocus()
66+ }
67+ }
68 }
69 }
70-
71 }
72 }
73
74- // This timer will help to avoid fields get focus during the page creation
75- // At the first time that the page is loaded the timer will start and all
76- // subsequent details added before the timeout would not receive focus,
77- // after the timeout the new fields will receive focus as default
78- Timer {
79- id: loadTimer
80-
81- interval: 500
82- onTriggered: root.loaded = true
83- }
84+ Component.onCompleted: root.loaded = true
85 }
86
87=== modified file 'src/imports/ContactEdit/CMakeLists.txt'
88--- src/imports/ContactEdit/CMakeLists.txt 2013-09-23 20:30:17 +0000
89+++ src/imports/ContactEdit/CMakeLists.txt 2013-09-27 11:32:50 +0000
90@@ -5,6 +5,7 @@
91 ContactDetailGroupWithTypeEditor.qml
92 ContactDetailNameEditor.qml
93 ContactDetailOnlineAccountsEditor.qml
94+ ContactDetailOrganizationsEditor.qml
95 ContactDetailPhoneNumbersEditor.qml
96 ContactDetailWithTypeEditor.qml
97 ContactEditor.qml
98
99=== modified file 'src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml'
100--- src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2013-09-26 21:57:38 +0000
101+++ src/imports/ContactEdit/ContactDetailGroupWithTypeEditor.qml 2013-09-27 11:32:50 +0000
102@@ -102,7 +102,6 @@
103 MouseArea {
104 anchors.fill: parent
105 onClicked: {
106- root.forceActiveFocus()
107 if (detailQmlTypeName) {
108 var newDetail = Qt.createQmlObject("import QtContacts 5.0; " + detailQmlTypeName + "{}", root)
109 if (newDetail) {
110@@ -128,6 +127,10 @@
111 return;
112 }
113
114+ if (!root.typeModel) {
115+ return;
116+ }
117+
118 comboLoaded = true
119 var newTypes = []
120 for(var i=0; i < root.typeModel.count; i++) {
121
122=== added file 'src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml'
123--- src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml 1970-01-01 00:00:00 +0000
124+++ src/imports/ContactEdit/ContactDetailOrganizationsEditor.qml 2013-09-27 11:32:50 +0000
125@@ -0,0 +1,34 @@
126+/*
127+ * Copyright (C) 2012-2013 Canonical, Ltd.
128+ *
129+ * This program is free software; you can redistribute it and/or modify
130+ * it under the terms of the GNU General Public License as published by
131+ * the Free Software Foundation; version 3.
132+ *
133+ * This program is distributed in the hope that it will be useful,
134+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
135+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
136+ * GNU General Public License for more details.
137+ *
138+ * You should have received a copy of the GNU General Public License
139+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
140+ */
141+
142+import QtQuick 2.0
143+import QtContacts 5.0 as QtContacts
144+
145+import "../Common"
146+
147+ContactDetailGroupWithTypeEditor {
148+ title: i18n.tr("Professional details")
149+ typeModel: null
150+ detailQmlTypeName: "Organization"
151+ detailType: QtContacts.ContactDetail.Organization
152+ fields: [ QtContacts.Organization.Name,
153+ QtContacts.Organization.Role,
154+ QtContacts.Organization.Title ]
155+ placeholderTexts: [ i18n.tr("Organization"),
156+ i18n.tr("Role"),
157+ i18n.tr("Title")
158+ ]
159+}
160
161=== modified file 'src/imports/ContactEdit/ContactDetailWithTypeEditor.qml'
162--- src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2013-09-26 22:31:43 +0000
163+++ src/imports/ContactEdit/ContactDetailWithTypeEditor.qml 2013-09-27 11:32:50 +0000
164@@ -66,8 +66,8 @@
165 return detailchanged
166 }
167
168+ focus: true
169 // disable listview mouse area
170- focus: true
171 __mouseArea.visible: false
172
173 implicitHeight: detailTypeSelector.height + fieldValues.height + units.gu(2)
174@@ -75,6 +75,7 @@
175 ValueSelector {
176 id: detailTypeSelector
177
178+ visible: (currentIndex != -1)
179 active: root.active
180 anchors {
181 left: parent.left
182@@ -111,11 +112,7 @@
183 focus: true
184 TextInputDetail {
185 id: detail
186- Component.onCompleted: {
187- if (index == 0) {
188- focus = true
189- }
190- }
191+ Component.onCompleted: focus = (index === 0)
192 focus: false
193 detail: root.detail
194 field: modelData
195
196=== modified file 'src/imports/ContactEdit/ContactEditor.qml'
197--- src/imports/ContactEdit/ContactEditor.qml 2013-09-24 18:41:28 +0000
198+++ src/imports/ContactEdit/ContactEditor.qml 2013-09-27 11:32:50 +0000
199@@ -170,6 +170,7 @@
200 right: parent.right
201 top: parent.top
202 bottom: toolbar.top
203+ bottomMargin: units.gu(2)
204 }
205 contentHeight: contents.height
206 contentWidth: parent.width
207@@ -246,6 +247,15 @@
208 }
209 height: implicitHeight
210 }
211+
212+ ContactDetailOrganizationsEditor {
213+ contact: contactEditor.contact
214+ anchors {
215+ left: parent.left
216+ right: parent.right
217+ }
218+ height: implicitHeight
219+ }
220 }
221 }
222
223
224=== modified file 'src/imports/ContactEdit/ValueSelector.qml'
225--- src/imports/ContactEdit/ValueSelector.qml 2013-09-27 00:44:01 +0000
226+++ src/imports/ContactEdit/ValueSelector.qml 2013-09-27 11:32:50 +0000
227@@ -78,7 +78,7 @@
228 }
229 width: contentWidth
230
231- text: root.values[root.currentIndex]
232+ text: root.currentIndex >= 0 ? root.values[root.currentIndex] : ""
233
234 // style
235 fontSize: root.active ? "medium" : "small"
236
237=== modified file 'src/imports/ContactView/BasicFieldView.qml'
238--- src/imports/ContactView/BasicFieldView.qml 2013-09-12 23:28:36 +0000
239+++ src/imports/ContactView/BasicFieldView.qml 2013-09-27 11:32:50 +0000
240@@ -44,13 +44,14 @@
241 Label {
242 id: typeLabel
243
244+ visible: text != ""
245 anchors {
246 left: actionIcon.right
247 leftMargin: actionIcon.visible ? units.gu(1) : 0
248 top: parent.top
249 topMargin: units.gu(1)
250 }
251- height: units.gu(2)
252+ height: visible ? units.gu(2) : 0
253 verticalAlignment: Text.AlignVCenter
254
255 // style
256
257=== modified file 'src/imports/ContactView/CMakeLists.txt'
258--- src/imports/ContactView/CMakeLists.txt 2013-07-16 21:13:34 +0000
259+++ src/imports/ContactView/CMakeLists.txt 2013-09-27 11:32:50 +0000
260@@ -8,6 +8,7 @@
261 ContactDetailGroupWithTypeView.qml
262 ContactDetailNameView.qml
263 ContactDetailOnlineAccountsView.qml
264+ ContactDetailOrganizationsView.qml
265 ContactDetailPhoneNumbersView.qml
266 ContactDetailPhoneNumberView.qml
267 ContactDetailWithTypeView.qml
268
269=== added file 'src/imports/ContactView/ContactDetailOrganizationsView.qml'
270--- src/imports/ContactView/ContactDetailOrganizationsView.qml 1970-01-01 00:00:00 +0000
271+++ src/imports/ContactView/ContactDetailOrganizationsView.qml 2013-09-27 11:32:50 +0000
272@@ -0,0 +1,35 @@
273+/*
274+ * Copyright (C) 2012-2013 Canonical, Ltd.
275+ *
276+ * This program is free software; you can redistribute it and/or modify
277+ * it under the terms of the GNU General Public License as published by
278+ * the Free Software Foundation; version 3.
279+ *
280+ * This program is distributed in the hope that it will be useful,
281+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
282+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
283+ * GNU General Public License for more details.
284+ *
285+ * You should have received a copy of the GNU General Public License
286+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
287+ */
288+
289+import QtQuick 2.0
290+import QtContacts 5.0 as QtContacts
291+import Ubuntu.Components 0.1
292+import Ubuntu.Contacts 0.1
293+
294+//import "../Common"
295+
296+ContactDetailGroupWithTypeView {
297+ id: root
298+
299+ title: i18n.tr("Professional details")
300+ defaultIcon: "artwork:/contact-location.png"
301+ detailType: QtContacts.ContactDetail.Organization
302+ typeModel: null
303+
304+ fields: [ QtContacts.Organization.Name,
305+ QtContacts.Organization.Role,
306+ QtContacts.Organization.Title ]
307+}
308
309=== modified file 'src/imports/ContactView/ContactView.qml'
310--- src/imports/ContactView/ContactView.qml 2013-09-11 22:39:52 +0000
311+++ src/imports/ContactView/ContactView.qml 2013-09-27 11:32:50 +0000
312@@ -117,6 +117,15 @@
313 height: implicitHeight
314 }
315
316+ ContactDetailOrganizationsView {
317+ contact: root.contact
318+ anchors {
319+ left: parent.left
320+ right: parent.right
321+ }
322+ height: implicitHeight
323+ }
324+
325 }
326 }
327

Subscribers

People subscribed via source and target branches