[gnome-music/wip/mschraal/core: 64/92] artistsview: Respond to click without crash



commit 5d1720a721a4062970cced007389f5c540135c11
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri May 31 14:36:14 2019 +0200

    artistsview: Respond to click without crash

 gnomemusic/views/artistsview.py  | 3 +++
 gnomemusic/widgets/sidebarrow.py | 2 ++
 2 files changed, 5 insertions(+)
---
diff --git a/gnomemusic/views/artistsview.py b/gnomemusic/views/artistsview.py
index e74d6d15..2b02de0a 100644
--- a/gnomemusic/views/artistsview.py
+++ b/gnomemusic/views/artistsview.py
@@ -80,6 +80,7 @@ class ArtistsView(BaseView):
 
     def _create_widget(self, artist):
         row = SidebarRow()
+        row.props.artist = artist
         row.props.text = artist.props.artist
 
         return row
@@ -114,6 +115,8 @@ class ArtistsView(BaseView):
             row.props.selected = not row.props.selected
             return
 
+        print(row.props.artist.props.artist, row, row.get_child())
+        return
         self._last_selected_row = row
         artist = row.props.text
         albums = self._artists[artist.casefold()]['albums']
diff --git a/gnomemusic/widgets/sidebarrow.py b/gnomemusic/widgets/sidebarrow.py
index 798faaf2..c72007e5 100644
--- a/gnomemusic/widgets/sidebarrow.py
+++ b/gnomemusic/widgets/sidebarrow.py
@@ -25,6 +25,7 @@
 from gi.repository import GObject, Gtk
 
 from gnomemusic import log
+from gnomemusic.coreartist import CoreArtist
 
 
 @Gtk.Template(resource_path='/org/gnome/Music/ui/SidebarRow.ui')
@@ -40,6 +41,7 @@ class SidebarRow(Gtk.ListBoxRow):
     _label = Gtk.Template.Child()
     _revealer = Gtk.Template.Child()
 
+    artist = GObject.Property(type=CoreArtist, default=None)
     selected = GObject.Property(type=bool, default=False)
     selection_mode = GObject.Property(type=bool, default=False)
     text = GObject.Property(type=str, default='')


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