[gnome-music/wip/mschraal/core] searchview: Disconnect enough stuff so it does not crash



commit 3897d7452996b3cd3ca452728d481ec60dfb2deb
Author: Marinus Schraal <mschraal gnome org>
Date:   Sun Jun 30 22:40:25 2019 +0200

    searchview: Disconnect enough stuff so it does not crash

 gnomemusic/views/searchview.py | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index 214647d5..597c8996 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -54,7 +54,7 @@ class SearchView(BaseView):
     def __init__(self, window, player):
         super().__init__('search', None, window)
 
-        self._add_list_renderers()
+        # self._add_list_renderers()
         self.player = player
         self._head_iters = [None, None, None, None]
         self._filter_model = None
@@ -85,27 +85,28 @@ class SearchView(BaseView):
         self._items_found = None
 
         self._search_mode_active = False
-        self.connect("notify::search-state", self._on_search_state_changed)
+        # self.connect("notify::search-state", self._on_search_state_changed)
 
     @log
     def _setup_view(self):
         view_container = Gtk.ScrolledWindow(hexpand=True, vexpand=True)
         self._box.pack_start(view_container, True, True, 0)
 
-        self._view = Gtk.TreeView(
-            activate_on_single_click=True, can_focus=False,
-            halign=Gtk.Align.CENTER, headers_visible=False,
-            show_expanders=False, width_request=530)
-        self._view.get_style_context().add_class('view')
-        self._view.get_style_context().add_class('content-view')
-        self._view.get_selection().props.mode = Gtk.SelectionMode.NONE
-        self._view.connect('row-activated', self._on_item_activated)
+        self._view = Gtk.Box()
+        # self._view = Gtk.TreeView(
+        #     activate_on_single_click=True, can_focus=False,
+        #     halign=Gtk.Align.CENTER, headers_visible=False,
+        #     show_expanders=False, width_request=530)
+        # self._view.get_style_context().add_class('view')
+        # self._view.get_style_context().add_class('content-view')
+        # self._view.get_selection().props.mode = Gtk.SelectionMode.NONE
+        # self._view.connect('row-activated', self._on_item_activated)
 
-        self._ctrl = Gtk.GestureMultiPress().new(self._view)
-        self._ctrl.props.propagation_phase = Gtk.PropagationPhase.CAPTURE
-        self._ctrl.connect("released", self._on_view_clicked)
+        # self._ctrl = Gtk.GestureMultiPress().new(self._view)
+        # self._ctrl.props.propagation_phase = Gtk.PropagationPhase.CAPTURE
+        # self._ctrl.connect("released", self._on_view_clicked)
 
-        view_container.add(self._view)
+        # view_container.add(self._view)
 
     @log
     def _back_button_clicked(self, widget, data=None):
@@ -213,6 +214,7 @@ class SearchView(BaseView):
     @log
     def _on_selection_mode_changed(self, widget, data=None):
         super()._on_selection_mode_changed(widget, data)
+        return
 
         col = self._view.get_columns()[0]
         cells = col.get_cells()
@@ -558,6 +560,8 @@ class SearchView(BaseView):
 
     @log
     def set_search_text(self, search_term, fields_filter):
+        return
+
         query_matcher = {
             'album': {
                 'search_all': Query.get_albums_with_any_match,


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