Merge lp:~doflah/gallery-app/reuse_delete_dialog into lp:gallery-app

Proposed by Dennis O'Flaherty
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~doflah/gallery-app/reuse_delete_dialog
Merge into: lp:gallery-app
Diff against target: 103 lines (+6/-45)
3 files modified
rc/qml/MediaViewer/MediaViewer.qml (+4/-21)
tests/autopilot/gallery_app/emulators/photo_viewer.py (+0/-22)
tests/autopilot/gallery_app/tests/test_photo_viewer.py (+2/-2)
To merge this branch: bzr merge lp:~doflah/gallery-app/reuse_delete_dialog
Reviewer Review Type Date Requested Status
Arthur Mello (community) Needs Fixing
Review via email: mp+218541@code.launchpad.net

Description of the change

One of the delete dialogs didn't have the correct color scheme. This patch fixes it: ok -> orange, cancel -> gray.

To post a comment you must log in.
Revision history for this message
Arthur Mello (artmello) wrote :

We now have two delete dialog options, the old one changed by this MR and a new one, for when the photo is inside an album. Would be good to update both of them to have this feature.

review: Needs Fixing
Revision history for this message
Sebastien Bacher (seb128) wrote :

the issue is resolved, rejecting the change it's not needed

Unmerged revisions

955. By Dennis O'Flaherty

Use the DeleteDialog in the PhotoViewer for consistency

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rc/qml/MediaViewer/MediaViewer.qml'
2--- rc/qml/MediaViewer/MediaViewer.qml 2014-04-23 14:24:04 +0000
3+++ rc/qml/MediaViewer/MediaViewer.qml 2014-05-07 02:45:34 +0000
4@@ -280,34 +280,17 @@
5
6 Component {
7 id: deleteDialog
8- Dialog {
9- id: dialogue
10- objectName: "deletePhotoDialog"
11+ DeleteDialog {
12 title: i18n.tr("Delete a photo")
13
14- function finishRemove() {
15+ onDeleteClicked: {
16+ viewerWrapper.model.destroyMedia(galleryPhotoViewer.media, true);
17+ galleryPhotoViewer.currentIndexChanged();
18 if (!album === undefined)
19 return;
20 if (model.count === 0)
21 galleryPhotoViewer.closeRequested();
22 }
23-
24- Button {
25- objectName: "deletePhotoDialogYes"
26- text: i18n.tr("Yes")
27- color: Gallery.HIGHLIGHT_BUTTON_COLOR
28- onClicked: {
29- PopupUtils.close(dialogue)
30- viewerWrapper.model.destroyMedia(galleryPhotoViewer.media, true);
31- galleryPhotoViewer.currentIndexChanged();
32- dialogue.finishRemove();
33- }
34- }
35- Button {
36- objectName: "deletePhotoDialogNo"
37- text: i18n.tr("No")
38- onClicked: PopupUtils.close(dialogue)
39- }
40 }
41 }
42
43
44=== modified file 'tests/autopilot/gallery_app/emulators/photo_viewer.py'
45--- tests/autopilot/gallery_app/emulators/photo_viewer.py 2014-05-01 15:27:13 +0000
46+++ tests/autopilot/gallery_app/emulators/photo_viewer.py 2014-05-07 02:45:34 +0000
47@@ -14,16 +14,6 @@
48 super(PhotoViewer, self).__init__(self)
49 self.app = app
50
51- def get_delete_dialog(self):
52- """Returns the photo viewer delete dialog."""
53- return self.app.wait_select_single("Dialog",
54- objectName="deletePhotoDialog")
55-
56- def delete_dialog_shown(self):
57- dialog = self.app.select_many("Dialog",
58- objectName="deletePhotoDialog")
59- return len(dialog) >= 1
60-
61 def get_popup_album_picker(self):
62 """Returns the photo viewer album pickers."""
63 return self.app.wait_select_single("PopupAlbumPicker",
64@@ -75,18 +65,6 @@
65 """Returns the 'auto enhance' menu item in the edit dialog."""
66 return self.app.select_single("Standard", objectName='enhanceListItem')
67
68- def get_delete_popover_delete_item(self):
69- """Returns the delete button of the delete popover."""
70- return self.app.select_single("Button",
71- objectName="deletePhotoDialogYes",
72- visible=True)
73-
74- def get_delete_popover_cancel_item(self):
75- """Returns the cancel button of the delete popover."""
76- return self.app.select_single("Button",
77- objectName="deletePhotoDialogNo",
78- visible=True)
79-
80 def get_opened_photo(self):
81 """Returns the first opened photo."""
82 return self.app.wait_select_single("ZoomablePhotoComponent",
83
84=== modified file 'tests/autopilot/gallery_app/tests/test_photo_viewer.py'
85--- tests/autopilot/gallery_app/tests/test_photo_viewer.py 2014-05-01 15:27:13 +0000
86+++ tests/autopilot/gallery_app/tests/test_photo_viewer.py 2014-05-07 02:45:34 +0000
87@@ -112,7 +112,7 @@
88 def delete_one_picture(self):
89 self.main_view.open_toolbar().click_button("deleteButton")
90 self.get_delete_dialog()
91- delete_item = self.photo_viewer.get_delete_popover_delete_item()
92+ delete_item = self.gallery_utils.get_delete_dialog_delete_button()
93 self.click_item(delete_item)
94 self.ensure_closed_delete_dialog()
95
96@@ -123,7 +123,7 @@
97
98 photo_viewer = self.photo_viewer.get_main_photo_viewer()
99
100- cancel_item = self.photo_viewer.get_delete_popover_cancel_item()
101+ cancel_item = self.photo_viewer.get_delete_dialog_cancel_button()
102 self.click_item(cancel_item)
103 self.ensure_closed_delete_dialog()
104

Subscribers

People subscribed via source and target branches