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 | objectName: "mainAlbumEditor" |
6 | |
7 | title: "Edit album" |
8 | - tools: ToolbarActions { |
9 | - back: Action { |
10 | - itemHint: Button { |
11 | - text: i18n.tr("Cancel") |
12 | - width: units.gu(10) |
13 | - onClicked: { |
14 | - albumEditor.closeRequested(albumEditor.album, false); |
15 | - } |
16 | + tools: ToolbarItems { |
17 | + back: Button { |
18 | + objectName: "cancelButton" |
19 | + anchors.verticalCenter: parent.verticalCenter |
20 | + text: i18n.tr("Cancel") |
21 | + width: units.gu(10) |
22 | + onClicked: { |
23 | + albumEditor.closeRequested(albumEditor.album, false); |
24 | } |
25 | } |
26 | } |
27 | |
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 | } |
33 | |
34 | /// Contains the actions for the toolbar in the album view |
35 | - tools: ToolbarActions { |
36 | - Action { |
37 | - text: i18n.tr("Add") |
38 | - iconSource: Qt.resolvedUrl("../img/add.png") |
39 | - onTriggered: { |
40 | - loader_mediaSelector.show() |
41 | + tools: ToolbarItems { |
42 | + ToolbarButton { |
43 | + objectName: "addButton" |
44 | + action: Action { |
45 | + text: i18n.tr("Add to album") // text in HUD |
46 | + iconSource: Qt.resolvedUrl("../img/add.png") |
47 | + onTriggered: { |
48 | + loader_mediaSelector.show() |
49 | + } |
50 | } |
51 | + text: i18n.tr("Add") // text in toolbar |
52 | } |
53 | - Action { |
54 | + ToolbarButton { |
55 | + objectName: "deleteButton" |
56 | text: i18n.tr("Delete") |
57 | iconSource: Qt.resolvedUrl("../img/delete.png") |
58 | onTriggered: { |
59 | @@ -479,13 +484,15 @@ |
60 | } |
61 | enabled: false // FIXME enable once the close animation is not shown anymore |
62 | } |
63 | - Action { |
64 | + ToolbarButton { |
65 | + objectName: "shareButton" |
66 | text: i18n.tr("Share") |
67 | iconSource: Qt.resolvedUrl("../img/share.png") |
68 | enabled: false |
69 | } |
70 | - back: Action { |
71 | + back: ToolbarButton { |
72 | text: i18n.tr("Back") |
73 | + objectName: "backButton" |
74 | iconSource: Qt.resolvedUrl("../img/back.png") |
75 | onTriggered: { |
76 | __close() |
77 | |
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 | Checkerboard { |
83 | id: root |
84 | |
85 | - /// Contains the actions for the toolbar in the albums tab |
86 | - tools: albumOverviewTools |
87 | - |
88 | /*! |
89 | */ |
90 | function getRectOfAlbumPreview(album, relativeTo) { |
91 | @@ -171,21 +168,29 @@ |
92 | visible: false |
93 | } |
94 | |
95 | - ToolbarActions { |
96 | + /// Contains the actions for the toolbar in the albums tab |
97 | + tools: ToolbarItems { |
98 | id: albumOverviewTools |
99 | - Action { |
100 | - text: i18n.tr("Add") |
101 | - iconSource: Qt.resolvedUrl("../img/add.png") |
102 | - onTriggered: { |
103 | - var album = albumCollectionModel.createOrphan(); |
104 | - albumCollectionModel.addOrphan(album); |
105 | + ToolbarButton { |
106 | + objectName: "addButton" |
107 | + action: Action { |
108 | + text: i18n.tr("Add new album") // Text in HUD |
109 | + iconSource: Qt.resolvedUrl("../img/add.png") |
110 | + onTriggered: { |
111 | + var album = albumCollectionModel.createOrphan(); |
112 | + albumCollectionModel.addOrphan(album); |
113 | + } |
114 | } |
115 | + text: "Add" // text in toolbar |
116 | } |
117 | - Action { |
118 | - text: i18n.tr("Camera") |
119 | - iconSource: Qt.resolvedUrl("../img/camera.png") |
120 | - onTriggered: { |
121 | - appManager.switchToCameraApplication(); |
122 | + ToolbarButton { |
123 | + objectName: "cameraButton" |
124 | + action: Action { |
125 | + text: i18n.tr("Camera") |
126 | + iconSource: Qt.resolvedUrl("../img/camera.png") |
127 | + onTriggered: { |
128 | + appManager.switchToCameraApplication(); |
129 | + } |
130 | } |
131 | } |
132 | } |
133 | |
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 | active = false; |
139 | } |
140 | |
141 | - tools: toolActions |
142 | title: i18n.tr("Add to Album") |
143 | active: false |
144 | visible: false |
145 | @@ -76,26 +75,26 @@ |
146 | selection: mediaSelector.selection |
147 | } |
148 | |
149 | - property ToolbarActions toolActions: ToolbarActions { |
150 | - Action { |
151 | - itemHint: Button { |
152 | - text: i18n.tr("Add to Album") |
153 | - color: Gallery.HIGHLIGHT_BUTTON_COLOR |
154 | - width: units.gu(16) |
155 | - onClicked: { |
156 | - mediaSelector.addClicked(); |
157 | - mediaSelector.hide(); |
158 | - } |
159 | + tools: ToolbarItems { |
160 | + Button { |
161 | + anchors.verticalCenter: parent.verticalCenter |
162 | + text: i18n.tr("Add to Album") |
163 | + objectName: "addButton" |
164 | + color: Gallery.HIGHLIGHT_BUTTON_COLOR |
165 | + width: units.gu(16) |
166 | + onTriggered: { |
167 | + mediaSelector.addClicked(); |
168 | + mediaSelector.hide(); |
169 | } |
170 | } |
171 | |
172 | - back: Action { |
173 | - itemHint: Button { |
174 | - text: i18n.tr("Cancel") |
175 | - width: units.gu(10) |
176 | - onClicked: { |
177 | - mediaSelector.hide(); |
178 | - } |
179 | + back: Button { |
180 | + anchors.verticalCenter: parent.verticalCenter |
181 | + text: i18n.tr("Cancel") |
182 | + objectName: "cancelButton" |
183 | + width: units.gu(10) |
184 | + onClicked: { |
185 | + mediaSelector.hide(); |
186 | } |
187 | } |
188 | opened: true |
189 | |
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 | (galleryPhotoViewer.currentItem ? galleryPhotoViewer.currentItem.isLoaded : false) |
195 | |
196 | // tooolbar actions for the full view |
197 | - property ToolbarActions tools: media ? (media.type === MediaSource.Photo ? |
198 | + property Item tools: media ? (media.type === MediaSource.Photo ? |
199 | d.photoToolbar : d.videoToolbar) |
200 | : null |
201 | |
202 | @@ -402,38 +402,52 @@ |
203 | Item { |
204 | id: d |
205 | |
206 | - property ToolbarActions photoToolbar: ToolbarActions { |
207 | - Action { |
208 | + property Item photoToolbar: ToolbarItems { |
209 | + ToolbarButton { |
210 | + objectName: "editButton" |
211 | text: i18n.tr("Edit") |
212 | iconSource: "../../img/edit.png" |
213 | onTriggered: { |
214 | PopupUtils.open(editPopoverComponent, caller); |
215 | } |
216 | } |
217 | - Action { |
218 | + ToolbarButton { |
219 | + objectName: "addButton" |
220 | + action: Action { |
221 | + text: i18n.tr("Add photo to album") |
222 | + iconSource: "../../img/add.png" |
223 | + onTriggered: { |
224 | + popupAlbumPicker.caller = caller; |
225 | + popupAlbumPicker.show(); |
226 | + } |
227 | + } |
228 | text: i18n.tr("Add") |
229 | - iconSource: "../../img/add.png" |
230 | - onTriggered: { |
231 | - popupAlbumPicker.caller = caller; |
232 | - popupAlbumPicker.show(); |
233 | + } |
234 | + ToolbarButton { |
235 | + objectName: "deleteButton" |
236 | + action: Action { |
237 | + text: i18n.tr("Delete") |
238 | + iconSource: "../../img/delete.png" |
239 | + onTriggered: { |
240 | + PopupUtils.open(deleteDialog, null); |
241 | + } |
242 | } |
243 | - } |
244 | - Action { |
245 | text: i18n.tr("Delete") |
246 | - iconSource: "../../img/delete.png" |
247 | - onTriggered: { |
248 | - PopupUtils.open(deleteDialog, null); |
249 | + } |
250 | + ToolbarButton { |
251 | + objectName: "shareButton" |
252 | + action: Action { |
253 | + text: i18n.tr("Share photo") |
254 | + iconSource: "../../img/share.png" |
255 | + onTriggered: { |
256 | + PopupUtils.open(sharePopoverComponent, caller); |
257 | + } |
258 | } |
259 | - } |
260 | - Action { |
261 | text: i18n.tr("Share") |
262 | - iconSource: "../../img/share.png" |
263 | - onTriggered: { |
264 | - PopupUtils.open(sharePopoverComponent, caller); |
265 | - } |
266 | } |
267 | |
268 | - back: Action { |
269 | + back: ToolbarButton { |
270 | + objectName: "backButton" |
271 | text: i18n.tr("Back") |
272 | iconSource: "../../img/back.png" |
273 | onTriggered: { |
274 | @@ -443,8 +457,8 @@ |
275 | } |
276 | } |
277 | |
278 | - property ToolbarActions videoToolbar: ToolbarActions { |
279 | - Action { |
280 | + property Item videoToolbar: ToolbarItems { |
281 | + ToolbarButton { |
282 | text: galleryPhotoViewer.currentItem ? |
283 | (galleryPhotoViewer.currentItem.isPlayingVideo ? |
284 | i18n.tr("Pause") : i18n.tr("Play")) |
285 | @@ -457,7 +471,8 @@ |
286 | galleryPhotoViewer.currentItem.togglePlayPause(); |
287 | } |
288 | } |
289 | - Action { |
290 | + ToolbarButton { |
291 | + objectName: "addButton" |
292 | text: i18n.tr("Add") |
293 | iconSource: "../../img/add.png" |
294 | onTriggered: { |
295 | @@ -465,14 +480,16 @@ |
296 | popupAlbumPicker.show(); |
297 | } |
298 | } |
299 | - Action { |
300 | + ToolbarButton { |
301 | + objectName: "deleteButton" |
302 | text: i18n.tr("Delete") |
303 | iconSource: "../../img/delete.png" |
304 | onTriggered: { |
305 | PopupUtils.open(deleteDialog, null); |
306 | } |
307 | } |
308 | - Action { |
309 | + ToolbarButton { |
310 | + objectName: "shareButton" |
311 | text: i18n.tr("Share") |
312 | iconSource: "../../img/share.png" |
313 | onTriggered: { |
314 | @@ -480,7 +497,8 @@ |
315 | } |
316 | } |
317 | |
318 | - back: Action { |
319 | + back: ToolbarButton { |
320 | + objectName: "backButton" |
321 | text: i18n.tr("Back") |
322 | iconSource: "../../img/back.png" |
323 | onTriggered: { |
324 | |
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 | model: d.model |
330 | } |
331 | |
332 | - property ToolbarActions overviewTools: PhotosToolbarActions { |
333 | + property Item overviewTools: PhotosToolbarActions { |
334 | selection: d.selection |
335 | onStartCamera: appManager.switchToCameraApplication(); |
336 | } |
337 | @@ -187,7 +187,7 @@ |
338 | id: appManager |
339 | } |
340 | |
341 | - property ToolbarActions selectionTools: SelectionToolbarAction { |
342 | + property Item selectionTools: SelectionToolbarAction { |
343 | selection: d.selection |
344 | |
345 | onCancelClicked: { |
346 | |
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 | } |
352 | } |
353 | |
354 | - property ToolbarActions overviewTools: PhotosToolbarActions { |
355 | + property Item overviewTools: PhotosToolbarActions { |
356 | selection: organicEventView.selection |
357 | onStartCamera: appManager.switchToCameraApplication(); |
358 | } |
359 | @@ -105,7 +105,7 @@ |
360 | id: appManager |
361 | } |
362 | |
363 | - property ToolbarActions selectionTools: SelectionToolbarAction { |
364 | + property Item selectionTools: SelectionToolbarAction { |
365 | selection: organicEventView.selection |
366 | |
367 | onCancelClicked: { |
368 | |
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 | /*! |
374 | The actions for the toolbar for the event and photos view |
375 | */ |
376 | -ToolbarActions { |
377 | +ToolbarItems { |
378 | id: root |
379 | /// The selection state item to use for enable / disable the select mode |
380 | property SelectionState selection: null |
381 | @@ -28,18 +28,21 @@ |
382 | /// Emittedt when the camera action was triggered |
383 | signal startCamera() |
384 | |
385 | - Action { |
386 | + ToolbarButton { |
387 | + objectName: "selectButton" |
388 | text: i18n.tr("Select") |
389 | iconSource: Qt.resolvedUrl("../../img/select.png") |
390 | enabled: root.selection !== null |
391 | onTriggered: root.selection.inSelectionMode = true; |
392 | } |
393 | - Action { |
394 | + ToolbarButton { |
395 | + objectName: "importButton" |
396 | text: i18n.tr("Import") |
397 | iconSource: Qt.resolvedUrl("../../img/import-image.png") |
398 | enabled: false |
399 | } |
400 | - Action { |
401 | + ToolbarButton { |
402 | + objectName: "cameraButton" |
403 | text: i18n.tr("Camera") |
404 | iconSource: Qt.resolvedUrl("../../img/camera.png") |
405 | onTriggered: root.startCamera(); |
406 | |
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 | /*! |
412 | The actions for the toolbar for the event and photos view in select mode |
413 | */ |
414 | -ToolbarActions { |
415 | +ToolbarItems { |
416 | id: root |
417 | /// The selection state item |
418 | property SelectionState selection: null |
419 | @@ -38,31 +38,34 @@ |
420 | opened: true |
421 | locked: true |
422 | |
423 | - Action { |
424 | + ToolbarButton { |
425 | + objectName: "addButton" |
426 | text: i18n.tr("Add") |
427 | iconSource: Qt.resolvedUrl("../../img/add.png") |
428 | enabled: root.selection.selectedCount > 0 |
429 | onTriggered: root.addClicked(caller); |
430 | } |
431 | - Action { |
432 | + ToolbarButton { |
433 | + objectName: "deleteButton" |
434 | text: i18n.tr("Delete") |
435 | iconSource: Qt.resolvedUrl("../../img/delete.png") |
436 | enabled: root.selection.selectedCount > 0 |
437 | onTriggered:root.deleteClicked(); |
438 | } |
439 | - Action { |
440 | + ToolbarButton { |
441 | + objectName: "shareButton" |
442 | text: i18n.tr("Share") |
443 | iconSource: Qt.resolvedUrl("../../img/share.png") |
444 | enabled: false |
445 | } |
446 | |
447 | - back: Action { |
448 | - itemHint: Button { |
449 | - text: i18n.tr("Cancel") |
450 | - width: units.gu(10) |
451 | - onClicked: { |
452 | - root.cancelClicked(); |
453 | - } |
454 | + back: Button { |
455 | + objectName: "cancelButton" |
456 | + anchors.verticalCenter: parent.verticalCenter |
457 | + text: i18n.tr("Cancel") |
458 | + width: units.gu(10) |
459 | + onClicked: { |
460 | + root.cancelClicked(); |
461 | } |
462 | } |
463 | } |
464 | |
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 | |
470 | def get_toolbar_add_button(self): |
471 | """Returns the add button of the tollbar in the events view.""" |
472 | - return self.get_toolbar_button(0) |
473 | + return self.get_toolbar_named_toolbarbutton("addButton") |
474 | |
475 | def get_first_photo(self): |
476 | """Returns the first photo in a newly opened album""" |
477 | |
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 | |
483 | def get_toolbar_add_button(self): |
484 | """Returns the add button of the tollbar in the events view.""" |
485 | - return self.get_toolbar_button(0) |
486 | + return self.get_toolbar_named_toolbarbutton("addButton") |
487 | |
488 | def number_of_albums_in_albums_view(self): |
489 | """Returns the number of albums shown in albums overview""" |
490 | |
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 | |
496 | def get_toolbar_camera_button(self): |
497 | """Returns the camera button of the toolbar in the event view""" |
498 | - return self.get_toolbar_button(2) |
499 | + return self.get_toolbar_named_toolbarbutton("cameraButton") |
500 | |
501 | def get_toolbar_select_button(self): |
502 | """Returns the select button of the toolbar in the event view""" |
503 | - return self.get_toolbar_button(0) |
504 | + return self.get_toolbar_named_toolbarbutton("selectButton") |
505 | |
506 | def get_toolbar_delete_button(self): |
507 | """Returns the delete button of the toolbar in the event view""" |
508 | - return self.get_toolbar_button(1) |
509 | + return self.get_toolbar_named_toolbarbutton("deleteButton") |
510 | |
511 | def number_of_photos(self): |
512 | """Returns the number of events""" |
513 | |
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 | """Returns the toolbar in the main events view.""" |
519 | return self.app.select_single("Toolbar") |
520 | |
521 | - def get_toolbar_button(self, button_idx): |
522 | - """Returns the button with index idx from the toolbar""" |
523 | + def get_toolbar_named_toolbarbutton(self, name): |
524 | + """Returns the ToolbarButton with the specified objectName""" |
525 | toolbar = self.get_toolbar() |
526 | - buttons = toolbar.select_many("Button") |
527 | - return buttons[button_idx+1] |
528 | + return toolbar.select_single("ActionItem", objectName=name) |
529 | |
530 | def get_toolbar_cancel_icon(self): |
531 | """Returns the cancel icon of the events view.""" |
532 | toolbar = self.get_toolbar() |
533 | - buttons = toolbar.select_many("Button") |
534 | - return buttons[0] |
535 | + return toolbar.select_single("Button", objectName="cancelButton", visible=True) |
536 | + |
537 | + def get_toolbar_back_icon(self): |
538 | + """Returns the back icon of the toolbar.""" |
539 | + toolbar = self.get_toolbar() |
540 | + return toolbar.select_single("ActionItem", objectName="backButton", visible=True) |
541 | |
542 | def get_delete_dialog(self): |
543 | """Returns the delete dialog in the events view.""" |
544 | |
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 | |
550 | def get_toolbar_add_button(self): |
551 | """Returns the add button of the tollbar in the media selector""" |
552 | - return self.get_toolbar_button(0) |
553 | + toolbar = self.get_toolbar() |
554 | + return toolbar.select_single("Button", objectName="addButton") |
555 | |
556 | def get_second_photo(self): |
557 | """Returns the second photo item""" |
558 | |
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 | |
564 | def get_toolbar_edit_button(self): |
565 | """Return the edit button of the toolbar when photo viewer is shown""" |
566 | - return self.get_toolbar_button(0) |
567 | + return self.get_toolbar_named_toolbarbutton("editButton") |
568 | |
569 | def get_toolbar_delete_button(self): |
570 | """Return the delete button of the toolbar when photo viewer is |
571 | shown""" |
572 | - return self.get_toolbar_button(2) |
573 | + return self.get_toolbar_named_toolbarbutton("deleteButton") |
574 | |
575 | def get_toolbar_share_button(self): |
576 | """Return the share button of the toolbar when photo viewer is shown""" |
577 | - return self.get_toolbar_button(3) |
578 | + return self.get_toolbar_named_toolbarbutton("shareButton") |
579 | |
580 | def get_delete_dialog(self): |
581 | """Returns the photo viewer delete dialog.""" |
582 | |
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 | |
588 | def get_toolbar_select_button(self): |
589 | """Returns the select button of the tollbar in the events view.""" |
590 | - return self.get_toolbar_button(0) |
591 | + return self.get_toolbar_named_toolbarbutton("selectButton") |
592 | |
593 | def get_toolbar_delete_button(self): |
594 | """Returns the delete button of the tollbar in the events view.""" |
595 | - return self.get_toolbar_button(1) |
596 | + return self.get_toolbar_named_toolbarbutton("deleteButton") |
597 | |
598 | def get_first_photo_in_photos_view(self): |
599 | """Returns the very first photo in the photos view.""" |
600 | |
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 | num_photos_start = self.album_view.number_of_photos() |
606 | self.assertThat(num_photos_start, Equals(1)) |
607 | self.reveal_toolbar() |
608 | - cancel = self.album_view.get_toolbar_cancel_icon() |
609 | - self.click_item(cancel) |
610 | + back = self.album_view.get_toolbar_back_icon() |
611 | + self.click_item(back) |
612 | self.ensure_album_viewer_is_fully_closed() |
613 | |
614 | # now open to add a photo |
615 | |
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 | def test_nav_bar_back_button(self): |
621 | """Clicking the back button must close the photo.""" |
622 | photo_viewer = self.photo_viewer.get_main_photo_viewer() |
623 | - back_button = self.photo_viewer.get_toolbar_cancel_icon() |
624 | + back_button = self.photo_viewer.get_toolbar_back_icon() |
625 | self.click_item(back_button) |
626 | |
627 | self.assertThat(photo_viewer.visible, Eventually(Equals(False))) |
do not approve yet because the changes are not in the UITK.