[gnome-music/wip/jfelder/selection-misc-cleanups: 1/3] albumwidget: Rename _listbox to _disc_list_box
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/selection-misc-cleanups: 1/3] albumwidget: Rename _listbox to _disc_list_box
- Date: Thu, 9 Jan 2020 19:51:54 +0000 (UTC)
commit d09bf2862051d27ae17b9dc12eebd440f22a1958
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 b322ca08..3c17899a 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()
@@ -73,7 +73,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)
@@ -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_list_box.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_list_box.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_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
@@ -194,10 +194,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()
@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]