[gnome-music/wip/jfelder/selection-misc-cleanups: 15/20] albumwidget: Rename _listbox to _disc_list_box



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

    albumwidget: Rename _listbox to _disc_list_box
    
    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..75d649ac 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_list_box">
                     <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 3a637aad..8b0a59fe 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_list_box = Gtk.Template.Child()
     _released_info_label = Gtk.Template.Child()
     _running_info_label = Gtk.Template.Child()
     _title_label = Gtk.Template.Child()
@@ -72,7 +72,7 @@ class AlbumWidget(Gtk.EventBox):
         self._player = player
 
         self.bind_property(
-            "selection-mode", self._listbox, "selection-mode",
+            "selection-mode", self._disc_list_box, "selection-mode",
             GObject.BindingFlags.BIDIRECTIONAL
             | GObject.BindingFlags.SYNC_CREATE)
 
@@ -107,7 +107,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_list_box.bind_model(self._album_model, self._create_widget)
 
         self._on_duration_changed(self._corealbum, None)
         self._duration_signal_id = self._corealbum.connect(
@@ -119,7 +119,7 @@ class AlbumWidget(Gtk.EventBox):
         disc_box = self._create_disc_box(
             disc.props.disc_nr, disc.model)
 
-        self._listbox.bind_property(
+        self._disc_list_box.bind_property(
             "selection-mode", disc_box, "selection-mode",
             GObject.BindingFlags.BIDIRECTIONAL
             | GObject.BindingFlags.SYNC_CREATE)
@@ -139,13 +139,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_list_box.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_list_box.get_row_at_index(i)
                 row.props.selectable = False
                 discbox = row.get_child()
                 discbox.props.show_disc_label = True
@@ -187,10 +187,10 @@ class AlbumWidget(Gtk.EventBox):
         return True
 
     def select_all(self):
-        self._listbox.select_all()
+        self._disc_list_box.select_all()
 
     def select_none(self):
-        self._listbox.select_none()
+        self._disc_list_box.select_none()
 
     def _on_selection_mode_changed(self, widget, value):
         if not self.props.selection_mode:


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