After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742451 - Support Undo when removing playlists
Support Undo when removing playlists
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
3.15.x
Other Linux
: Normal normal
: 3.16
Assigned To: gnome-music-maint
gnome-music-maint
Depends on:
Blocks:
 
 
Reported: 2015-01-06 12:51 UTC by Vadim Rutkovsky
Modified: 2015-02-12 17:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow undo action to user (5.22 KB, patch)
2015-01-08 13:50 UTC, Sagar Ghuge
needs-work Details | Review
Allow undo action to user (5.03 KB, patch)
2015-01-09 12:38 UTC, Sagar Ghuge
none Details | Review
bugfix for 'undo playlist deletion': now playlist ACTUALLY deleted from tracker (1.41 KB, patch)
2015-02-12 17:16 UTC, Maia
none Details | Review

Description Vadim Rutkovsky 2015-01-06 12:51:30 UTC
Mimic Contacts \ Documents behaviour when removing playlist:
 - instead of remove simply hide playlist from the list
 - show notification with undo button
 - if user doesn't click Undo in 20 secs - run the query to actually remove the playlist from tracker DB
Comment 1 Sagar Ghuge 2015-01-08 13:50:32 UTC
Created attachment 294082 [details] [review]
Allow undo action to user
Comment 2 Vadim Rutkovsky 2015-01-08 14:00:53 UTC
Review of attachment 294082 [details] [review]:

::: gnomemusic/view.py
@@ +852,3 @@
         self.iter_to_clean_model = None
         self.current_playlist = None
+        self.pl_todelete = None

We store all the playlists about to be deleted, not just the last one

::: gnomemusic/window.py
@@ +77,3 @@
         self.prev_view = None
         self.curr_view = None
+        self.really_delete = True

Can we move this part to Playlist? No other view uses notifications (at least yet), so we don't need to clobber this window class with weirdly looking variables

@@ +306,3 @@
+    def _init_notification(self):
+        self.notification = Gd.Notification()
+        self.notification.set_timeout(5)

Timeout should be 20 secs, as a user might miss it

@@ +313,3 @@
+
+        undo_button = Gtk.Button.new_with_mnemonic(_("_Undo"))
+        label = _("Playlist Deleted : %s" %(

See other gnome apps: the text should be smth like 'Playlist <name> removed'
Comment 3 Sagar Ghuge 2015-01-09 12:38:22 UTC
Created attachment 294155 [details] [review]
Allow undo action to user
Comment 4 Vadim Rutkovsky 2015-01-19 11:23:00 UTC
Thanks, pushed to master as https://git.gnome.org/browse/gnome-music/commit/?id=0fe6116
Comment 5 Maia 2015-02-12 17:16:43 UTC
Created attachment 296696 [details] [review]
bugfix for 'undo playlist deletion': now playlist ACTUALLY deleted from tracker