Merge lp:~tpeeters/gallery-app/toolbarItems into lp:gallery-app

Proposed by Tim Peeters
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
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

To post a comment you must log in.
Revision history for this message
Tim Peeters (tpeeters) wrote :

do not approve yet because the changes are not in the UITK.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :
review: Approve
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
Günter Schwann (schwann) wrote :

This is needed to fix it:

=== modified file 'rc/qml/MediaViewer/MediaViewer.qml'
--- rc/qml/MediaViewer/MediaViewer.qml 2013-06-19 15:47:39 +0000
+++ rc/qml/MediaViewer/MediaViewer.qml 2013-06-19 17:38:16 +0000
@@ -457,7 +457,7 @@
             }
         }

- property ToolbarActions videoToolbar: ToolbarItems {
+ property Item videoToolbar: ToolbarItems {
             ToolbarButton {
                 text: galleryPhotoViewer.currentItem ?
                           (galleryPhotoViewer.currentItem.isPlayingVideo ?

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

looks good

review: Approve
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)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'rc/qml/AlbumEditor.qml'
--- rc/qml/AlbumEditor.qml 2013-05-15 11:16:42 +0000
+++ rc/qml/AlbumEditor.qml 2013-06-19 18:46:28 +0000
@@ -34,14 +34,14 @@
34 objectName: "mainAlbumEditor"34 objectName: "mainAlbumEditor"
3535
36 title: "Edit album"36 title: "Edit album"
37 tools: ToolbarActions {37 tools: ToolbarItems {
38 back: Action {38 back: Button {
39 itemHint: Button {39 objectName: "cancelButton"
40 text: i18n.tr("Cancel")40 anchors.verticalCenter: parent.verticalCenter
41 width: units.gu(10)41 text: i18n.tr("Cancel")
42 onClicked: {42 width: units.gu(10)
43 albumEditor.closeRequested(albumEditor.album, false);43 onClicked: {
44 }44 albumEditor.closeRequested(albumEditor.album, false);
45 }45 }
46 }46 }
47 }47 }
4848
=== modified file 'rc/qml/AlbumViewer.qml'
--- rc/qml/AlbumViewer.qml 2013-04-12 14:19:20 +0000
+++ rc/qml/AlbumViewer.qml 2013-06-19 18:46:28 +0000
@@ -461,15 +461,20 @@
461 }461 }
462462
463 /// Contains the actions for the toolbar in the album view463 /// Contains the actions for the toolbar in the album view
464 tools: ToolbarActions {464 tools: ToolbarItems {
465 Action {465 ToolbarButton {
466 text: i18n.tr("Add")466 objectName: "addButton"
467 iconSource: Qt.resolvedUrl("../img/add.png")467 action: Action {
468 onTriggered: {468 text: i18n.tr("Add to album") // text in HUD
469 loader_mediaSelector.show()469 iconSource: Qt.resolvedUrl("../img/add.png")
470 onTriggered: {
471 loader_mediaSelector.show()
472 }
470 }473 }
474 text: i18n.tr("Add") // text in toolbar
471 }475 }
472 Action {476 ToolbarButton {
477 objectName: "deleteButton"
473 text: i18n.tr("Delete")478 text: i18n.tr("Delete")
474 iconSource: Qt.resolvedUrl("../img/delete.png")479 iconSource: Qt.resolvedUrl("../img/delete.png")
475 onTriggered: {480 onTriggered: {
@@ -479,13 +484,15 @@
479 }484 }
480 enabled: false // FIXME enable once the close animation is not shown anymore485 enabled: false // FIXME enable once the close animation is not shown anymore
481 }486 }
482 Action {487 ToolbarButton {
488 objectName: "shareButton"
483 text: i18n.tr("Share")489 text: i18n.tr("Share")
484 iconSource: Qt.resolvedUrl("../img/share.png")490 iconSource: Qt.resolvedUrl("../img/share.png")
485 enabled: false491 enabled: false
486 }492 }
487 back: Action {493 back: ToolbarButton {
488 text: i18n.tr("Back")494 text: i18n.tr("Back")
495 objectName: "backButton"
489 iconSource: Qt.resolvedUrl("../img/back.png")496 iconSource: Qt.resolvedUrl("../img/back.png")
490 onTriggered: {497 onTriggered: {
491 __close()498 __close()
492499
=== modified file 'rc/qml/AlbumsOverview.qml'
--- rc/qml/AlbumsOverview.qml 2013-04-12 14:19:20 +0000
+++ rc/qml/AlbumsOverview.qml 2013-06-19 18:46:28 +0000
@@ -28,9 +28,6 @@
28Checkerboard {28Checkerboard {
29 id: root29 id: root
3030
31 /// Contains the actions for the toolbar in the albums tab
32 tools: albumOverviewTools
33
34 /*!31 /*!
35 */32 */
36 function getRectOfAlbumPreview(album, relativeTo) {33 function getRectOfAlbumPreview(album, relativeTo) {
@@ -171,21 +168,29 @@
171 visible: false168 visible: false
172 }169 }
173170
174 ToolbarActions {171 /// Contains the actions for the toolbar in the albums tab
172 tools: ToolbarItems {
175 id: albumOverviewTools173 id: albumOverviewTools
176 Action {174 ToolbarButton {
177 text: i18n.tr("Add")175 objectName: "addButton"
178 iconSource: Qt.resolvedUrl("../img/add.png")176 action: Action {
179 onTriggered: {177 text: i18n.tr("Add new album") // Text in HUD
180 var album = albumCollectionModel.createOrphan();178 iconSource: Qt.resolvedUrl("../img/add.png")
181 albumCollectionModel.addOrphan(album);179 onTriggered: {
180 var album = albumCollectionModel.createOrphan();
181 albumCollectionModel.addOrphan(album);
182 }
182 }183 }
184 text: "Add" // text in toolbar
183 }185 }
184 Action {186 ToolbarButton {
185 text: i18n.tr("Camera")187 objectName: "cameraButton"
186 iconSource: Qt.resolvedUrl("../img/camera.png")188 action: Action {
187 onTriggered: {189 text: i18n.tr("Camera")
188 appManager.switchToCameraApplication();190 iconSource: Qt.resolvedUrl("../img/camera.png")
191 onTriggered: {
192 appManager.switchToCameraApplication();
193 }
189 }194 }
190 }195 }
191 }196 }
192197
=== modified file 'rc/qml/MediaSelector.qml'
--- rc/qml/MediaSelector.qml 2013-05-03 21:13:37 +0000
+++ rc/qml/MediaSelector.qml 2013-06-19 18:46:28 +0000
@@ -52,7 +52,6 @@
52 active = false;52 active = false;
53 }53 }
5454
55 tools: toolActions
56 title: i18n.tr("Add to Album")55 title: i18n.tr("Add to Album")
57 active: false56 active: false
58 visible: false57 visible: false
@@ -76,26 +75,26 @@
76 selection: mediaSelector.selection75 selection: mediaSelector.selection
77 }76 }
7877
79 property ToolbarActions toolActions: ToolbarActions {78 tools: ToolbarItems {
80 Action {79 Button {
81 itemHint: Button {80 anchors.verticalCenter: parent.verticalCenter
82 text: i18n.tr("Add to Album")81 text: i18n.tr("Add to Album")
83 color: Gallery.HIGHLIGHT_BUTTON_COLOR82 objectName: "addButton"
84 width: units.gu(16)83 color: Gallery.HIGHLIGHT_BUTTON_COLOR
85 onClicked: {84 width: units.gu(16)
86 mediaSelector.addClicked();85 onTriggered: {
87 mediaSelector.hide();86 mediaSelector.addClicked();
88 }87 mediaSelector.hide();
89 }88 }
90 }89 }
9190
92 back: Action {91 back: Button {
93 itemHint: Button {92 anchors.verticalCenter: parent.verticalCenter
94 text: i18n.tr("Cancel")93 text: i18n.tr("Cancel")
95 width: units.gu(10)94 objectName: "cancelButton"
96 onClicked: {95 width: units.gu(10)
97 mediaSelector.hide();96 onClicked: {
98 }97 mediaSelector.hide();
99 }98 }
100 }99 }
101 opened: true100 opened: true
102101
=== modified file 'rc/qml/MediaViewer/MediaViewer.qml'
--- rc/qml/MediaViewer/MediaViewer.qml 2013-06-18 13:30:59 +0000
+++ rc/qml/MediaViewer/MediaViewer.qml 2013-06-19 18:46:28 +0000
@@ -62,7 +62,7 @@
62 (galleryPhotoViewer.currentItem ? galleryPhotoViewer.currentItem.isLoaded : false)62 (galleryPhotoViewer.currentItem ? galleryPhotoViewer.currentItem.isLoaded : false)
6363
64 // tooolbar actions for the full view64 // tooolbar actions for the full view
65 property ToolbarActions tools: media ? (media.type === MediaSource.Photo ?65 property Item tools: media ? (media.type === MediaSource.Photo ?
66 d.photoToolbar : d.videoToolbar)66 d.photoToolbar : d.videoToolbar)
67 : null67 : null
6868
@@ -402,38 +402,52 @@
402 Item {402 Item {
403 id: d403 id: d
404404
405 property ToolbarActions photoToolbar: ToolbarActions {405 property Item photoToolbar: ToolbarItems {
406 Action {406 ToolbarButton {
407 objectName: "editButton"
407 text: i18n.tr("Edit")408 text: i18n.tr("Edit")
408 iconSource: "../../img/edit.png"409 iconSource: "../../img/edit.png"
409 onTriggered: {410 onTriggered: {
410 PopupUtils.open(editPopoverComponent, caller);411 PopupUtils.open(editPopoverComponent, caller);
411 }412 }
412 }413 }
413 Action {414 ToolbarButton {
415 objectName: "addButton"
416 action: Action {
417 text: i18n.tr("Add photo to album")
418 iconSource: "../../img/add.png"
419 onTriggered: {
420 popupAlbumPicker.caller = caller;
421 popupAlbumPicker.show();
422 }
423 }
414 text: i18n.tr("Add")424 text: i18n.tr("Add")
415 iconSource: "../../img/add.png"425 }
416 onTriggered: {426 ToolbarButton {
417 popupAlbumPicker.caller = caller;427 objectName: "deleteButton"
418 popupAlbumPicker.show();428 action: Action {
429 text: i18n.tr("Delete")
430 iconSource: "../../img/delete.png"
431 onTriggered: {
432 PopupUtils.open(deleteDialog, null);
433 }
419 }434 }
420 }
421 Action {
422 text: i18n.tr("Delete")435 text: i18n.tr("Delete")
423 iconSource: "../../img/delete.png"436 }
424 onTriggered: {437 ToolbarButton {
425 PopupUtils.open(deleteDialog, null);438 objectName: "shareButton"
439 action: Action {
440 text: i18n.tr("Share photo")
441 iconSource: "../../img/share.png"
442 onTriggered: {
443 PopupUtils.open(sharePopoverComponent, caller);
444 }
426 }445 }
427 }
428 Action {
429 text: i18n.tr("Share")446 text: i18n.tr("Share")
430 iconSource: "../../img/share.png"
431 onTriggered: {
432 PopupUtils.open(sharePopoverComponent, caller);
433 }
434 }447 }
435448
436 back: Action {449 back: ToolbarButton {
450 objectName: "backButton"
437 text: i18n.tr("Back")451 text: i18n.tr("Back")
438 iconSource: "../../img/back.png"452 iconSource: "../../img/back.png"
439 onTriggered: {453 onTriggered: {
@@ -443,8 +457,8 @@
443 }457 }
444 }458 }
445459
446 property ToolbarActions videoToolbar: ToolbarActions {460 property Item videoToolbar: ToolbarItems {
447 Action {461 ToolbarButton {
448 text: galleryPhotoViewer.currentItem ?462 text: galleryPhotoViewer.currentItem ?
449 (galleryPhotoViewer.currentItem.isPlayingVideo ?463 (galleryPhotoViewer.currentItem.isPlayingVideo ?
450 i18n.tr("Pause") : i18n.tr("Play"))464 i18n.tr("Pause") : i18n.tr("Play"))
@@ -457,7 +471,8 @@
457 galleryPhotoViewer.currentItem.togglePlayPause();471 galleryPhotoViewer.currentItem.togglePlayPause();
458 }472 }
459 }473 }
460 Action {474 ToolbarButton {
475 objectName: "addButton"
461 text: i18n.tr("Add")476 text: i18n.tr("Add")
462 iconSource: "../../img/add.png"477 iconSource: "../../img/add.png"
463 onTriggered: {478 onTriggered: {
@@ -465,14 +480,16 @@
465 popupAlbumPicker.show();480 popupAlbumPicker.show();
466 }481 }
467 }482 }
468 Action {483 ToolbarButton {
484 objectName: "deleteButton"
469 text: i18n.tr("Delete")485 text: i18n.tr("Delete")
470 iconSource: "../../img/delete.png"486 iconSource: "../../img/delete.png"
471 onTriggered: {487 onTriggered: {
472 PopupUtils.open(deleteDialog, null);488 PopupUtils.open(deleteDialog, null);
473 }489 }
474 }490 }
475 Action {491 ToolbarButton {
492 objectName: "shareButton"
476 text: i18n.tr("Share")493 text: i18n.tr("Share")
477 iconSource: "../../img/share.png"494 iconSource: "../../img/share.png"
478 onTriggered: {495 onTriggered: {
@@ -480,7 +497,8 @@
480 }497 }
481 }498 }
482499
483 back: Action {500 back: ToolbarButton {
501 objectName: "backButton"
484 text: i18n.tr("Back")502 text: i18n.tr("Back")
485 iconSource: "../../img/back.png"503 iconSource: "../../img/back.png"
486 onTriggered: {504 onTriggered: {
487505
=== modified file 'rc/qml/PhotosOverview.qml'
--- rc/qml/PhotosOverview.qml 2013-06-14 12:18:29 +0000
+++ rc/qml/PhotosOverview.qml 2013-06-19 18:46:28 +0000
@@ -178,7 +178,7 @@
178 model: d.model178 model: d.model
179 }179 }
180180
181 property ToolbarActions overviewTools: PhotosToolbarActions {181 property Item overviewTools: PhotosToolbarActions {
182 selection: d.selection182 selection: d.selection
183 onStartCamera: appManager.switchToCameraApplication();183 onStartCamera: appManager.switchToCameraApplication();
184 }184 }
@@ -187,7 +187,7 @@
187 id: appManager187 id: appManager
188 }188 }
189189
190 property ToolbarActions selectionTools: SelectionToolbarAction {190 property Item selectionTools: SelectionToolbarAction {
191 selection: d.selection191 selection: d.selection
192192
193 onCancelClicked: {193 onCancelClicked: {
194194
=== modified file 'rc/qml/Utility/OrganicEventView.qml'
--- rc/qml/Utility/OrganicEventView.qml 2013-06-14 12:18:29 +0000
+++ rc/qml/Utility/OrganicEventView.qml 2013-06-19 18:46:28 +0000
@@ -96,7 +96,7 @@
96 }96 }
97 }97 }
9898
99 property ToolbarActions overviewTools: PhotosToolbarActions {99 property Item overviewTools: PhotosToolbarActions {
100 selection: organicEventView.selection100 selection: organicEventView.selection
101 onStartCamera: appManager.switchToCameraApplication();101 onStartCamera: appManager.switchToCameraApplication();
102 }102 }
@@ -105,7 +105,7 @@
105 id: appManager105 id: appManager
106 }106 }
107107
108 property ToolbarActions selectionTools: SelectionToolbarAction {108 property Item selectionTools: SelectionToolbarAction {
109 selection: organicEventView.selection109 selection: organicEventView.selection
110110
111 onCancelClicked: {111 onCancelClicked: {
112112
=== modified file 'rc/qml/Utility/PhotosToolbarActions.qml'
--- rc/qml/Utility/PhotosToolbarActions.qml 2013-04-12 14:19:20 +0000
+++ rc/qml/Utility/PhotosToolbarActions.qml 2013-06-19 18:46:28 +0000
@@ -20,7 +20,7 @@
20/*!20/*!
21 The actions for the toolbar for the event and photos view21 The actions for the toolbar for the event and photos view
22 */22 */
23ToolbarActions {23ToolbarItems {
24 id: root24 id: root
25 /// The selection state item to use for enable / disable the select mode25 /// The selection state item to use for enable / disable the select mode
26 property SelectionState selection: null26 property SelectionState selection: null
@@ -28,18 +28,21 @@
28 /// Emittedt when the camera action was triggered28 /// Emittedt when the camera action was triggered
29 signal startCamera()29 signal startCamera()
3030
31 Action {31 ToolbarButton {
32 objectName: "selectButton"
32 text: i18n.tr("Select")33 text: i18n.tr("Select")
33 iconSource: Qt.resolvedUrl("../../img/select.png")34 iconSource: Qt.resolvedUrl("../../img/select.png")
34 enabled: root.selection !== null35 enabled: root.selection !== null
35 onTriggered: root.selection.inSelectionMode = true;36 onTriggered: root.selection.inSelectionMode = true;
36 }37 }
37 Action {38 ToolbarButton {
39 objectName: "importButton"
38 text: i18n.tr("Import")40 text: i18n.tr("Import")
39 iconSource: Qt.resolvedUrl("../../img/import-image.png")41 iconSource: Qt.resolvedUrl("../../img/import-image.png")
40 enabled: false42 enabled: false
41 }43 }
42 Action {44 ToolbarButton {
45 objectName: "cameraButton"
43 text: i18n.tr("Camera")46 text: i18n.tr("Camera")
44 iconSource: Qt.resolvedUrl("../../img/camera.png")47 iconSource: Qt.resolvedUrl("../../img/camera.png")
45 onTriggered: root.startCamera();48 onTriggered: root.startCamera();
4649
=== modified file 'rc/qml/Utility/SelectionToolbarAction.qml'
--- rc/qml/Utility/SelectionToolbarAction.qml 2013-05-15 09:29:25 +0000
+++ rc/qml/Utility/SelectionToolbarAction.qml 2013-06-19 18:46:28 +0000
@@ -21,7 +21,7 @@
21/*!21/*!
22 The actions for the toolbar for the event and photos view in select mode22 The actions for the toolbar for the event and photos view in select mode
23 */23 */
24ToolbarActions {24ToolbarItems {
25 id: root25 id: root
26 /// The selection state item26 /// The selection state item
27 property SelectionState selection: null27 property SelectionState selection: null
@@ -38,31 +38,34 @@
38 opened: true38 opened: true
39 locked: true39 locked: true
4040
41 Action {41 ToolbarButton {
42 objectName: "addButton"
42 text: i18n.tr("Add")43 text: i18n.tr("Add")
43 iconSource: Qt.resolvedUrl("../../img/add.png")44 iconSource: Qt.resolvedUrl("../../img/add.png")
44 enabled: root.selection.selectedCount > 045 enabled: root.selection.selectedCount > 0
45 onTriggered: root.addClicked(caller);46 onTriggered: root.addClicked(caller);
46 }47 }
47 Action {48 ToolbarButton {
49 objectName: "deleteButton"
48 text: i18n.tr("Delete")50 text: i18n.tr("Delete")
49 iconSource: Qt.resolvedUrl("../../img/delete.png")51 iconSource: Qt.resolvedUrl("../../img/delete.png")
50 enabled: root.selection.selectedCount > 052 enabled: root.selection.selectedCount > 0
51 onTriggered:root.deleteClicked();53 onTriggered:root.deleteClicked();
52 }54 }
53 Action {55 ToolbarButton {
56 objectName: "shareButton"
54 text: i18n.tr("Share")57 text: i18n.tr("Share")
55 iconSource: Qt.resolvedUrl("../../img/share.png")58 iconSource: Qt.resolvedUrl("../../img/share.png")
56 enabled: false59 enabled: false
57 }60 }
5861
59 back: Action {62 back: Button {
60 itemHint: Button {63 objectName: "cancelButton"
61 text: i18n.tr("Cancel")64 anchors.verticalCenter: parent.verticalCenter
62 width: units.gu(10)65 text: i18n.tr("Cancel")
63 onClicked: {66 width: units.gu(10)
64 root.cancelClicked();67 onClicked: {
65 }68 root.cancelClicked();
66 }69 }
67 }70 }
68}71}
6972
=== modified file 'tests/autopilot/gallery_app/emulators/album_view.py'
--- tests/autopilot/gallery_app/emulators/album_view.py 2013-06-05 13:15:02 +0000
+++ tests/autopilot/gallery_app/emulators/album_view.py 2013-06-19 18:46:28 +0000
@@ -25,7 +25,7 @@
2525
26 def get_toolbar_add_button(self):26 def get_toolbar_add_button(self):
27 """Returns the add button of the tollbar in the events view."""27 """Returns the add button of the tollbar in the events view."""
28 return self.get_toolbar_button(0)28 return self.get_toolbar_named_toolbarbutton("addButton")
2929
30 def get_first_photo(self):30 def get_first_photo(self):
31 """Returns the first photo in a newly opened album"""31 """Returns the first photo in a newly opened album"""
3232
=== modified file 'tests/autopilot/gallery_app/emulators/albums_view.py'
--- tests/autopilot/gallery_app/emulators/albums_view.py 2013-04-10 15:31:33 +0000
+++ tests/autopilot/gallery_app/emulators/albums_view.py 2013-06-19 18:46:28 +0000
@@ -19,7 +19,7 @@
1919
20 def get_toolbar_add_button(self):20 def get_toolbar_add_button(self):
21 """Returns the add button of the tollbar in the events view."""21 """Returns the add button of the tollbar in the events view."""
22 return self.get_toolbar_button(0)22 return self.get_toolbar_named_toolbarbutton("addButton")
2323
24 def number_of_albums_in_albums_view(self):24 def number_of_albums_in_albums_view(self):
25 """Returns the number of albums shown in albums overview"""25 """Returns the number of albums shown in albums overview"""
2626
=== modified file 'tests/autopilot/gallery_app/emulators/events_view.py'
--- tests/autopilot/gallery_app/emulators/events_view.py 2013-04-10 15:31:33 +0000
+++ tests/autopilot/gallery_app/emulators/events_view.py 2013-06-19 18:46:28 +0000
@@ -17,15 +17,15 @@
1717
18 def get_toolbar_camera_button(self):18 def get_toolbar_camera_button(self):
19 """Returns the camera button of the toolbar in the event view"""19 """Returns the camera button of the toolbar in the event view"""
20 return self.get_toolbar_button(2)20 return self.get_toolbar_named_toolbarbutton("cameraButton")
2121
22 def get_toolbar_select_button(self):22 def get_toolbar_select_button(self):
23 """Returns the select button of the toolbar in the event view"""23 """Returns the select button of the toolbar in the event view"""
24 return self.get_toolbar_button(0)24 return self.get_toolbar_named_toolbarbutton("selectButton")
2525
26 def get_toolbar_delete_button(self):26 def get_toolbar_delete_button(self):
27 """Returns the delete button of the toolbar in the event view"""27 """Returns the delete button of the toolbar in the event view"""
28 return self.get_toolbar_button(1)28 return self.get_toolbar_named_toolbarbutton("deleteButton")
2929
30 def number_of_photos(self):30 def number_of_photos(self):
31 """Returns the number of events"""31 """Returns the number of events"""
3232
=== modified file 'tests/autopilot/gallery_app/emulators/gallery_utils.py'
--- tests/autopilot/gallery_app/emulators/gallery_utils.py 2013-06-14 14:15:56 +0000
+++ tests/autopilot/gallery_app/emulators/gallery_utils.py 2013-06-19 18:46:28 +0000
@@ -72,17 +72,20 @@
72 """Returns the toolbar in the main events view."""72 """Returns the toolbar in the main events view."""
73 return self.app.select_single("Toolbar")73 return self.app.select_single("Toolbar")
7474
75 def get_toolbar_button(self, button_idx):75 def get_toolbar_named_toolbarbutton(self, name):
76 """Returns the button with index idx from the toolbar"""76 """Returns the ToolbarButton with the specified objectName"""
77 toolbar = self.get_toolbar()77 toolbar = self.get_toolbar()
78 buttons = toolbar.select_many("Button")78 return toolbar.select_single("ActionItem", objectName=name)
79 return buttons[button_idx+1]
8079
81 def get_toolbar_cancel_icon(self):80 def get_toolbar_cancel_icon(self):
82 """Returns the cancel icon of the events view."""81 """Returns the cancel icon of the events view."""
83 toolbar = self.get_toolbar()82 toolbar = self.get_toolbar()
84 buttons = toolbar.select_many("Button")83 return toolbar.select_single("Button", objectName="cancelButton", visible=True)
85 return buttons[0]84
85 def get_toolbar_back_icon(self):
86 """Returns the back icon of the toolbar."""
87 toolbar = self.get_toolbar()
88 return toolbar.select_single("ActionItem", objectName="backButton", visible=True)
8689
87 def get_delete_dialog(self):90 def get_delete_dialog(self):
88 """Returns the delete dialog in the events view."""91 """Returns the delete dialog in the events view."""
8992
=== modified file 'tests/autopilot/gallery_app/emulators/media_selector.py'
--- tests/autopilot/gallery_app/emulators/media_selector.py 2013-04-08 14:55:34 +0000
+++ tests/autopilot/gallery_app/emulators/media_selector.py 2013-06-19 18:46:28 +0000
@@ -20,7 +20,8 @@
2020
21 def get_toolbar_add_button(self):21 def get_toolbar_add_button(self):
22 """Returns the add button of the tollbar in the media selector"""22 """Returns the add button of the tollbar in the media selector"""
23 return self.get_toolbar_button(0)23 toolbar = self.get_toolbar()
24 return toolbar.select_single("Button", objectName="addButton")
2425
25 def get_second_photo(self):26 def get_second_photo(self):
26 """Returns the second photo item"""27 """Returns the second photo item"""
2728
=== modified file 'tests/autopilot/gallery_app/emulators/photo_viewer.py'
--- tests/autopilot/gallery_app/emulators/photo_viewer.py 2013-06-05 13:15:02 +0000
+++ tests/autopilot/gallery_app/emulators/photo_viewer.py 2013-06-19 18:46:28 +0000
@@ -15,16 +15,16 @@
1515
16 def get_toolbar_edit_button(self):16 def get_toolbar_edit_button(self):
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"""
18 return self.get_toolbar_button(0)18 return self.get_toolbar_named_toolbarbutton("editButton")
1919
20 def get_toolbar_delete_button(self):20 def get_toolbar_delete_button(self):
21 """Return the delete button of the toolbar when photo viewer is21 """Return the delete button of the toolbar when photo viewer is
22 shown"""22 shown"""
23 return self.get_toolbar_button(2)23 return self.get_toolbar_named_toolbarbutton("deleteButton")
2424
25 def get_toolbar_share_button(self):25 def get_toolbar_share_button(self):
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"""
27 return self.get_toolbar_button(3)27 return self.get_toolbar_named_toolbarbutton("shareButton")
2828
29 def get_delete_dialog(self):29 def get_delete_dialog(self):
30 """Returns the photo viewer delete dialog."""30 """Returns the photo viewer delete dialog."""
3131
=== modified file 'tests/autopilot/gallery_app/emulators/photos_view.py'
--- tests/autopilot/gallery_app/emulators/photos_view.py 2013-04-10 15:31:33 +0000
+++ tests/autopilot/gallery_app/emulators/photos_view.py 2013-06-19 18:46:28 +0000
@@ -23,11 +23,11 @@
2323
24 def get_toolbar_select_button(self):24 def get_toolbar_select_button(self):
25 """Returns the select button of the tollbar in the events view."""25 """Returns the select button of the tollbar in the events view."""
26 return self.get_toolbar_button(0)26 return self.get_toolbar_named_toolbarbutton("selectButton")
2727
28 def get_toolbar_delete_button(self):28 def get_toolbar_delete_button(self):
29 """Returns the delete button of the tollbar in the events view."""29 """Returns the delete button of the tollbar in the events view."""
30 return self.get_toolbar_button(1)30 return self.get_toolbar_named_toolbarbutton("deleteButton")
3131
32 def get_first_photo_in_photos_view(self):32 def get_first_photo_in_photos_view(self):
33 """Returns the very first photo in the photos view."""33 """Returns the very first photo in the photos view."""
3434
=== modified file 'tests/autopilot/gallery_app/tests/test_album_editor.py'
--- tests/autopilot/gallery_app/tests/test_album_editor.py 2013-05-27 10:57:50 +0000
+++ tests/autopilot/gallery_app/tests/test_album_editor.py 2013-06-19 18:46:28 +0000
@@ -127,8 +127,8 @@
127 num_photos_start = self.album_view.number_of_photos()127 num_photos_start = self.album_view.number_of_photos()
128 self.assertThat(num_photos_start, Equals(1))128 self.assertThat(num_photos_start, Equals(1))
129 self.reveal_toolbar()129 self.reveal_toolbar()
130 cancel = self.album_view.get_toolbar_cancel_icon()130 back = self.album_view.get_toolbar_back_icon()
131 self.click_item(cancel)131 self.click_item(back)
132 self.ensure_album_viewer_is_fully_closed()132 self.ensure_album_viewer_is_fully_closed()
133133
134 # now open to add a photo134 # now open to add a photo
135135
=== modified file 'tests/autopilot/gallery_app/tests/test_photo_viewer.py'
--- tests/autopilot/gallery_app/tests/test_photo_viewer.py 2013-06-18 07:56:00 +0000
+++ tests/autopilot/gallery_app/tests/test_photo_viewer.py 2013-06-19 18:46:28 +0000
@@ -54,7 +54,7 @@
54 def test_nav_bar_back_button(self):54 def test_nav_bar_back_button(self):
55 """Clicking the back button must close the photo."""55 """Clicking the back button must close the photo."""
56 photo_viewer = self.photo_viewer.get_main_photo_viewer()56 photo_viewer = self.photo_viewer.get_main_photo_viewer()
57 back_button = self.photo_viewer.get_toolbar_cancel_icon()57 back_button = self.photo_viewer.get_toolbar_back_icon()
58 self.click_item(back_button)58 self.click_item(back_button)
5959
60 self.assertThat(photo_viewer.visible, Eventually(Equals(False)))60 self.assertThat(photo_viewer.visible, Eventually(Equals(False)))

Subscribers

People subscribed via source and target branches