Merge lp:~renatofilho/address-book-app/focus-improvements into lp:address-book-app
- focus-improvements
- Merge into trunk
Status: | Approved |
---|---|
Approved by: | Tiago Salem Herrmann |
Approved revision: | 678 |
Proposed branch: | lp:~renatofilho/address-book-app/focus-improvements |
Merge into: | lp:address-book-app |
Diff against target: |
498 lines (+196/-131) 9 files modified
src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailOnlineAccountsEditor.qml (+9/-5) src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml (+18/-4) src/imports/Ubuntu/AddressBook/ContactView/ContactDetailOnlineAccountsView.qml (+3/-1) src/imports/Ubuntu/AddressBook/ContactView/ContactViewPage.qml (+3/-0) src/imports/Ubuntu/Contacts/ContactDelegate.qml (+3/-0) src/imports/Ubuntu/Contacts/ContactDetailOnlineAccountTypeModel.qml (+5/-3) src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml (+13/-3) src/imports/Ubuntu/Contacts/ContactListView.qml (+141/-114) src/imports/Ubuntu/Contacts/MultipleSelectionListView.qml (+1/-1) |
To merge this branch: | bzr merge lp:~renatofilho/address-book-app/focus-improvements |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tiago Salem Herrmann (community) | Approve | ||
system-apps-ci-bot | continuous-integration | Needs Fixing | |
Review via email: mp+315310@code.launchpad.net |
Commit message
Fixed focus feedback visual.
Use UbuntuListiView to make use of theme colors.
Allow to overwrite ContactViewPage leadingActions
Description of the change
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
- 676. By Renato Araujo Oliveira Filho
-
Allow create IRC accounts.
- 677. By Renato Araujo Oliveira Filho
-
Allow user to add a provider on online accounts.
- 678. By Renato Araujo Oliveira Filho
-
Does not show provider as a individual field.
User should fill account alias with <user>@<server> to correct match on messaging app.
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:678
https:/
Executed test runs:
Click here to trigger a rebuild:
https:/
Tiago Salem Herrmann (tiagosh) wrote : | # |
looks good to me.
Unmerged revisions
- 678. By Renato Araujo Oliveira Filho
-
Does not show provider as a individual field.
User should fill account alias with <user>@<server> to correct match on messaging app.
- 677. By Renato Araujo Oliveira Filho
-
Allow user to add a provider on online accounts.
- 676. By Renato Araujo Oliveira Filho
-
Allow create IRC accounts.
- 675. By Renato Araujo Oliveira Filho
-
Allow to overwrite ContactViewPage leadingActions
- 674. By Renato Araujo Oliveira Filho
-
Use UbuntuListiView to make use of theme colors.
- 673. By Renato Araujo Oliveira Filho
-
Fixed foocus feedback visual.
Preview Diff
1 | === modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailOnlineAccountsEditor.qml' | |||
2 | --- src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailOnlineAccountsEditor.qml 2015-10-26 13:18:11 +0000 | |||
3 | +++ src/imports/Ubuntu/AddressBook/ContactEditor/ContactDetailOnlineAccountsEditor.qml 2017-02-24 13:55:25 +0000 | |||
4 | @@ -19,12 +19,16 @@ | |||
5 | 19 | 19 | ||
6 | 20 | import Ubuntu.Contacts 0.1 | 20 | import Ubuntu.Contacts 0.1 |
7 | 21 | 21 | ||
10 | 22 | ContactDetailGroupWithTypeEditor { | 22 | ContactDetailGroupWithTypeEditor { |
11 | 23 | title: i18n.dtr("address-book-app", "IM") | 23 | title: i18n.dtr("address-book-app", "Social") |
12 | 24 | detailQmlTypeName: "OnlineAccount" | ||
13 | 24 | detailType: ContactDetail.OnlineAccount | 25 | detailType: ContactDetail.OnlineAccount |
17 | 25 | detailQmlTypeName: "OnlineAccount" | 26 | fields: [ |
18 | 26 | fields: [ OnlineAccount.AccountUri ] | 27 | OnlineAccount.AccountUri |
19 | 27 | placeholderTexts: [ i18n.dtr("address-book-app", "Enter a social alias") ] | 28 | ] |
20 | 29 | placeholderTexts: [ | ||
21 | 30 | i18n.dtr("address-book-app", "Enter an alias"), | ||
22 | 31 | ] | ||
23 | 28 | typeModel: ContactDetailOnlineAccountTypeModel { } | 32 | typeModel: ContactDetailOnlineAccountTypeModel { } |
24 | 29 | inputMethodHints: Qt.ImhEmailCharactersOnly | 33 | inputMethodHints: Qt.ImhEmailCharactersOnly |
25 | 30 | } | 34 | } |
26 | 31 | 35 | ||
27 | === modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml' | |||
28 | --- src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2016-09-23 12:35:41 +0000 | |||
29 | +++ src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2017-02-24 13:55:25 +0000 | |||
30 | @@ -152,7 +152,10 @@ | |||
31 | 152 | switch (contactEditor.initialFocusSection) | 152 | switch (contactEditor.initialFocusSection) |
32 | 153 | { | 153 | { |
33 | 154 | case "phones": | 154 | case "phones": |
35 | 155 | contactEditor.focusToLastPhoneField() | 155 | contactEditor.focusToLastField(phonesEditor) |
36 | 156 | break; | ||
37 | 157 | case "ims": | ||
38 | 158 | contactEditor.focusToLastField(accountsEditor) | ||
39 | 156 | break; | 159 | break; |
40 | 157 | case "name": | 160 | case "name": |
41 | 158 | default: | 161 | default: |
42 | @@ -161,10 +164,13 @@ | |||
43 | 161 | } | 164 | } |
44 | 162 | } | 165 | } |
45 | 163 | 166 | ||
47 | 164 | function focusToLastPhoneField() | 167 | function focusToLastField(editor) |
48 | 165 | { | 168 | { |
51 | 166 | var lastPhoneField = phonesEditor.detailDelegates[phonesEditor.detailDelegates.length - 2].item | 169 | var lastField = editor.detailDelegates[editor.detailDelegates.length - 2].item |
52 | 167 | lastPhoneField.forceActiveFocus() | 170 | if (lastField.repeater.count > 0) |
53 | 171 | lastField.repeater.itemAt(0).forceActiveFocus() | ||
54 | 172 | else | ||
55 | 173 | lastField.forceActiveFocus() | ||
56 | 168 | } | 174 | } |
57 | 169 | 175 | ||
58 | 170 | function focusToFirstEntry(field) | 176 | function focusToFirstEntry(field) |
59 | @@ -498,6 +504,14 @@ | |||
60 | 498 | } | 504 | } |
61 | 499 | } | 505 | } |
62 | 500 | 506 | ||
63 | 507 | onEnabledChanged: { | ||
64 | 508 | if (!active || !enabled) { | ||
65 | 509 | return | ||
66 | 510 | } | ||
67 | 511 | |||
68 | 512 | focusTimer.restart() | ||
69 | 513 | } | ||
70 | 514 | |||
71 | 501 | onActiveChanged: { | 515 | onActiveChanged: { |
72 | 502 | if (!active || !enabled) { | 516 | if (!active || !enabled) { |
73 | 503 | return | 517 | return |
74 | 504 | 518 | ||
75 | === modified file 'src/imports/Ubuntu/AddressBook/ContactView/ContactDetailOnlineAccountsView.qml' | |||
76 | --- src/imports/Ubuntu/AddressBook/ContactView/ContactDetailOnlineAccountsView.qml 2015-10-26 13:18:11 +0000 | |||
77 | +++ src/imports/Ubuntu/AddressBook/ContactView/ContactDetailOnlineAccountsView.qml 2017-02-24 13:55:25 +0000 | |||
78 | @@ -22,7 +22,9 @@ | |||
79 | 22 | 22 | ||
80 | 23 | ContactDetailGroupWithTypeView { | 23 | ContactDetailGroupWithTypeView { |
81 | 24 | detailType: QtContacts.ContactDetail.OnlineAccount | 24 | detailType: QtContacts.ContactDetail.OnlineAccount |
83 | 25 | fields: [ QtContacts.OnlineAccount.AccountUri ] | 25 | fields: [ |
84 | 26 | QtContacts.OnlineAccount.AccountUri | ||
85 | 27 | ] | ||
86 | 26 | title: i18n.dtr("address-book-app", "Social") | 28 | title: i18n.dtr("address-book-app", "Social") |
87 | 27 | typeModel: ContactDetailOnlineAccountTypeModel { } | 29 | typeModel: ContactDetailOnlineAccountTypeModel { } |
88 | 28 | defaultAction: Action { | 30 | defaultAction: Action { |
89 | 29 | 31 | ||
90 | === modified file 'src/imports/Ubuntu/AddressBook/ContactView/ContactViewPage.qml' | |||
91 | --- src/imports/Ubuntu/AddressBook/ContactView/ContactViewPage.qml 2016-09-23 12:35:41 +0000 | |||
92 | +++ src/imports/Ubuntu/AddressBook/ContactView/ContactViewPage.qml 2017-02-24 13:55:25 +0000 | |||
93 | @@ -30,6 +30,7 @@ | |||
94 | 30 | property alias model: contactFetch.model | 30 | property alias model: contactFetch.model |
95 | 31 | property alias editable: contactDetailAvatar.editable | 31 | property alias editable: contactDetailAvatar.editable |
96 | 32 | property alias headerActions: trailingBar.actions | 32 | property alias headerActions: trailingBar.actions |
97 | 33 | property list<Action> leadingActions | ||
98 | 33 | 34 | ||
99 | 34 | signal contactFetched(QtObject contact) | 35 | signal contactFetched(QtObject contact) |
100 | 35 | signal contactRemoved() | 36 | signal contactRemoved() |
101 | @@ -50,6 +51,8 @@ | |||
102 | 50 | trailingActionBar { | 51 | trailingActionBar { |
103 | 51 | id: trailingBar | 52 | id: trailingBar |
104 | 52 | } | 53 | } |
105 | 54 | |||
106 | 55 | leadingActionBar.actions: root.leadingActions | ||
107 | 53 | } | 56 | } |
108 | 54 | 57 | ||
109 | 55 | Connections { | 58 | Connections { |
110 | 56 | 59 | ||
111 | === modified file 'src/imports/Ubuntu/Contacts/ContactDelegate.qml' | |||
112 | --- src/imports/Ubuntu/Contacts/ContactDelegate.qml 2016-02-05 16:07:45 +0000 | |||
113 | +++ src/imports/Ubuntu/Contacts/ContactDelegate.qml 2017-02-24 13:55:25 +0000 | |||
114 | @@ -43,6 +43,9 @@ | |||
115 | 43 | } | 43 | } |
116 | 44 | } | 44 | } |
117 | 45 | 45 | ||
118 | 46 | Keys.onEnterPressed: root.clicked(index, contact) | ||
119 | 47 | Keys.onReturnPressed: root.clicked(index, contact) | ||
120 | 48 | |||
121 | 46 | Item { | 49 | Item { |
122 | 47 | id: delegate | 50 | id: delegate |
123 | 48 | 51 | ||
124 | 49 | 52 | ||
125 | === modified file 'src/imports/Ubuntu/Contacts/ContactDetailOnlineAccountTypeModel.qml' | |||
126 | --- src/imports/Ubuntu/Contacts/ContactDetailOnlineAccountTypeModel.qml 2015-10-26 13:18:11 +0000 | |||
127 | +++ src/imports/Ubuntu/Contacts/ContactDetailOnlineAccountTypeModel.qml 2017-02-24 13:55:25 +0000 | |||
128 | @@ -29,6 +29,8 @@ | |||
129 | 29 | return 0; | 29 | return 0; |
130 | 30 | case 2: | 30 | case 2: |
131 | 31 | return 1; | 31 | return 1; |
132 | 32 | case 3: | ||
133 | 33 | return 6; | ||
134 | 32 | case 4: | 34 | case 4: |
135 | 33 | return 2; | 35 | return 2; |
136 | 34 | case 5: | 36 | case 5: |
137 | @@ -59,14 +61,14 @@ | |||
138 | 59 | Component.onCompleted: { | 61 | Component.onCompleted: { |
139 | 60 | //append({"value": 0, "label": i18n.dtr("address-book-app", "Other"), icon: "artwork:/protocol-other.svg"}) | 62 | //append({"value": 0, "label": i18n.dtr("address-book-app", "Other"), icon: "artwork:/protocol-other.svg"}) |
140 | 61 | /*0*/ // TRANSLATORS: This refers to the AIM chat network http://en.wikipedia.org/wiki/AOL_Instant_Messenger | 63 | /*0*/ // TRANSLATORS: This refers to the AIM chat network http://en.wikipedia.org/wiki/AOL_Instant_Messenger |
144 | 62 | append({"value": 1, "label": i18n.dtr("address-book-app", "Aim"), "icon": "artwork:/protocol-aim.svg"}) | 64 | /*0*/ append({"value": 1, "label": i18n.dtr("address-book-app", "Aim"), "icon": "artwork:/protocol-aim.svg"}) |
145 | 63 | /*1*/ append({"value": 2, "label": i18n.dtr("address-book-app", "ICQ"), "icon": "artwork:/protocol-icq.svg"}) | 65 | /*1*/ append({"value": 2, "label": i18n.dtr("address-book-app", "ICQ"), "icon": "artwork:/protocol-icq.svg"}) |
143 | 64 | //append({"value": 3, "label": i18n.dtr("address-book-app", "IRC"), icon: "artwork:/protocol-irc.svg"}) | ||
146 | 65 | /*2*/ append({"value": 4, "label": i18n.dtr("address-book-app", "Jabber"), "icon": "artwork:/protocol-jabber.svg"}) | 66 | /*2*/ append({"value": 4, "label": i18n.dtr("address-book-app", "Jabber"), "icon": "artwork:/protocol-jabber.svg"}) |
147 | 66 | /*3*/ append({"value": 5, "label": i18n.dtr("address-book-app", "MSN"), "icon": "artwork:/protocol-msn.svg"}) | 67 | /*3*/ append({"value": 5, "label": i18n.dtr("address-book-app", "MSN"), "icon": "artwork:/protocol-msn.svg"}) |
148 | 67 | // append({"value": 6, "label": i18n.dtr("address-book-app", "QQ"), icon: "artwork:/protocol-qq.svg"}) | 68 | // append({"value": 6, "label": i18n.dtr("address-book-app", "QQ"), icon: "artwork:/protocol-qq.svg"}) |
149 | 68 | /*4*/ append({"value": 7, "label": i18n.dtr("address-book-app", "Skype"), "icon": "artwork:/protocol-skype.svg"}) | 69 | /*4*/ append({"value": 7, "label": i18n.dtr("address-book-app", "Skype"), "icon": "artwork:/protocol-skype.svg"}) |
150 | 69 | /*5*/ append({"value": 8, "label": i18n.dtr("address-book-app", "Yahoo"), "icon": "artwork:/protocol-yahoo.svg"}) | 70 | /*5*/ append({"value": 8, "label": i18n.dtr("address-book-app", "Yahoo"), "icon": "artwork:/protocol-yahoo.svg"}) |
151 | 71 | /*6*/ append({"value": 3, "label": i18n.dtr("address-book-app", "IRC"), "icon": "artwork:/protocol-irc.svg"}) | ||
152 | 70 | loaded() | 72 | loaded() |
153 | 71 | } | 73 | } |
154 | 72 | } | 74 | } |
155 | 73 | 75 | ||
156 | === modified file 'src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml' | |||
157 | --- src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml 2016-09-23 13:47:49 +0000 | |||
158 | +++ src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml 2017-02-24 13:55:25 +0000 | |||
159 | @@ -17,9 +17,10 @@ | |||
160 | 17 | import QtQuick 2.4 | 17 | import QtQuick 2.4 |
161 | 18 | import Ubuntu.Components 1.3 | 18 | import Ubuntu.Components 1.3 |
162 | 19 | 19 | ||
164 | 20 | Item { | 20 | FocusScope { |
165 | 21 | id: root | 21 | id: root |
166 | 22 | 22 | ||
167 | 23 | readonly property bool _allowFocus: true | ||
168 | 23 | property string iconSource | 24 | property string iconSource |
169 | 24 | property alias labelText: name.text | 25 | property alias labelText: name.text |
170 | 25 | property bool expandIcon: false | 26 | property bool expandIcon: false |
171 | @@ -31,13 +32,21 @@ | |||
172 | 31 | right: parent.right | 32 | right: parent.right |
173 | 32 | } | 33 | } |
174 | 33 | height: visible ? units.gu(8) : 0 | 34 | height: visible ? units.gu(8) : 0 |
175 | 35 | activeFocusOnTab: true | ||
176 | 36 | |||
177 | 37 | Keys.onEnterPressed: clicked() | ||
178 | 38 | Keys.onReturnPressed: clicked() | ||
179 | 34 | 39 | ||
180 | 35 | Rectangle { | 40 | Rectangle { |
181 | 36 | anchors.fill: parent | 41 | anchors.fill: parent |
184 | 37 | color: Theme.palette.selected.background | 42 | border { |
185 | 38 | opacity: addNewContactButtonArea.pressed ? 1.0 : 0.0 | 43 | color: UbuntuColors.orange |
186 | 44 | width: parent.activeFocus ? 1 : 0 | ||
187 | 45 | } | ||
188 | 46 | color: addNewContactButtonArea.pressed ? Theme.palette.selected.background : "transparent" | ||
189 | 39 | } | 47 | } |
190 | 40 | 48 | ||
191 | 49 | |||
192 | 41 | UbuntuShape { | 50 | UbuntuShape { |
193 | 42 | id: uShape | 51 | id: uShape |
194 | 43 | 52 | ||
195 | @@ -77,6 +86,7 @@ | |||
196 | 77 | } | 86 | } |
197 | 78 | elide: Text.ElideRight | 87 | elide: Text.ElideRight |
198 | 79 | visible: root.showContents | 88 | visible: root.showContents |
199 | 89 | color: parent.activeFocus ? UbuntuColors.blue : UbuntuColors.darkGrey | ||
200 | 80 | } | 90 | } |
201 | 81 | 91 | ||
202 | 82 | MouseArea { | 92 | MouseArea { |
203 | 83 | 93 | ||
204 | === modified file 'src/imports/Ubuntu/Contacts/ContactListView.qml' | |||
205 | --- src/imports/Ubuntu/Contacts/ContactListView.qml 2016-12-12 18:54:08 +0000 | |||
206 | +++ src/imports/Ubuntu/Contacts/ContactListView.qml 2017-02-24 13:55:25 +0000 | |||
207 | @@ -444,129 +444,155 @@ | |||
208 | 444 | onTriggered: view.positionViewAtBeginning() | 444 | onTriggered: view.positionViewAtBeginning() |
209 | 445 | } | 445 | } |
210 | 446 | 446 | ||
212 | 447 | header: Column { | 447 | header: FocusScope { |
213 | 448 | anchors { | 448 | anchors { |
214 | 449 | left: parent.left | 449 | left: parent.left |
215 | 450 | right: parent.right | 450 | right: parent.right |
216 | 451 | } | 451 | } |
217 | 452 | 452 | ||
268 | 453 | // top margin | 453 | height: childrenRect.height |
219 | 454 | Item { | ||
220 | 455 | anchors { | ||
221 | 456 | left: parent.left | ||
222 | 457 | right: parent.right | ||
223 | 458 | } | ||
224 | 459 | height: units.gu(0.5) | ||
225 | 460 | } | ||
226 | 461 | |||
227 | 462 | Binding { | ||
228 | 463 | target: view | ||
229 | 464 | property: 'currentIndex' | ||
230 | 465 | value: -1 | ||
231 | 466 | when: root.showNewContact | ||
232 | 467 | } | ||
233 | 468 | |||
234 | 469 | // AddNewButton | ||
235 | 470 | ContactListButtonDelegate { | ||
236 | 471 | anchors { | ||
237 | 472 | left: parent.left | ||
238 | 473 | right: parent.right | ||
239 | 474 | margins: units.gu(1) | ||
240 | 475 | } | ||
241 | 476 | objectName: "addNewButton" | ||
242 | 477 | |||
243 | 478 | iconSource: "image://theme/add" | ||
244 | 479 | // TRANSLATORS: this refers to a new contact | ||
245 | 480 | labelText: i18n.dtr("address-book-app", "+ Create New") | ||
246 | 481 | onClicked: root.addNewContactClicked() | ||
247 | 482 | visible: root.showAddNewButton | ||
248 | 483 | } | ||
249 | 484 | |||
250 | 485 | ContactDelegate { | ||
251 | 486 | property var contact: Contact { | ||
252 | 487 | Name { | ||
253 | 488 | firstName: i18n.tr("New contact") | ||
254 | 489 | } | ||
255 | 490 | Avatar { | ||
256 | 491 | imageUrl: "image://theme/contact" | ||
257 | 492 | } | ||
258 | 493 | } | ||
259 | 494 | selected: pageStack.hasKeyboard | ||
260 | 495 | visible: root.showNewContact | ||
261 | 496 | height: root.showNewContact ? defaultHeight : 0 | ||
262 | 497 | onHeightChanged: { | ||
263 | 498 | if (visible) | ||
264 | 499 | view.positionViewAtBeginning() | ||
265 | 500 | } | ||
266 | 501 | Behavior on height {UbuntuNumberAnimation {}} | ||
267 | 502 | } | ||
269 | 503 | 454 | ||
270 | 504 | Column { | 455 | Column { |
271 | 505 | id: importFromButtons | ||
272 | 506 | objectName: "importFromButtons" | ||
273 | 507 | |||
274 | 508 | readonly property bool isSearching: (root.filterTerm && root.filterTerm !== "") | ||
275 | 509 | |||
276 | 510 | anchors { | 456 | anchors { |
277 | 511 | left: parent.left | 457 | left: parent.left |
278 | 512 | right: parent.right | 458 | right: parent.right |
336 | 513 | margins: units.gu(1) | 459 | } |
337 | 514 | } | 460 | |
338 | 515 | height: visible ? childrenRect.height : 0 | 461 | height: childrenRect.height |
339 | 516 | 462 | onActiveFocusChanged: { | |
340 | 517 | visible: root.showImportOptions && | 463 | if (activeFocus) { |
341 | 518 | !indicator.visible && | 464 | for(var i = 0; i < children.length; i++) { |
342 | 519 | (root.count === 0) && | 465 | if (children[i].enabled) { |
343 | 520 | !view.favouritesIsSelected && | 466 | children[i].forceActiveFocus() |
344 | 521 | !isSearching | 467 | break |
345 | 522 | 468 | } | |
346 | 523 | // avoid show the button while the list still loading contacts | 469 | } |
347 | 524 | Behavior on visible { | 470 | } |
348 | 525 | SequentialAnimation { | 471 | } |
349 | 526 | PauseAnimation { | 472 | |
350 | 527 | duration: !importFromButtons.visible ? 500 : 0 | 473 | // top margin |
351 | 528 | } | 474 | Item { |
352 | 529 | PropertyAction { | 475 | objectName: "Marging" |
353 | 530 | target: importFromButtons | 476 | anchors { |
354 | 531 | property: "visible" | 477 | left: parent.left |
355 | 532 | } | 478 | right: parent.right |
356 | 533 | } | 479 | } |
357 | 534 | } | 480 | height: units.gu(0.5) |
358 | 535 | 481 | enabled: false | |
359 | 536 | // Import from google | 482 | } |
360 | 537 | ContactListButtonDelegate { | 483 | |
361 | 538 | id: importFromGoogleButton | 484 | Binding { |
362 | 539 | objectName: "%1.importFromOnlineAccountButton".arg(root.objectName) | 485 | target: view |
363 | 540 | 486 | property: 'currentIndex' | |
364 | 541 | visible: (onlineAccountHelper.status === Loader.Ready) | 487 | value: -1 |
365 | 542 | expandIcon: true | 488 | when: root.showNewContact |
366 | 543 | iconSource: "image://theme/google" | 489 | } |
367 | 544 | labelText: i18n.dtr("address-book-app", "Import contacts from Google") | 490 | |
368 | 545 | onClicked: root.createOnlineAccount(false) | 491 | // AddNewButton |
369 | 546 | } | 492 | ContactListButtonDelegate { |
370 | 547 | 493 | anchors { | |
371 | 548 | // Import from sim card | 494 | left: parent.left |
372 | 549 | ContactListButtonDelegate { | 495 | right: parent.right |
373 | 550 | id: importFromSimCard | 496 | margins: units.gu(1) |
374 | 551 | objectName: "%1.importFromSimCardButton".arg(root.objectName) | 497 | } |
375 | 552 | 498 | ||
376 | 553 | expandIcon: true | 499 | objectName: "addNewButton" |
377 | 554 | iconSource: "image://theme/import" | 500 | |
378 | 555 | labelText: i18n.dtr("address-book-app", "Import contacts from SIM card") | 501 | iconSource: "image://theme/add" |
379 | 556 | // Does not show the button if the list is not in a pageStack | 502 | // TRANSLATORS: this refers to a new contact |
380 | 557 | visible: (typeof(pageStack) !== "undefined") && | 503 | labelText: i18n.dtr("address-book-app", "+ Create New") |
381 | 558 | ((simList.sims.length > 0) && (simList.present.length > 0)) | 504 | onClicked: root.addNewContactClicked() |
382 | 559 | onClicked: { | 505 | visible: root.showAddNewButton |
383 | 560 | if (pageStack.addPageToNextColumn) | 506 | focus: visible |
384 | 561 | pageStack.addPageToNextColumn(pageStack.primaryPage, Qt.resolvedUrl("SIMCardImportPage.qml"), | 507 | } |
385 | 562 | {"objectName": "simCardImportPage", | 508 | |
386 | 563 | "targetModel": view.listModel, | 509 | ContactDelegate { |
387 | 564 | "sims": simList.sims}) | 510 | property var contact: Contact { |
388 | 565 | else | 511 | Name { |
389 | 566 | pageStack.push(Qt.resolvedUrl("SIMCardImportPage.qml"), | 512 | firstName: i18n.tr("New contact") |
390 | 567 | {"objectName": "simCardImportPage", | 513 | } |
391 | 568 | "targetModel": view.listModel, | 514 | Avatar { |
392 | 569 | "sims": simList.sims}) | 515 | imageUrl: "image://theme/contact" |
393 | 516 | } | ||
394 | 517 | } | ||
395 | 518 | activeFocusOnTab: false | ||
396 | 519 | selected: pageStack.hasKeyboard | ||
397 | 520 | visible: root.showNewContact | ||
398 | 521 | height: root.showNewContact ? defaultHeight : 0 | ||
399 | 522 | onHeightChanged: { | ||
400 | 523 | if (visible) | ||
401 | 524 | view.positionViewAtBeginning() | ||
402 | 525 | } | ||
403 | 526 | Behavior on height {UbuntuNumberAnimation {}} | ||
404 | 527 | } | ||
405 | 528 | |||
406 | 529 | Column { | ||
407 | 530 | id: importFromButtons | ||
408 | 531 | objectName: "importFromButtons" | ||
409 | 532 | |||
410 | 533 | readonly property bool isSearching: (root.filterTerm && root.filterTerm !== "") | ||
411 | 534 | |||
412 | 535 | anchors { | ||
413 | 536 | left: parent.left | ||
414 | 537 | right: parent.right | ||
415 | 538 | margins: units.gu(1) | ||
416 | 539 | } | ||
417 | 540 | height: visible ? childrenRect.height : 0 | ||
418 | 541 | |||
419 | 542 | visible: root.showImportOptions && | ||
420 | 543 | !indicator.visible && | ||
421 | 544 | (root.count === 0) && | ||
422 | 545 | !view.favouritesIsSelected && | ||
423 | 546 | !isSearching | ||
424 | 547 | |||
425 | 548 | // avoid show the button while the list still loading contacts | ||
426 | 549 | Behavior on visible { | ||
427 | 550 | SequentialAnimation { | ||
428 | 551 | PauseAnimation { | ||
429 | 552 | duration: !importFromButtons.visible ? 500 : 0 | ||
430 | 553 | } | ||
431 | 554 | PropertyAction { | ||
432 | 555 | target: importFromButtons | ||
433 | 556 | property: "visible" | ||
434 | 557 | } | ||
435 | 558 | } | ||
436 | 559 | } | ||
437 | 560 | |||
438 | 561 | // Import from google | ||
439 | 562 | ContactListButtonDelegate { | ||
440 | 563 | id: importFromGoogleButton | ||
441 | 564 | objectName: "%1.importFromOnlineAccountButton".arg(root.objectName) | ||
442 | 565 | |||
443 | 566 | visible: (onlineAccountHelper.status === Loader.Ready) | ||
444 | 567 | expandIcon: true | ||
445 | 568 | iconSource: "image://theme/google" | ||
446 | 569 | labelText: i18n.dtr("address-book-app", "Import contacts from Google") | ||
447 | 570 | onClicked: root.createOnlineAccount(false) | ||
448 | 571 | } | ||
449 | 572 | |||
450 | 573 | // Import from sim card | ||
451 | 574 | ContactListButtonDelegate { | ||
452 | 575 | id: importFromSimCard | ||
453 | 576 | objectName: "%1.importFromSimCardButton".arg(root.objectName) | ||
454 | 577 | |||
455 | 578 | expandIcon: true | ||
456 | 579 | iconSource: "image://theme/import" | ||
457 | 580 | labelText: i18n.dtr("address-book-app", "Import contacts from SIM card") | ||
458 | 581 | // Does not show the button if the list is not in a pageStack | ||
459 | 582 | visible: (typeof(pageStack) !== "undefined") && | ||
460 | 583 | ((simList.sims.length > 0) && (simList.present.length > 0)) | ||
461 | 584 | onClicked: { | ||
462 | 585 | if (pageStack.addPageToNextColumn) | ||
463 | 586 | pageStack.addPageToNextColumn(pageStack.primaryPage, Qt.resolvedUrl("SIMCardImportPage.qml"), | ||
464 | 587 | {"objectName": "simCardImportPage", | ||
465 | 588 | "targetModel": view.listModel, | ||
466 | 589 | "sims": simList.sims}) | ||
467 | 590 | else | ||
468 | 591 | pageStack.push(Qt.resolvedUrl("SIMCardImportPage.qml"), | ||
469 | 592 | {"objectName": "simCardImportPage", | ||
470 | 593 | "targetModel": view.listModel, | ||
471 | 594 | "sims": simList.sims}) | ||
472 | 595 | } | ||
473 | 570 | } | 596 | } |
474 | 571 | } | 597 | } |
475 | 572 | } | 598 | } |
476 | @@ -696,7 +722,8 @@ | |||
477 | 696 | //WORKAROUND: SDK does not allow us to disable focus for items due bug: #1514822 | 722 | //WORKAROUND: SDK does not allow us to disable focus for items due bug: #1514822 |
478 | 697 | //because of that we need this | 723 | //because of that we need this |
479 | 698 | if (view.currentIndex == 0) { | 724 | if (view.currentIndex == 0) { |
481 | 699 | pageStack._nextItemInFocusChain(view, false) | 725 | view.currentIndex = -1 |
482 | 726 | view.headerItem.forceActiveFocus() | ||
483 | 700 | } else { | 727 | } else { |
484 | 701 | view.currentIndex -= 1 | 728 | view.currentIndex -= 1 |
485 | 702 | } | 729 | } |
486 | 703 | 730 | ||
487 | === modified file 'src/imports/Ubuntu/Contacts/MultipleSelectionListView.qml' | |||
488 | --- src/imports/Ubuntu/Contacts/MultipleSelectionListView.qml 2015-11-10 19:51:19 +0000 | |||
489 | +++ src/imports/Ubuntu/Contacts/MultipleSelectionListView.qml 2017-02-24 13:55:25 +0000 | |||
490 | @@ -55,7 +55,7 @@ | |||
491 | 55 | \endqml | 55 | \endqml |
492 | 56 | */ | 56 | */ |
493 | 57 | 57 | ||
495 | 58 | ListView { | 58 | UbuntuListView { |
496 | 59 | id: listView | 59 | id: listView |
497 | 60 | 60 | ||
498 | 61 | /*! | 61 | /*! |
FAILED: Continuous integration, rev:675 /jenkins. canonical. com/system- apps/job/ lp-address- book-app- ci/56/ /jenkins. canonical. com/system- apps/job/ build/2280/ console /jenkins. canonical. com/system- apps/job/ build-0- fetch/2283/ console
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/system- apps/job/ lp-address- book-app- ci/56/rebuild
https:/