Merge lp:~tpeeters/gallery-app/toolbarItems into lp:gallery-app
- toolbarItems
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Günter Schwann |
Approved revision: | 736 |
Merged at revision: | 737 |
Proposed branch: | lp:~tpeeters/gallery-app/toolbarItems |
Merge into: | lp:gallery-app |
Diff against target: |
627 lines (+154/-115) 18 files modified
rc/qml/AlbumEditor.qml (+8/-8) rc/qml/AlbumViewer.qml (+16/-9) rc/qml/AlbumsOverview.qml (+20/-15) rc/qml/MediaSelector.qml (+17/-18) rc/qml/MediaViewer/MediaViewer.qml (+44/-26) rc/qml/PhotosOverview.qml (+2/-2) rc/qml/Utility/OrganicEventView.qml (+2/-2) rc/qml/Utility/PhotosToolbarActions.qml (+7/-4) rc/qml/Utility/SelectionToolbarAction.qml (+14/-11) tests/autopilot/gallery_app/emulators/album_view.py (+1/-1) tests/autopilot/gallery_app/emulators/albums_view.py (+1/-1) tests/autopilot/gallery_app/emulators/events_view.py (+3/-3) tests/autopilot/gallery_app/emulators/gallery_utils.py (+9/-6) tests/autopilot/gallery_app/emulators/media_selector.py (+2/-1) tests/autopilot/gallery_app/emulators/photo_viewer.py (+3/-3) tests/autopilot/gallery_app/emulators/photos_view.py (+2/-2) tests/autopilot/gallery_app/tests/test_album_editor.py (+2/-2) tests/autopilot/gallery_app/tests/test_photo_viewer.py (+1/-1) |
To merge this branch: | bzr merge lp:~tpeeters/gallery-app/toolbarItems |
Related bugs: | |
Related blueprints: |
Unified Action API in the Ubunt UI toolkit
(Undefined)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Günter Schwann (community) | Approve | ||
Tim Peeters (community) | Approve | ||
Review via email: mp+170115@code.launchpad.net |
Commit message
Use new toolbar API
Description of the change
Use new toolbar API
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:734
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
Tim Peeters (tpeeters) wrote : | # |
Changes are now in UITK trunk, see https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:734
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:734
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:735
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
Click here to trigger a rebuild:
http://
Günter Schwann (schwann) wrote : | # |
This is needed to fix it:
=== modified file 'rc/qml/
--- rc/qml/
+++ rc/qml/
@@ -457,7 +457,7 @@
}
}
- property ToolbarActions videoToolbar: ToolbarItems {
+ property Item videoToolbar: ToolbarItems {
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:736
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:736
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'rc/qml/AlbumEditor.qml' | |||
2 | --- rc/qml/AlbumEditor.qml 2013-05-15 11:16:42 +0000 | |||
3 | +++ rc/qml/AlbumEditor.qml 2013-06-19 18:46:28 +0000 | |||
4 | @@ -34,14 +34,14 @@ | |||
5 | 34 | objectName: "mainAlbumEditor" | 34 | objectName: "mainAlbumEditor" |
6 | 35 | 35 | ||
7 | 36 | title: "Edit album" | 36 | title: "Edit album" |
16 | 37 | tools: ToolbarActions { | 37 | tools: ToolbarItems { |
17 | 38 | back: Action { | 38 | back: Button { |
18 | 39 | itemHint: Button { | 39 | objectName: "cancelButton" |
19 | 40 | text: i18n.tr("Cancel") | 40 | anchors.verticalCenter: parent.verticalCenter |
20 | 41 | width: units.gu(10) | 41 | text: i18n.tr("Cancel") |
21 | 42 | onClicked: { | 42 | width: units.gu(10) |
22 | 43 | albumEditor.closeRequested(albumEditor.album, false); | 43 | onClicked: { |
23 | 44 | } | 44 | albumEditor.closeRequested(albumEditor.album, false); |
24 | 45 | } | 45 | } |
25 | 46 | } | 46 | } |
26 | 47 | } | 47 | } |
27 | 48 | 48 | ||
28 | === modified file 'rc/qml/AlbumViewer.qml' | |||
29 | --- rc/qml/AlbumViewer.qml 2013-04-12 14:19:20 +0000 | |||
30 | +++ rc/qml/AlbumViewer.qml 2013-06-19 18:46:28 +0000 | |||
31 | @@ -461,15 +461,20 @@ | |||
32 | 461 | } | 461 | } |
33 | 462 | 462 | ||
34 | 463 | /// Contains the actions for the toolbar in the album view | 463 | /// Contains the actions for the toolbar in the album view |
41 | 464 | tools: ToolbarActions { | 464 | tools: ToolbarItems { |
42 | 465 | Action { | 465 | ToolbarButton { |
43 | 466 | text: i18n.tr("Add") | 466 | objectName: "addButton" |
44 | 467 | iconSource: Qt.resolvedUrl("../img/add.png") | 467 | action: Action { |
45 | 468 | onTriggered: { | 468 | text: i18n.tr("Add to album") // text in HUD |
46 | 469 | loader_mediaSelector.show() | 469 | iconSource: Qt.resolvedUrl("../img/add.png") |
47 | 470 | onTriggered: { | ||
48 | 471 | loader_mediaSelector.show() | ||
49 | 472 | } | ||
50 | 470 | } | 473 | } |
51 | 474 | text: i18n.tr("Add") // text in toolbar | ||
52 | 471 | } | 475 | } |
54 | 472 | Action { | 476 | ToolbarButton { |
55 | 477 | objectName: "deleteButton" | ||
56 | 473 | text: i18n.tr("Delete") | 478 | text: i18n.tr("Delete") |
57 | 474 | iconSource: Qt.resolvedUrl("../img/delete.png") | 479 | iconSource: Qt.resolvedUrl("../img/delete.png") |
58 | 475 | onTriggered: { | 480 | onTriggered: { |
59 | @@ -479,13 +484,15 @@ | |||
60 | 479 | } | 484 | } |
61 | 480 | enabled: false // FIXME enable once the close animation is not shown anymore | 485 | enabled: false // FIXME enable once the close animation is not shown anymore |
62 | 481 | } | 486 | } |
64 | 482 | Action { | 487 | ToolbarButton { |
65 | 488 | objectName: "shareButton" | ||
66 | 483 | text: i18n.tr("Share") | 489 | text: i18n.tr("Share") |
67 | 484 | iconSource: Qt.resolvedUrl("../img/share.png") | 490 | iconSource: Qt.resolvedUrl("../img/share.png") |
68 | 485 | enabled: false | 491 | enabled: false |
69 | 486 | } | 492 | } |
71 | 487 | back: Action { | 493 | back: ToolbarButton { |
72 | 488 | text: i18n.tr("Back") | 494 | text: i18n.tr("Back") |
73 | 495 | objectName: "backButton" | ||
74 | 489 | iconSource: Qt.resolvedUrl("../img/back.png") | 496 | iconSource: Qt.resolvedUrl("../img/back.png") |
75 | 490 | onTriggered: { | 497 | onTriggered: { |
76 | 491 | __close() | 498 | __close() |
77 | 492 | 499 | ||
78 | === modified file 'rc/qml/AlbumsOverview.qml' | |||
79 | --- rc/qml/AlbumsOverview.qml 2013-04-12 14:19:20 +0000 | |||
80 | +++ rc/qml/AlbumsOverview.qml 2013-06-19 18:46:28 +0000 | |||
81 | @@ -28,9 +28,6 @@ | |||
82 | 28 | Checkerboard { | 28 | Checkerboard { |
83 | 29 | id: root | 29 | id: root |
84 | 30 | 30 | ||
85 | 31 | /// Contains the actions for the toolbar in the albums tab | ||
86 | 32 | tools: albumOverviewTools | ||
87 | 33 | |||
88 | 34 | /*! | 31 | /*! |
89 | 35 | */ | 32 | */ |
90 | 36 | function getRectOfAlbumPreview(album, relativeTo) { | 33 | function getRectOfAlbumPreview(album, relativeTo) { |
91 | @@ -171,21 +168,29 @@ | |||
92 | 171 | visible: false | 168 | visible: false |
93 | 172 | } | 169 | } |
94 | 173 | 170 | ||
96 | 174 | ToolbarActions { | 171 | /// Contains the actions for the toolbar in the albums tab |
97 | 172 | tools: ToolbarItems { | ||
98 | 175 | id: albumOverviewTools | 173 | id: albumOverviewTools |
105 | 176 | Action { | 174 | ToolbarButton { |
106 | 177 | text: i18n.tr("Add") | 175 | objectName: "addButton" |
107 | 178 | iconSource: Qt.resolvedUrl("../img/add.png") | 176 | action: Action { |
108 | 179 | onTriggered: { | 177 | text: i18n.tr("Add new album") // Text in HUD |
109 | 180 | var album = albumCollectionModel.createOrphan(); | 178 | iconSource: Qt.resolvedUrl("../img/add.png") |
110 | 181 | albumCollectionModel.addOrphan(album); | 179 | onTriggered: { |
111 | 180 | var album = albumCollectionModel.createOrphan(); | ||
112 | 181 | albumCollectionModel.addOrphan(album); | ||
113 | 182 | } | ||
114 | 182 | } | 183 | } |
115 | 184 | text: "Add" // text in toolbar | ||
116 | 183 | } | 185 | } |
122 | 184 | Action { | 186 | ToolbarButton { |
123 | 185 | text: i18n.tr("Camera") | 187 | objectName: "cameraButton" |
124 | 186 | iconSource: Qt.resolvedUrl("../img/camera.png") | 188 | action: Action { |
125 | 187 | onTriggered: { | 189 | text: i18n.tr("Camera") |
126 | 188 | appManager.switchToCameraApplication(); | 190 | iconSource: Qt.resolvedUrl("../img/camera.png") |
127 | 191 | onTriggered: { | ||
128 | 192 | appManager.switchToCameraApplication(); | ||
129 | 193 | } | ||
130 | 189 | } | 194 | } |
131 | 190 | } | 195 | } |
132 | 191 | } | 196 | } |
133 | 192 | 197 | ||
134 | === modified file 'rc/qml/MediaSelector.qml' | |||
135 | --- rc/qml/MediaSelector.qml 2013-05-03 21:13:37 +0000 | |||
136 | +++ rc/qml/MediaSelector.qml 2013-06-19 18:46:28 +0000 | |||
137 | @@ -52,7 +52,6 @@ | |||
138 | 52 | active = false; | 52 | active = false; |
139 | 53 | } | 53 | } |
140 | 54 | 54 | ||
141 | 55 | tools: toolActions | ||
142 | 56 | title: i18n.tr("Add to Album") | 55 | title: i18n.tr("Add to Album") |
143 | 57 | active: false | 56 | active: false |
144 | 58 | visible: false | 57 | visible: false |
145 | @@ -76,26 +75,26 @@ | |||
146 | 76 | selection: mediaSelector.selection | 75 | selection: mediaSelector.selection |
147 | 77 | } | 76 | } |
148 | 78 | 77 | ||
159 | 79 | property ToolbarActions toolActions: ToolbarActions { | 78 | tools: ToolbarItems { |
160 | 80 | Action { | 79 | Button { |
161 | 81 | itemHint: Button { | 80 | anchors.verticalCenter: parent.verticalCenter |
162 | 82 | text: i18n.tr("Add to Album") | 81 | text: i18n.tr("Add to Album") |
163 | 83 | color: Gallery.HIGHLIGHT_BUTTON_COLOR | 82 | objectName: "addButton" |
164 | 84 | width: units.gu(16) | 83 | color: Gallery.HIGHLIGHT_BUTTON_COLOR |
165 | 85 | onClicked: { | 84 | width: units.gu(16) |
166 | 86 | mediaSelector.addClicked(); | 85 | onTriggered: { |
167 | 87 | mediaSelector.hide(); | 86 | mediaSelector.addClicked(); |
168 | 88 | } | 87 | mediaSelector.hide(); |
169 | 89 | } | 88 | } |
170 | 90 | } | 89 | } |
171 | 91 | 90 | ||
179 | 92 | back: Action { | 91 | back: Button { |
180 | 93 | itemHint: Button { | 92 | anchors.verticalCenter: parent.verticalCenter |
181 | 94 | text: i18n.tr("Cancel") | 93 | text: i18n.tr("Cancel") |
182 | 95 | width: units.gu(10) | 94 | objectName: "cancelButton" |
183 | 96 | onClicked: { | 95 | width: units.gu(10) |
184 | 97 | mediaSelector.hide(); | 96 | onClicked: { |
185 | 98 | } | 97 | mediaSelector.hide(); |
186 | 99 | } | 98 | } |
187 | 100 | } | 99 | } |
188 | 101 | opened: true | 100 | opened: true |
189 | 102 | 101 | ||
190 | === modified file 'rc/qml/MediaViewer/MediaViewer.qml' | |||
191 | --- rc/qml/MediaViewer/MediaViewer.qml 2013-06-18 13:30:59 +0000 | |||
192 | +++ rc/qml/MediaViewer/MediaViewer.qml 2013-06-19 18:46:28 +0000 | |||
193 | @@ -62,7 +62,7 @@ | |||
194 | 62 | (galleryPhotoViewer.currentItem ? galleryPhotoViewer.currentItem.isLoaded : false) | 62 | (galleryPhotoViewer.currentItem ? galleryPhotoViewer.currentItem.isLoaded : false) |
195 | 63 | 63 | ||
196 | 64 | // tooolbar actions for the full view | 64 | // tooolbar actions for the full view |
198 | 65 | property ToolbarActions tools: media ? (media.type === MediaSource.Photo ? | 65 | property Item tools: media ? (media.type === MediaSource.Photo ? |
199 | 66 | d.photoToolbar : d.videoToolbar) | 66 | d.photoToolbar : d.videoToolbar) |
200 | 67 | : null | 67 | : null |
201 | 68 | 68 | ||
202 | @@ -402,38 +402,52 @@ | |||
203 | 402 | Item { | 402 | Item { |
204 | 403 | id: d | 403 | id: d |
205 | 404 | 404 | ||
208 | 405 | property ToolbarActions photoToolbar: ToolbarActions { | 405 | property Item photoToolbar: ToolbarItems { |
209 | 406 | Action { | 406 | ToolbarButton { |
210 | 407 | objectName: "editButton" | ||
211 | 407 | text: i18n.tr("Edit") | 408 | text: i18n.tr("Edit") |
212 | 408 | iconSource: "../../img/edit.png" | 409 | iconSource: "../../img/edit.png" |
213 | 409 | onTriggered: { | 410 | onTriggered: { |
214 | 410 | PopupUtils.open(editPopoverComponent, caller); | 411 | PopupUtils.open(editPopoverComponent, caller); |
215 | 411 | } | 412 | } |
216 | 412 | } | 413 | } |
218 | 413 | Action { | 414 | ToolbarButton { |
219 | 415 | objectName: "addButton" | ||
220 | 416 | action: Action { | ||
221 | 417 | text: i18n.tr("Add photo to album") | ||
222 | 418 | iconSource: "../../img/add.png" | ||
223 | 419 | onTriggered: { | ||
224 | 420 | popupAlbumPicker.caller = caller; | ||
225 | 421 | popupAlbumPicker.show(); | ||
226 | 422 | } | ||
227 | 423 | } | ||
228 | 414 | text: i18n.tr("Add") | 424 | text: i18n.tr("Add") |
233 | 415 | iconSource: "../../img/add.png" | 425 | } |
234 | 416 | onTriggered: { | 426 | ToolbarButton { |
235 | 417 | popupAlbumPicker.caller = caller; | 427 | objectName: "deleteButton" |
236 | 418 | popupAlbumPicker.show(); | 428 | action: Action { |
237 | 429 | text: i18n.tr("Delete") | ||
238 | 430 | iconSource: "../../img/delete.png" | ||
239 | 431 | onTriggered: { | ||
240 | 432 | PopupUtils.open(deleteDialog, null); | ||
241 | 433 | } | ||
242 | 419 | } | 434 | } |
243 | 420 | } | ||
244 | 421 | Action { | ||
245 | 422 | text: i18n.tr("Delete") | 435 | text: i18n.tr("Delete") |
249 | 423 | iconSource: "../../img/delete.png" | 436 | } |
250 | 424 | onTriggered: { | 437 | ToolbarButton { |
251 | 425 | PopupUtils.open(deleteDialog, null); | 438 | objectName: "shareButton" |
252 | 439 | action: Action { | ||
253 | 440 | text: i18n.tr("Share photo") | ||
254 | 441 | iconSource: "../../img/share.png" | ||
255 | 442 | onTriggered: { | ||
256 | 443 | PopupUtils.open(sharePopoverComponent, caller); | ||
257 | 444 | } | ||
258 | 426 | } | 445 | } |
259 | 427 | } | ||
260 | 428 | Action { | ||
261 | 429 | text: i18n.tr("Share") | 446 | text: i18n.tr("Share") |
262 | 430 | iconSource: "../../img/share.png" | ||
263 | 431 | onTriggered: { | ||
264 | 432 | PopupUtils.open(sharePopoverComponent, caller); | ||
265 | 433 | } | ||
266 | 434 | } | 447 | } |
267 | 435 | 448 | ||
269 | 436 | back: Action { | 449 | back: ToolbarButton { |
270 | 450 | objectName: "backButton" | ||
271 | 437 | text: i18n.tr("Back") | 451 | text: i18n.tr("Back") |
272 | 438 | iconSource: "../../img/back.png" | 452 | iconSource: "../../img/back.png" |
273 | 439 | onTriggered: { | 453 | onTriggered: { |
274 | @@ -443,8 +457,8 @@ | |||
275 | 443 | } | 457 | } |
276 | 444 | } | 458 | } |
277 | 445 | 459 | ||
280 | 446 | property ToolbarActions videoToolbar: ToolbarActions { | 460 | property Item videoToolbar: ToolbarItems { |
281 | 447 | Action { | 461 | ToolbarButton { |
282 | 448 | text: galleryPhotoViewer.currentItem ? | 462 | text: galleryPhotoViewer.currentItem ? |
283 | 449 | (galleryPhotoViewer.currentItem.isPlayingVideo ? | 463 | (galleryPhotoViewer.currentItem.isPlayingVideo ? |
284 | 450 | i18n.tr("Pause") : i18n.tr("Play")) | 464 | i18n.tr("Pause") : i18n.tr("Play")) |
285 | @@ -457,7 +471,8 @@ | |||
286 | 457 | galleryPhotoViewer.currentItem.togglePlayPause(); | 471 | galleryPhotoViewer.currentItem.togglePlayPause(); |
287 | 458 | } | 472 | } |
288 | 459 | } | 473 | } |
290 | 460 | Action { | 474 | ToolbarButton { |
291 | 475 | objectName: "addButton" | ||
292 | 461 | text: i18n.tr("Add") | 476 | text: i18n.tr("Add") |
293 | 462 | iconSource: "../../img/add.png" | 477 | iconSource: "../../img/add.png" |
294 | 463 | onTriggered: { | 478 | onTriggered: { |
295 | @@ -465,14 +480,16 @@ | |||
296 | 465 | popupAlbumPicker.show(); | 480 | popupAlbumPicker.show(); |
297 | 466 | } | 481 | } |
298 | 467 | } | 482 | } |
300 | 468 | Action { | 483 | ToolbarButton { |
301 | 484 | objectName: "deleteButton" | ||
302 | 469 | text: i18n.tr("Delete") | 485 | text: i18n.tr("Delete") |
303 | 470 | iconSource: "../../img/delete.png" | 486 | iconSource: "../../img/delete.png" |
304 | 471 | onTriggered: { | 487 | onTriggered: { |
305 | 472 | PopupUtils.open(deleteDialog, null); | 488 | PopupUtils.open(deleteDialog, null); |
306 | 473 | } | 489 | } |
307 | 474 | } | 490 | } |
309 | 475 | Action { | 491 | ToolbarButton { |
310 | 492 | objectName: "shareButton" | ||
311 | 476 | text: i18n.tr("Share") | 493 | text: i18n.tr("Share") |
312 | 477 | iconSource: "../../img/share.png" | 494 | iconSource: "../../img/share.png" |
313 | 478 | onTriggered: { | 495 | onTriggered: { |
314 | @@ -480,7 +497,8 @@ | |||
315 | 480 | } | 497 | } |
316 | 481 | } | 498 | } |
317 | 482 | 499 | ||
319 | 483 | back: Action { | 500 | back: ToolbarButton { |
320 | 501 | objectName: "backButton" | ||
321 | 484 | text: i18n.tr("Back") | 502 | text: i18n.tr("Back") |
322 | 485 | iconSource: "../../img/back.png" | 503 | iconSource: "../../img/back.png" |
323 | 486 | onTriggered: { | 504 | onTriggered: { |
324 | 487 | 505 | ||
325 | === modified file 'rc/qml/PhotosOverview.qml' | |||
326 | --- rc/qml/PhotosOverview.qml 2013-06-14 12:18:29 +0000 | |||
327 | +++ rc/qml/PhotosOverview.qml 2013-06-19 18:46:28 +0000 | |||
328 | @@ -178,7 +178,7 @@ | |||
329 | 178 | model: d.model | 178 | model: d.model |
330 | 179 | } | 179 | } |
331 | 180 | 180 | ||
333 | 181 | property ToolbarActions overviewTools: PhotosToolbarActions { | 181 | property Item overviewTools: PhotosToolbarActions { |
334 | 182 | selection: d.selection | 182 | selection: d.selection |
335 | 183 | onStartCamera: appManager.switchToCameraApplication(); | 183 | onStartCamera: appManager.switchToCameraApplication(); |
336 | 184 | } | 184 | } |
337 | @@ -187,7 +187,7 @@ | |||
338 | 187 | id: appManager | 187 | id: appManager |
339 | 188 | } | 188 | } |
340 | 189 | 189 | ||
342 | 190 | property ToolbarActions selectionTools: SelectionToolbarAction { | 190 | property Item selectionTools: SelectionToolbarAction { |
343 | 191 | selection: d.selection | 191 | selection: d.selection |
344 | 192 | 192 | ||
345 | 193 | onCancelClicked: { | 193 | onCancelClicked: { |
346 | 194 | 194 | ||
347 | === modified file 'rc/qml/Utility/OrganicEventView.qml' | |||
348 | --- rc/qml/Utility/OrganicEventView.qml 2013-06-14 12:18:29 +0000 | |||
349 | +++ rc/qml/Utility/OrganicEventView.qml 2013-06-19 18:46:28 +0000 | |||
350 | @@ -96,7 +96,7 @@ | |||
351 | 96 | } | 96 | } |
352 | 97 | } | 97 | } |
353 | 98 | 98 | ||
355 | 99 | property ToolbarActions overviewTools: PhotosToolbarActions { | 99 | property Item overviewTools: PhotosToolbarActions { |
356 | 100 | selection: organicEventView.selection | 100 | selection: organicEventView.selection |
357 | 101 | onStartCamera: appManager.switchToCameraApplication(); | 101 | onStartCamera: appManager.switchToCameraApplication(); |
358 | 102 | } | 102 | } |
359 | @@ -105,7 +105,7 @@ | |||
360 | 105 | id: appManager | 105 | id: appManager |
361 | 106 | } | 106 | } |
362 | 107 | 107 | ||
364 | 108 | property ToolbarActions selectionTools: SelectionToolbarAction { | 108 | property Item selectionTools: SelectionToolbarAction { |
365 | 109 | selection: organicEventView.selection | 109 | selection: organicEventView.selection |
366 | 110 | 110 | ||
367 | 111 | onCancelClicked: { | 111 | onCancelClicked: { |
368 | 112 | 112 | ||
369 | === modified file 'rc/qml/Utility/PhotosToolbarActions.qml' | |||
370 | --- rc/qml/Utility/PhotosToolbarActions.qml 2013-04-12 14:19:20 +0000 | |||
371 | +++ rc/qml/Utility/PhotosToolbarActions.qml 2013-06-19 18:46:28 +0000 | |||
372 | @@ -20,7 +20,7 @@ | |||
373 | 20 | /*! | 20 | /*! |
374 | 21 | The actions for the toolbar for the event and photos view | 21 | The actions for the toolbar for the event and photos view |
375 | 22 | */ | 22 | */ |
377 | 23 | ToolbarActions { | 23 | ToolbarItems { |
378 | 24 | id: root | 24 | id: root |
379 | 25 | /// The selection state item to use for enable / disable the select mode | 25 | /// The selection state item to use for enable / disable the select mode |
380 | 26 | property SelectionState selection: null | 26 | property SelectionState selection: null |
381 | @@ -28,18 +28,21 @@ | |||
382 | 28 | /// Emittedt when the camera action was triggered | 28 | /// Emittedt when the camera action was triggered |
383 | 29 | signal startCamera() | 29 | signal startCamera() |
384 | 30 | 30 | ||
386 | 31 | Action { | 31 | ToolbarButton { |
387 | 32 | objectName: "selectButton" | ||
388 | 32 | text: i18n.tr("Select") | 33 | text: i18n.tr("Select") |
389 | 33 | iconSource: Qt.resolvedUrl("../../img/select.png") | 34 | iconSource: Qt.resolvedUrl("../../img/select.png") |
390 | 34 | enabled: root.selection !== null | 35 | enabled: root.selection !== null |
391 | 35 | onTriggered: root.selection.inSelectionMode = true; | 36 | onTriggered: root.selection.inSelectionMode = true; |
392 | 36 | } | 37 | } |
394 | 37 | Action { | 38 | ToolbarButton { |
395 | 39 | objectName: "importButton" | ||
396 | 38 | text: i18n.tr("Import") | 40 | text: i18n.tr("Import") |
397 | 39 | iconSource: Qt.resolvedUrl("../../img/import-image.png") | 41 | iconSource: Qt.resolvedUrl("../../img/import-image.png") |
398 | 40 | enabled: false | 42 | enabled: false |
399 | 41 | } | 43 | } |
401 | 42 | Action { | 44 | ToolbarButton { |
402 | 45 | objectName: "cameraButton" | ||
403 | 43 | text: i18n.tr("Camera") | 46 | text: i18n.tr("Camera") |
404 | 44 | iconSource: Qt.resolvedUrl("../../img/camera.png") | 47 | iconSource: Qt.resolvedUrl("../../img/camera.png") |
405 | 45 | onTriggered: root.startCamera(); | 48 | onTriggered: root.startCamera(); |
406 | 46 | 49 | ||
407 | === modified file 'rc/qml/Utility/SelectionToolbarAction.qml' | |||
408 | --- rc/qml/Utility/SelectionToolbarAction.qml 2013-05-15 09:29:25 +0000 | |||
409 | +++ rc/qml/Utility/SelectionToolbarAction.qml 2013-06-19 18:46:28 +0000 | |||
410 | @@ -21,7 +21,7 @@ | |||
411 | 21 | /*! | 21 | /*! |
412 | 22 | The actions for the toolbar for the event and photos view in select mode | 22 | The actions for the toolbar for the event and photos view in select mode |
413 | 23 | */ | 23 | */ |
415 | 24 | ToolbarActions { | 24 | ToolbarItems { |
416 | 25 | id: root | 25 | id: root |
417 | 26 | /// The selection state item | 26 | /// The selection state item |
418 | 27 | property SelectionState selection: null | 27 | property SelectionState selection: null |
419 | @@ -38,31 +38,34 @@ | |||
420 | 38 | opened: true | 38 | opened: true |
421 | 39 | locked: true | 39 | locked: true |
422 | 40 | 40 | ||
424 | 41 | Action { | 41 | ToolbarButton { |
425 | 42 | objectName: "addButton" | ||
426 | 42 | text: i18n.tr("Add") | 43 | text: i18n.tr("Add") |
427 | 43 | iconSource: Qt.resolvedUrl("../../img/add.png") | 44 | iconSource: Qt.resolvedUrl("../../img/add.png") |
428 | 44 | enabled: root.selection.selectedCount > 0 | 45 | enabled: root.selection.selectedCount > 0 |
429 | 45 | onTriggered: root.addClicked(caller); | 46 | onTriggered: root.addClicked(caller); |
430 | 46 | } | 47 | } |
432 | 47 | Action { | 48 | ToolbarButton { |
433 | 49 | objectName: "deleteButton" | ||
434 | 48 | text: i18n.tr("Delete") | 50 | text: i18n.tr("Delete") |
435 | 49 | iconSource: Qt.resolvedUrl("../../img/delete.png") | 51 | iconSource: Qt.resolvedUrl("../../img/delete.png") |
436 | 50 | enabled: root.selection.selectedCount > 0 | 52 | enabled: root.selection.selectedCount > 0 |
437 | 51 | onTriggered:root.deleteClicked(); | 53 | onTriggered:root.deleteClicked(); |
438 | 52 | } | 54 | } |
440 | 53 | Action { | 55 | ToolbarButton { |
441 | 56 | objectName: "shareButton" | ||
442 | 54 | text: i18n.tr("Share") | 57 | text: i18n.tr("Share") |
443 | 55 | iconSource: Qt.resolvedUrl("../../img/share.png") | 58 | iconSource: Qt.resolvedUrl("../../img/share.png") |
444 | 56 | enabled: false | 59 | enabled: false |
445 | 57 | } | 60 | } |
446 | 58 | 61 | ||
454 | 59 | back: Action { | 62 | back: Button { |
455 | 60 | itemHint: Button { | 63 | objectName: "cancelButton" |
456 | 61 | text: i18n.tr("Cancel") | 64 | anchors.verticalCenter: parent.verticalCenter |
457 | 62 | width: units.gu(10) | 65 | text: i18n.tr("Cancel") |
458 | 63 | onClicked: { | 66 | width: units.gu(10) |
459 | 64 | root.cancelClicked(); | 67 | onClicked: { |
460 | 65 | } | 68 | root.cancelClicked(); |
461 | 66 | } | 69 | } |
462 | 67 | } | 70 | } |
463 | 68 | } | 71 | } |
464 | 69 | 72 | ||
465 | === modified file 'tests/autopilot/gallery_app/emulators/album_view.py' | |||
466 | --- tests/autopilot/gallery_app/emulators/album_view.py 2013-06-05 13:15:02 +0000 | |||
467 | +++ tests/autopilot/gallery_app/emulators/album_view.py 2013-06-19 18:46:28 +0000 | |||
468 | @@ -25,7 +25,7 @@ | |||
469 | 25 | 25 | ||
470 | 26 | def get_toolbar_add_button(self): | 26 | def get_toolbar_add_button(self): |
471 | 27 | """Returns the add button of the tollbar in the events view.""" | 27 | """Returns the add button of the tollbar in the events view.""" |
473 | 28 | return self.get_toolbar_button(0) | 28 | return self.get_toolbar_named_toolbarbutton("addButton") |
474 | 29 | 29 | ||
475 | 30 | def get_first_photo(self): | 30 | def get_first_photo(self): |
476 | 31 | """Returns the first photo in a newly opened album""" | 31 | """Returns the first photo in a newly opened album""" |
477 | 32 | 32 | ||
478 | === modified file 'tests/autopilot/gallery_app/emulators/albums_view.py' | |||
479 | --- tests/autopilot/gallery_app/emulators/albums_view.py 2013-04-10 15:31:33 +0000 | |||
480 | +++ tests/autopilot/gallery_app/emulators/albums_view.py 2013-06-19 18:46:28 +0000 | |||
481 | @@ -19,7 +19,7 @@ | |||
482 | 19 | 19 | ||
483 | 20 | def get_toolbar_add_button(self): | 20 | def get_toolbar_add_button(self): |
484 | 21 | """Returns the add button of the tollbar in the events view.""" | 21 | """Returns the add button of the tollbar in the events view.""" |
486 | 22 | return self.get_toolbar_button(0) | 22 | return self.get_toolbar_named_toolbarbutton("addButton") |
487 | 23 | 23 | ||
488 | 24 | def number_of_albums_in_albums_view(self): | 24 | def number_of_albums_in_albums_view(self): |
489 | 25 | """Returns the number of albums shown in albums overview""" | 25 | """Returns the number of albums shown in albums overview""" |
490 | 26 | 26 | ||
491 | === modified file 'tests/autopilot/gallery_app/emulators/events_view.py' | |||
492 | --- tests/autopilot/gallery_app/emulators/events_view.py 2013-04-10 15:31:33 +0000 | |||
493 | +++ tests/autopilot/gallery_app/emulators/events_view.py 2013-06-19 18:46:28 +0000 | |||
494 | @@ -17,15 +17,15 @@ | |||
495 | 17 | 17 | ||
496 | 18 | def get_toolbar_camera_button(self): | 18 | def get_toolbar_camera_button(self): |
497 | 19 | """Returns the camera button of the toolbar in the event view""" | 19 | """Returns the camera button of the toolbar in the event view""" |
499 | 20 | return self.get_toolbar_button(2) | 20 | return self.get_toolbar_named_toolbarbutton("cameraButton") |
500 | 21 | 21 | ||
501 | 22 | def get_toolbar_select_button(self): | 22 | def get_toolbar_select_button(self): |
502 | 23 | """Returns the select button of the toolbar in the event view""" | 23 | """Returns the select button of the toolbar in the event view""" |
504 | 24 | return self.get_toolbar_button(0) | 24 | return self.get_toolbar_named_toolbarbutton("selectButton") |
505 | 25 | 25 | ||
506 | 26 | def get_toolbar_delete_button(self): | 26 | def get_toolbar_delete_button(self): |
507 | 27 | """Returns the delete button of the toolbar in the event view""" | 27 | """Returns the delete button of the toolbar in the event view""" |
509 | 28 | return self.get_toolbar_button(1) | 28 | return self.get_toolbar_named_toolbarbutton("deleteButton") |
510 | 29 | 29 | ||
511 | 30 | def number_of_photos(self): | 30 | def number_of_photos(self): |
512 | 31 | """Returns the number of events""" | 31 | """Returns the number of events""" |
513 | 32 | 32 | ||
514 | === modified file 'tests/autopilot/gallery_app/emulators/gallery_utils.py' | |||
515 | --- tests/autopilot/gallery_app/emulators/gallery_utils.py 2013-06-14 14:15:56 +0000 | |||
516 | +++ tests/autopilot/gallery_app/emulators/gallery_utils.py 2013-06-19 18:46:28 +0000 | |||
517 | @@ -72,17 +72,20 @@ | |||
518 | 72 | """Returns the toolbar in the main events view.""" | 72 | """Returns the toolbar in the main events view.""" |
519 | 73 | return self.app.select_single("Toolbar") | 73 | return self.app.select_single("Toolbar") |
520 | 74 | 74 | ||
523 | 75 | def get_toolbar_button(self, button_idx): | 75 | def get_toolbar_named_toolbarbutton(self, name): |
524 | 76 | """Returns the button with index idx from the toolbar""" | 76 | """Returns the ToolbarButton with the specified objectName""" |
525 | 77 | toolbar = self.get_toolbar() | 77 | toolbar = self.get_toolbar() |
528 | 78 | buttons = toolbar.select_many("Button") | 78 | return toolbar.select_single("ActionItem", objectName=name) |
527 | 79 | return buttons[button_idx+1] | ||
529 | 80 | 79 | ||
530 | 81 | def get_toolbar_cancel_icon(self): | 80 | def get_toolbar_cancel_icon(self): |
531 | 82 | """Returns the cancel icon of the events view.""" | 81 | """Returns the cancel icon of the events view.""" |
532 | 83 | toolbar = self.get_toolbar() | 82 | toolbar = self.get_toolbar() |
535 | 84 | buttons = toolbar.select_many("Button") | 83 | return toolbar.select_single("Button", objectName="cancelButton", visible=True) |
536 | 85 | return buttons[0] | 84 | |
537 | 85 | def get_toolbar_back_icon(self): | ||
538 | 86 | """Returns the back icon of the toolbar.""" | ||
539 | 87 | toolbar = self.get_toolbar() | ||
540 | 88 | return toolbar.select_single("ActionItem", objectName="backButton", visible=True) | ||
541 | 86 | 89 | ||
542 | 87 | def get_delete_dialog(self): | 90 | def get_delete_dialog(self): |
543 | 88 | """Returns the delete dialog in the events view.""" | 91 | """Returns the delete dialog in the events view.""" |
544 | 89 | 92 | ||
545 | === modified file 'tests/autopilot/gallery_app/emulators/media_selector.py' | |||
546 | --- tests/autopilot/gallery_app/emulators/media_selector.py 2013-04-08 14:55:34 +0000 | |||
547 | +++ tests/autopilot/gallery_app/emulators/media_selector.py 2013-06-19 18:46:28 +0000 | |||
548 | @@ -20,7 +20,8 @@ | |||
549 | 20 | 20 | ||
550 | 21 | def get_toolbar_add_button(self): | 21 | def get_toolbar_add_button(self): |
551 | 22 | """Returns the add button of the tollbar in the media selector""" | 22 | """Returns the add button of the tollbar in the media selector""" |
553 | 23 | return self.get_toolbar_button(0) | 23 | toolbar = self.get_toolbar() |
554 | 24 | return toolbar.select_single("Button", objectName="addButton") | ||
555 | 24 | 25 | ||
556 | 25 | def get_second_photo(self): | 26 | def get_second_photo(self): |
557 | 26 | """Returns the second photo item""" | 27 | """Returns the second photo item""" |
558 | 27 | 28 | ||
559 | === modified file 'tests/autopilot/gallery_app/emulators/photo_viewer.py' | |||
560 | --- tests/autopilot/gallery_app/emulators/photo_viewer.py 2013-06-05 13:15:02 +0000 | |||
561 | +++ tests/autopilot/gallery_app/emulators/photo_viewer.py 2013-06-19 18:46:28 +0000 | |||
562 | @@ -15,16 +15,16 @@ | |||
563 | 15 | 15 | ||
564 | 16 | def get_toolbar_edit_button(self): | 16 | def get_toolbar_edit_button(self): |
565 | 17 | """Return the edit button of the toolbar when photo viewer is shown""" | 17 | """Return the edit button of the toolbar when photo viewer is shown""" |
567 | 18 | return self.get_toolbar_button(0) | 18 | return self.get_toolbar_named_toolbarbutton("editButton") |
568 | 19 | 19 | ||
569 | 20 | def get_toolbar_delete_button(self): | 20 | def get_toolbar_delete_button(self): |
570 | 21 | """Return the delete button of the toolbar when photo viewer is | 21 | """Return the delete button of the toolbar when photo viewer is |
571 | 22 | shown""" | 22 | shown""" |
573 | 23 | return self.get_toolbar_button(2) | 23 | return self.get_toolbar_named_toolbarbutton("deleteButton") |
574 | 24 | 24 | ||
575 | 25 | def get_toolbar_share_button(self): | 25 | def get_toolbar_share_button(self): |
576 | 26 | """Return the share button of the toolbar when photo viewer is shown""" | 26 | """Return the share button of the toolbar when photo viewer is shown""" |
578 | 27 | return self.get_toolbar_button(3) | 27 | return self.get_toolbar_named_toolbarbutton("shareButton") |
579 | 28 | 28 | ||
580 | 29 | def get_delete_dialog(self): | 29 | def get_delete_dialog(self): |
581 | 30 | """Returns the photo viewer delete dialog.""" | 30 | """Returns the photo viewer delete dialog.""" |
582 | 31 | 31 | ||
583 | === modified file 'tests/autopilot/gallery_app/emulators/photos_view.py' | |||
584 | --- tests/autopilot/gallery_app/emulators/photos_view.py 2013-04-10 15:31:33 +0000 | |||
585 | +++ tests/autopilot/gallery_app/emulators/photos_view.py 2013-06-19 18:46:28 +0000 | |||
586 | @@ -23,11 +23,11 @@ | |||
587 | 23 | 23 | ||
588 | 24 | def get_toolbar_select_button(self): | 24 | def get_toolbar_select_button(self): |
589 | 25 | """Returns the select button of the tollbar in the events view.""" | 25 | """Returns the select button of the tollbar in the events view.""" |
591 | 26 | return self.get_toolbar_button(0) | 26 | return self.get_toolbar_named_toolbarbutton("selectButton") |
592 | 27 | 27 | ||
593 | 28 | def get_toolbar_delete_button(self): | 28 | def get_toolbar_delete_button(self): |
594 | 29 | """Returns the delete button of the tollbar in the events view.""" | 29 | """Returns the delete button of the tollbar in the events view.""" |
596 | 30 | return self.get_toolbar_button(1) | 30 | return self.get_toolbar_named_toolbarbutton("deleteButton") |
597 | 31 | 31 | ||
598 | 32 | def get_first_photo_in_photos_view(self): | 32 | def get_first_photo_in_photos_view(self): |
599 | 33 | """Returns the very first photo in the photos view.""" | 33 | """Returns the very first photo in the photos view.""" |
600 | 34 | 34 | ||
601 | === modified file 'tests/autopilot/gallery_app/tests/test_album_editor.py' | |||
602 | --- tests/autopilot/gallery_app/tests/test_album_editor.py 2013-05-27 10:57:50 +0000 | |||
603 | +++ tests/autopilot/gallery_app/tests/test_album_editor.py 2013-06-19 18:46:28 +0000 | |||
604 | @@ -127,8 +127,8 @@ | |||
605 | 127 | num_photos_start = self.album_view.number_of_photos() | 127 | num_photos_start = self.album_view.number_of_photos() |
606 | 128 | self.assertThat(num_photos_start, Equals(1)) | 128 | self.assertThat(num_photos_start, Equals(1)) |
607 | 129 | self.reveal_toolbar() | 129 | self.reveal_toolbar() |
610 | 130 | cancel = self.album_view.get_toolbar_cancel_icon() | 130 | back = self.album_view.get_toolbar_back_icon() |
611 | 131 | self.click_item(cancel) | 131 | self.click_item(back) |
612 | 132 | self.ensure_album_viewer_is_fully_closed() | 132 | self.ensure_album_viewer_is_fully_closed() |
613 | 133 | 133 | ||
614 | 134 | # now open to add a photo | 134 | # now open to add a photo |
615 | 135 | 135 | ||
616 | === modified file 'tests/autopilot/gallery_app/tests/test_photo_viewer.py' | |||
617 | --- tests/autopilot/gallery_app/tests/test_photo_viewer.py 2013-06-18 07:56:00 +0000 | |||
618 | +++ tests/autopilot/gallery_app/tests/test_photo_viewer.py 2013-06-19 18:46:28 +0000 | |||
619 | @@ -54,7 +54,7 @@ | |||
620 | 54 | def test_nav_bar_back_button(self): | 54 | def test_nav_bar_back_button(self): |
621 | 55 | """Clicking the back button must close the photo.""" | 55 | """Clicking the back button must close the photo.""" |
622 | 56 | photo_viewer = self.photo_viewer.get_main_photo_viewer() | 56 | photo_viewer = self.photo_viewer.get_main_photo_viewer() |
624 | 57 | back_button = self.photo_viewer.get_toolbar_cancel_icon() | 57 | back_button = self.photo_viewer.get_toolbar_back_icon() |
625 | 58 | self.click_item(back_button) | 58 | self.click_item(back_button) |
626 | 59 | 59 | ||
627 | 60 | self.assertThat(photo_viewer.visible, Eventually(Equals(False))) | 60 | self.assertThat(photo_viewer.visible, Eventually(Equals(False))) |
do not approve yet because the changes are not in the UITK.