Commit 87ef5d9f authored by Jean Felder's avatar Jean Felder

playlistcontrols: Stop a deleted playlist if it is playing

On a playlist deletion, stop the the player and hide the player
toolbar if the player playlist is the playlist which is deleted.

This feature was lost during the core rewrite.
parent 8e5e576c
......@@ -82,6 +82,7 @@ class PlaylistControls(Gtk.Grid):
return
self._coremodel = application.props.coremodel
self._player = application.props.player
self._window = application.props.window
self._window.add_action(self._delete_action)
......@@ -89,17 +90,16 @@ class PlaylistControls(Gtk.Grid):
self._window.add_action(self._rename_action)
def _on_delete_action(self, menutime, data=None):
active_playlist = self._coremodel.props.active_playlist
if (active_playlist is not None
and active_playlist == self.props.playlist):
self._player.stop()
self._window.set_player_visible(False)
PlaylistNotification(
self._window.notifications_popup, self._coremodel,
PlaylistNotification.Type.PLAYLIST, self.props.playlist)
# FIXME: Should Check that the playlist is not playing
# playlist_id = selection.playlist.props.pl_id
# if self._player.playing_playlist(
# PlayerPlaylist.Type.PLAYLIST, playlist_id):
# self._player.stop()
# self._window.set_player_visible(False)
@Gtk.Template.Callback()
def _on_rename_entry_changed(self, selection):
selection_length = selection.props.text_length
......
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