[gnome-music/gbsneto/untangle-player-window-mpris: 2/6] window: Initialize Player at __init__



commit 8108546924714b74c6329476b225922ff06fca8a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Apr 10 11:51:39 2019 -0300

    window: Initialize Player at __init__
    
    Next patch will make Player receive the GtkApplication
    as a construct-time argument, and Window._setup_view
    does not have direct access to it. So move the creation
    of Player to __init__, which has an explicit "app"
    variable, so that it can be used later.

 gnomemusic/window.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index a35d5a05..5abe6db3 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -87,6 +87,8 @@ class Window(Gtk.ApplicationWindow):
         self.prev_view = None
         self.curr_view = None
 
+        self._player = Player(self)
+
         self.notifications_popup = NotificationsPopup()
         self._setup_view()
 
@@ -134,7 +136,6 @@ class Window(Gtk.ApplicationWindow):
             "state", self._searchbar, "search-state",
             GObject.BindingFlags.SYNC_CREATE)
 
-        self._player = Player(self)
         self._player_toolbar = PlayerToolbar(self._player, self)
         selection_toolbar = SelectionToolbar()
         self.views = [None] * len(View)


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