[gnome-music/wip/jfelder/selection-misc-cleanups: 5/7] albumwidget: Rename _listbox to _disc_listbox



commit 16864cf2d1d2d9e0c2d5e92beee2e837373bb0b4
Author: Jean Felder <jfelder src gnome org>
Date:   Thu Jan 9 16:53:22 2020 +0100

    albumwidget: Rename _listbox to _disc_listbox
    
    This should make easier to understand that it represents a
    DiscListBox.

 data/ui/AlbumWidget.ui            |  2 +-
 gnomemusic/widgets/albumwidget.py | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/data/ui/AlbumWidget.ui b/data/ui/AlbumWidget.ui
index d1688ca0..a349d88b 100644
--- a/data/ui/AlbumWidget.ui
+++ b/data/ui/AlbumWidget.ui
@@ -220,7 +220,7 @@
                 <property name="hexpand">True</property>
                 <property name="shadow_type">none</property>
                 <child>
-                  <object class="DiscListBox" id="_listbox">
+                  <object class="DiscListBox" id="_disc_listbox">
                     <property name="can_focus">False</property>
                     <property name="margin_top">64</property>
                     <property name="margin_bottom">64</property>
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index b322ca08..19616db5 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -46,7 +46,7 @@ class AlbumWidget(Gtk.EventBox):
     _composer_label = Gtk.Template.Child()
     _composer_info_label = Gtk.Template.Child()
     _cover_stack = Gtk.Template.Child()
-    _listbox = Gtk.Template.Child()
+    _disc_listbox = Gtk.Template.Child()
     _released_info_label = Gtk.Template.Child()
     _running_info_label = Gtk.Template.Child()
     _title_label = Gtk.Template.Child()
@@ -73,7 +73,7 @@ class AlbumWidget(Gtk.EventBox):
         self._player = player
 
         self.bind_property(
-            "selection-mode", self._listbox, "selection-mode",
+            "selection-mode", self._disc_listbox, "selection-mode",
             GObject.BindingFlags.BIDIRECTIONAL
             | GObject.BindingFlags.SYNC_CREATE)
 
@@ -106,7 +106,7 @@ class AlbumWidget(Gtk.EventBox):
         self._album_model = self._corealbum.props.model
         self._model_signal_id = self._album_model.connect_after(
             "items-changed", self._on_model_items_changed)
-        self._listbox.bind_model(self._album_model, self._create_widget)
+        self._disc_listbox.bind_model(self._album_model, self._create_widget)
 
         self._on_duration_changed(self._corealbum, None)
         self._duration_signal_id = self._corealbum.connect(
@@ -118,7 +118,7 @@ class AlbumWidget(Gtk.EventBox):
         disc_box = self._create_disc_box(
             disc.props.disc_nr, disc.model)
 
-        self._listbox.bind_property(
+        self._disc_listbox.bind_property(
             "selection-mode", disc_box, "selection-mode",
             GObject.BindingFlags.BIDIRECTIONAL
             | GObject.BindingFlags.SYNC_CREATE)
@@ -138,13 +138,13 @@ class AlbumWidget(Gtk.EventBox):
     def _on_model_items_changed(self, model, position, removed, added):
         n_items = model.get_n_items()
         if n_items == 1:
-            row = self._listbox.get_row_at_index(0)
+            row = self._disc_listbox.get_row_at_index(0)
             row.props.selectable = False
             discbox = row.get_child()
             discbox.props.show_disc_label = False
         else:
             for i in range(n_items):
-                row = self._listbox.get_row_at_index(i)
+                row = self._disc_listbox.get_row_at_index(i)
                 row.props.selectable = False
                 discbox = row.get_child()
                 discbox.props.show_disc_label = True
@@ -194,10 +194,10 @@ class AlbumWidget(Gtk.EventBox):
         return True
 
     def select_all(self):
-        self._listbox.select_all()
+        self._disc_listbox.select_all()
 
     def select_none(self):
-        self._listbox.select_none()
+        self._disc_listbox.select_none()
 
     @GObject.Property(
         type=Grl.Media, default=None, flags=GObject.ParamFlags.READABLE)


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