GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit f312ad1b authored by Konstantin Pospelov's avatar Konstantin Pospelov Committed by Marinus Schraal

window: Do not remove static playlists when pressing Delete

The Delete action is disabled for static playlists, however there is an
inconsistency, because it's still possible to remove such a playlist using
the Delete key.

This patch introduces a wrapper over the _on_delete_activate method to
ignore static playlists when pressing the Delete key.

https://bugzilla.gnome.org/show_bug.cgi?id=771249
parent df89b9bf
......@@ -1300,6 +1300,11 @@ class Playlist(ViewContainer):
self._populate()
@log
def remove_playlist(self):
if not self.current_playlist_is_protected():
self._on_delete_activate(None)
@log
def _on_playlist_activated(self, widget, item_id, path):
_iter = self.playlists_model.get_iter(path)
......
......@@ -429,7 +429,7 @@ class Window(Gtk.ApplicationWindow):
else:
if (event.keyval == Gdk.KEY_Delete):
if self._stack.get_visible_child() == self.views[3]:
self.views[3]._on_delete_activate(None)
self.views[3].remove_playlist()
# Close search bar after Esc is pressed
if event.keyval == Gdk.KEY_Escape:
self.toolbar.searchbar.show_bar(False)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment