[gnome-music/wip/mschraal/albumsview-selection-rework: 28/33] searchview: Route selections via coreobjects
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/albumsview-selection-rework: 28/33] searchview: Route selections via coreobjects
- Date: Sun, 19 Sep 2021 11:23:17 +0000 (UTC)
commit e6d54354c495ffc16d0b738cc875009e4180c1ab
Author: Marinus Schraal <mschraal gnome org>
Date: Sat Sep 11 12:11:57 2021 +0200
searchview: Route selections via coreobjects
See previous commit.
gnomemusic/views/searchview.py | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index bea60950d..4083f49b2 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -443,24 +443,23 @@ class SearchView(Gtk.Stack):
self.props.visible_child = self._all_search_results
self.props.search_mode_active = False
- def _select_all(self, value):
- def child_select(child):
- child.props.selected = value
-
+ def _select_all(self, value: bool) -> None:
if self.props.state == SearchView.State.MAIN:
with self._model.freeze_notify():
- def song_select(child):
- child.props.coresong.props.selected = value
-
- self._songs_listbox.foreach(song_select)
- self._album_flowbox.foreach(child_select)
- self._artist_flowbox.foreach(child_select)
+ for coresong in self._model:
+ coresong.props.selected = value
+ for corealbum in self._album_model:
+ corealbum.props.selected = value
+ for coreartist in self._artist_model:
+ coreartist.props.selected = value
elif self.props.state == SearchView.State.ALL_ALBUMS:
with self._model.freeze_notify():
- self._album_all_flowbox.foreach(child_select)
+ for corealbum in self._album_model:
+ corealbum.props.selected = value
elif self.props.state == SearchView.State.ALL_ARTISTS:
with self._model.freeze_notify():
- self._artist_all_flowbox.foreach(child_select)
+ for corealbum in self._album_model:
+ corealbum.props.selected = value
elif self.props.state == SearchView.State.ALBUM:
view = self._album_widget
if value is True:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]