[gnome-music/wip/mschraal/playlistcontrols-actions-rework: 9/12] playlistcontrols: Move playlist_rename action creation



commit d3f4ccd6f9c094db29c788af9490a6dce839a1ca
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Jan 5 14:35:16 2020 +0100

    playlistcontrols: Move playlist_rename action creation

 gnomemusic/views/playlistsview.py      | 4 ----
 gnomemusic/widgets/playlistcontrols.py | 3 ++-
 2 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/views/playlistsview.py b/gnomemusic/views/playlistsview.py
index e4b4f786..9a5c4878 100644
--- a/gnomemusic/views/playlistsview.py
+++ b/gnomemusic/views/playlistsview.py
@@ -78,10 +78,6 @@ class PlaylistsView(BaseView):
             'activate', self._stage_song_for_deletion)
         self._window.add_action(self._remove_song_action)
 
-        self._playlist_rename_action = Gio.SimpleAction.new(
-            'playlist_rename', None)
-        self._window.add_action(self._playlist_rename_action)
-
         self._pl_ctrls = PlaylistControls(application)
         self._grid.insert_row(0)
         self._grid.attach(self._pl_ctrls, 1, 0, 1, 1)
diff --git a/gnomemusic/widgets/playlistcontrols.py b/gnomemusic/widgets/playlistcontrols.py
index 86c270a8..4c553fca 100644
--- a/gnomemusic/widgets/playlistcontrols.py
+++ b/gnomemusic/widgets/playlistcontrols.py
@@ -63,8 +63,9 @@ class PlaylistControls(Gtk.Grid):
         self._play_action = Gio.SimpleAction.new("playlist_play", None)
         self._window.add_action(self._play_action)
 
-        self._rename_action = self._window.lookup_action("playlist_rename")
+        self._rename_action = Gio.SimpleAction.new("playlist_rename", None)
         self._rename_action.connect("activate", self._on_rename_action)
+        self._window.add_action(self._rename_action)
 
     def _on_rename_action(self, menuitem, data=None):
         self._enable_rename_playlist(self.props.playlist)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]