Merge lp:~phablet-team/gallery-app/delete-album-on-cancel-add into lp:gallery-app

Proposed by Ugo Riboni
Status: Merged
Approved by: Arthur Mello
Approved revision: 1103
Merged at revision: 1103
Proposed branch: lp:~phablet-team/gallery-app/delete-album-on-cancel-add
Merge into: lp:gallery-app
Diff against target: 61 lines (+19/-2)
3 files modified
rc/qml/AlbumEditor/AlbumEditor.qml (+1/-1)
rc/qml/AlbumEditor/AlbumEditorAnimated.qml (+4/-0)
tests/autopilot/gallery_app/tests/test_albums_view.py (+14/-1)
To merge this branch: bzr merge lp:~phablet-team/gallery-app/delete-album-on-cancel-add
Reviewer Review Type Date Requested Status
Arthur Mello (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+238129@code.launchpad.net

Commit message

Delete the new empty album if the album editor is closed by clicking outside of the album cover

Description of the change

Delete the new empty album if the album editor is closed by clicking outside of the album cover

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

lgtm.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'rc/qml/AlbumEditor/AlbumEditor.qml'
--- rc/qml/AlbumEditor/AlbumEditor.qml 2014-09-06 21:08:57 +0000
+++ rc/qml/AlbumEditor/AlbumEditor.qml 2014-10-13 10:33:43 +0000
@@ -132,7 +132,7 @@
132 onWidthChanged: resetEditorRect()132 onWidthChanged: resetEditorRect()
133 onHeightChanged: resetEditorRect()133 onHeightChanged: resetEditorRect()
134134
135 AlbumCollectionModel {135 property AlbumCollectionModel model: AlbumCollectionModel {
136 id: albumModel136 id: albumModel
137 }137 }
138138
139139
=== modified file 'rc/qml/AlbumEditor/AlbumEditorAnimated.qml'
--- rc/qml/AlbumEditor/AlbumEditorAnimated.qml 2014-05-19 13:28:40 +0000
+++ rc/qml/AlbumEditor/AlbumEditorAnimated.qml 2014-10-13 10:33:43 +0000
@@ -71,6 +71,10 @@
7171
72 onCloseRequested: {72 onCloseRequested: {
73 root.isOpen = false;73 root.isOpen = false;
74 if (album && album.newAlbum && album.containedCount == 0) {
75 inner_albumEditor.model.destroyAlbum(album);
76 album = null;
77 }
74 if (album) {78 if (album) {
75 inner_albumEditorTransition.exitEditor(album, root.origin);79 inner_albumEditorTransition.exitEditor(album, root.origin);
76 } else {80 } else {
7781
=== modified file 'tests/autopilot/gallery_app/tests/test_albums_view.py'
--- tests/autopilot/gallery_app/tests/test_albums_view.py 2014-08-27 02:41:33 +0000
+++ tests/autopilot/gallery_app/tests/test_albums_view.py 2014-10-13 10:33:43 +0000
@@ -68,8 +68,10 @@
6868
69 def test_add_album_and_cancel(self):69 def test_add_album_and_cancel(self):
70 """Add one album, cancel it and checks if the number of albums does70 """Add one album, cancel it and checks if the number of albums does
71 not change71 not change. Do this in the two different ways we have to cancel editing.
72 """72 """
73
74 # Cancel by pressing back in the header
73 albums = self.albums_view.number_of_albums_in_albums_view()75 albums = self.albums_view.number_of_albums_in_albums_view()
74 self.main_view.get_header().click_action_button("addButton")76 self.main_view.get_header().click_action_button("addButton")
75 editor = self.app.select_single(album_editor.AlbumEditor)77 editor = self.app.select_single(album_editor.AlbumEditor)
@@ -80,6 +82,17 @@
80 Eventually(Equals(albums))82 Eventually(Equals(albums))
81 )83 )
8284
85 # Cancel by clicking outside of the album cover
86 self.main_view.get_header().click_action_button("addButton")
87 editor = self.app.select_single(album_editor.AlbumEditor)
88 editor.ensure_fully_open()
89 editor.close()
90
91 self.assertThat(
92 lambda: self.albums_view.number_of_albums_in_albums_view(),
93 Eventually(Equals(albums))
94 )
95
83 # Check if Camera Button is not visible at Desktop mode96 # Check if Camera Button is not visible at Desktop mode
84 def test_camera_button_visible(self):97 def test_camera_button_visible(self):
85 cameraButtonVisible = self.check_header_button_exist("cameraButton")98 cameraButtonVisible = self.check_header_button_exist("cameraButton")

Subscribers

People subscribed via source and target branches

to all changes: