[gnome-music/wip/mschraal/core] searchview: Add select all/none for artist



commit 92beb80f685f467e4fef99756fade3b90d2aca4d
Author: Marinus Schraal <mschraal gnome org>
Date:   Mon Jul 1 14:29:16 2019 +0200

    searchview: Add select all/none for artist

 gnomemusic/views/searchview.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index 00eadd3b..dc87a1f4 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -182,6 +182,11 @@ class SearchView(BaseView):
         song_widget.props.show_song_number = False
         song_widget.coreartist = coresong
 
+        coresong.bind_property(
+            "selected", song_widget, "selected",
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
+
         self.bind_property(
             "selection-mode", song_widget, "selection-mode",
             GObject.BindingFlags.BIDIRECTIONAL
@@ -263,8 +268,13 @@ class SearchView(BaseView):
             def album_select(child):
                 child.props.selected = value
 
+            def artist_select(child):
+                artist_widget = child.get_child()
+                artist_widget.props.selected = value
+
             self._songs_listbox.foreach(song_select)
             self._album_flowbox.foreach(album_select)
+            self._artist_listbox.foreach(artist_select)
 
     def select_all(self):
         self._select_all(True)


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