[gnome-music/wip/mschraal/disclistbox-cleanup: 6/9] disclistboxwidget: Remove old selection functions



commit 6a9f7b17bf639d901a988a7b1395ebf021c5b3e7
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Jul 18 17:53:16 2019 +0200

    disclistboxwidget: Remove old selection functions
    
    This is now handled differently.

 gnomemusic/widgets/disclistboxwidget.py | 44 ---------------------------------
 1 file changed, 44 deletions(-)
---
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index c911aa1a..c828dc06 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -42,7 +42,6 @@ class DiscBox(Gtk.Box):
     _list_box = Gtk.Template.Child()
 
     __gsignals__ = {
-        'selection-changed': (GObject.SignalFlags.RUN_FIRST, None, ()),
         'song-activated': (GObject.SignalFlags.RUN_FIRST, None, (Gtk.Widget,))
     }
 
@@ -71,8 +70,6 @@ class DiscBox(Gtk.Box):
             GObject.BindingFlags.SYNC_CREATE)
 
         self._selection_mode_allowed = True
-        self._selected_items = []
-        self._songs = []
 
         self._list_box.bind_model(self._model, self._create_widget)
 
@@ -85,14 +82,6 @@ class DiscBox(Gtk.Box):
         self._disc_label.props.label = _("Disc {}").format(disc_number)
         self._disc_label.props.visible = True
 
-    def get_selected_items(self):
-        """Return all selected items
-
-        :returns: The selected items:
-        :rtype: A list if Grilo media items
-        """
-        return []
-
     def select_all(self):
         """Select all songs"""
         def child_select_all(child):
@@ -111,7 +100,6 @@ class DiscBox(Gtk.Box):
 
     def _create_widget(self, coresong):
         song_widget = SongWidget(coresong)
-        self._songs.append(song_widget)
 
         self.bind_property(
             "selection-mode", song_widget, "selection-mode",
@@ -122,17 +110,6 @@ class DiscBox(Gtk.Box):
 
         return song_widget
 
-    @log
-    def _on_selection_changed(self, widget):
-        self.emit('selection-changed')
-
-        return True
-
-    @log
-    def _toggle_widget_selection(self, child):
-        song_widget = child.get_child()
-        song_widget.props.selection_mode = self.props.selection_mode
-
     @log
     def _song_activated(self, widget, event):
         mod_mask = Gtk.accelerator_get_default_mod_mask()
@@ -160,10 +137,6 @@ class DiscListBox(Gtk.ListBox):
     """
     __gtype_name__ = 'DiscListBox'
 
-    __gsignals__ = {
-        'selection-changed': (GObject.SignalFlags.RUN_FIRST, None, ()),
-    }
-
     selection_mode_allowed = GObject.Property(type=bool, default=False)
 
     def __repr__(self):
@@ -176,26 +149,9 @@ class DiscListBox(Gtk.ListBox):
 
         self.props.valign = Gtk.Align.START
         self._selection_mode = False
-        self._selected_items = []
 
         self.get_style_context().add_class("disc-list-box")
 
-    @log
-    def get_selected_items(self):
-        """Returns all selected items for all discs
-
-        :returns: All selected items
-        :rtype: A list if Grilo media items
-        """
-        self._selected_items = []
-
-        def get_child_selected_items(child):
-            self._selected_items += child.get_selected_items()
-
-        self.foreach(get_child_selected_items)
-
-        return self._selected_items
-
     @log
     def select_all(self):
         """Select all songs"""


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