[gnome-music] disclistbox: Simplify code
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] disclistbox: Simplify code
- Date: Sun, 27 Nov 2016 11:47:33 +0000 (UTC)
commit 8b28e9777a95860a074351cb208680d06199cced
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun Nov 27 11:24:10 2016 +0100
disclistbox: Simplify code
Instead of using the GtkListBox's specific ::insert(), use
the add() function from GtkContainer.
This will simplify the transition from GtkListBox to GtkBox
in the future.
gnomemusic/widgets/albumwidget.py | 2 +-
gnomemusic/widgets/disclistboxwidget.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index 1a16543..3003353 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -285,7 +285,7 @@ class AlbumWidget(Gtk.EventBox):
discs[disc_nr].append(track)
for disc_nr in discs:
disc = self._create_disc_box(disc_nr, discs[disc_nr])
- self._disc_listbox.insert(disc, -1)
+ self._disc_listbox.add(disc)
if len(discs) == 1:
disc.show_disc_label(False)
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index 6c742ae..5a7179c 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -444,9 +444,9 @@ class DiscListBox(Gtk.ListBox):
self._selected_items = []
@log
- def insert(self, widget, position):
+ def add(self, widget):
"""Insert a DiscBox widget"""
- super().insert(widget, position)
+ super().add(widget)
widget.connect('selection-changed', self._on_selection_changed)
@log
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]