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



commit 9d8d29591e7720510f1bd88f198a083c6e6d3658
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 cf23693d..7cb3f62b 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -179,6 +179,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
@@ -260,8 +265,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]