X-Git-Url: http://git.maemo.org/git/?p=jamaendo;a=blobdiff_plain;f=jamaui%2Fshowartist.py;h=9cae975bd442632538826bb1d4f2d12eadf84c64;hp=ecc857b6f016ccb82bb3d67b428debe5bba565da;hb=44b759cfcfb80d94ddac5ea11302a6f94cb307b4;hpb=d2b935f99c20e44a06663f0bf2c696b2ff911582 diff --git a/jamaui/showartist.py b/jamaui/showartist.py index ecc857b..9cae975 100644 --- a/jamaui/showartist.py +++ b/jamaui/showartist.py @@ -25,42 +25,30 @@ import gtk import hildon import jamaendo from playerwindow import open_playerwindow +from albumlist import AlbumList class ShowArtist(hildon.StackableWindow): def __init__(self, artist): hildon.StackableWindow.__init__(self) - self.set_title("Artist") + self.set_title(artist.name) self.artist = artist self.panarea = hildon.PannableArea() vbox = gtk.VBox(False, 0) - name = gtk.Label() - name.set_markup('%s'%(artist.name)) - vbox.pack_start(name, False) + self.albums = AlbumList() + self.albums.show_artist(False) + self.albums.connect('row-activated', self.row_activated) - self.album_store = gtk.ListStore(str, int) - self.album_view = gtk.TreeView(self.album_store) - col = gtk.TreeViewColumn('Name') - self.album_view.append_column(col) - cell = gtk.CellRendererText() - col.pack_start(cell, True) - col.add_attribute(cell, 'text', 0) - self.album_view.set_search_column(0) - col.set_sort_column_id(0) - self.album_view.connect('row-activated', self.row_activated) - - - self.panarea.add(self.album_view) + self.panarea.add(self.albums) vbox.pack_start(self.panarea, True, True, 0) self.add(vbox) for album in jamaendo.get_albums(artist.ID): - self.album_store.append([album.name, album.ID]) + self.albums.add_album(album) def row_activated(self, treeview, path, view_column): - treeiter = self.album_store.get_iter(path) - title, _id = self.album_store.get(treeiter, 0, 1) + _id = self.albums.get_album_id(path) album = jamaendo.get_album(_id) if isinstance(album, list): album = album[0]