[gnome-music/wip/mschraal/gtk4-v2: 13/65] (TEMPORARY HACK) Disable all views but Album




commit 8c934faaf2090552d62498f7784e5d066894781e
Author: Marinus Schraal <mschraal gnome org>
Date:   Mon Apr 12 17:37:25 2021 +0200

    (TEMPORARY HACK) Disable all views but Album
    
    Easier to work on one thing at a time.

 gnomemusic/window.py | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index b4ca3676d..7767c02c6 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -246,16 +246,18 @@ class Window(Gtk.ApplicationWindow):
             return
 
         self.views[View.ALBUM] = AlbumsView(self._app)
-        self.views[View.ARTIST] = ArtistsView(self._app)
-        self.views[View.SONG] = SongsView(self._app)
-        self.views[View.PLAYLIST] = PlaylistsView(self._app)
-        self.views[View.SEARCH] = SearchView(self._app)
+        self.views[View.ARTIST] = Gtk.Box() # ArtistsView(self._app)
+        self.views[View.SONG] = Gtk.Box() # SongsView(self._app)
+        self.views[View.PLAYLIST] = Gtk.Box() # PlaylistsView(self._app)
+        self.views[View.SEARCH] = Gtk.Box() # SearchView(self._app)
 
         # empty view has already been created in self._setup_view starting at
         # View.ALBUM
         # empty view state is changed once album view is visible to prevent it
         # from being displayed during startup
         for i in self.views[View.ALBUM:]:
+            if isinstance(i, Gtk.Box):
+                continue
             if i.props.title:
                 self._stack.add_titled(i, i.props.name, i.props.title)
             else:
@@ -266,15 +268,15 @@ class Window(Gtk.ApplicationWindow):
         self._stack.props.visible_child = self.views[View.ALBUM]
         self._stack.notify("visible-child")
 
-        self.views[View.SEARCH].bind_property(
-            "search-state", self._search, "state",
-            GObject.BindingFlags.SYNC_CREATE)
-        self._search.bind_property(
-            "search-mode-active", self.views[View.SEARCH],
-            "search-mode-active", GObject.BindingFlags.BIDIRECTIONAL)
-        self._search.bind_property(
-            "search-mode-active", self.views[View.ALBUM],
-            "search-mode-active", GObject.BindingFlags.SYNC_CREATE)
+        # self.views[View.SEARCH].bind_property(
+        #     "search-state", self._search, "state",
+        #     GObject.BindingFlags.SYNC_CREATE)
+        # self._search.bind_property(
+        #     "search-mode-active", self.views[View.SEARCH],
+        #     "search-mode-active", GObject.BindingFlags.BIDIRECTIONAL)
+        # self._search.bind_property(
+        #     "search-mode-active", self.views[View.ALBUM],
+        #     "search-mode-active", GObject.BindingFlags.SYNC_CREATE)
 
     def _select_all(self, action=None, param=None):
         if not self.props.selection_mode:


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