from download_dialog import MussorgskyAlbumArtDownloadDialog
def escape_html (text):
- return text.replace ("&","&").replace ("<", "<").replace (">", ">").replace ("\"", ""e;")
+ if (len (text) > 40):
+ cutpoint = text.find (' ', 30)
+ if (cutpoint == -1 or cutpoint > 40):
+ cutpoint = 40
+ text = text [0:cutpoint] + "..."
+ return text.replace ("&","&").replace ("<", "<").replace (">", ">").replace ("\"", """)
class MussorgskyAlbumArtPanel (hildon.StackableWindow):
continue
album_art_path = getCoverArtThumbFileName (p[1])
try:
- pixbuf = gtk.gdk.pixbuf_new_from_file_at_size (album_art_path, 124, 124)
+ pixbuf = gtk.gdk.pixbuf_new_from_file_at_size (album_art_path, 64, 64)
except gobject.GError:
pixbuf = None
t = ("<b>%s</b>\n<small>%s</small>" % (escape_html(p[1]), escape_html(p[0])), pixbuf, p[0], p[1])
self.treeview.connect ("row-activated", self.row_activated_cb)
artist_column = gtk.TreeViewColumn ("Artist", gtk.CellRendererText (), markup=0)
+ artist_column.set_expand (True)
self.treeview.append_column (artist_column)
album_art = gtk.TreeViewColumn ("Album art", gtk.CellRendererPixbuf (), pixbuf=1)
self.treeview.append_column (album_art)
- vbox.add (self.treeview)
-
- self.add (vbox)
+ #vbox.add (self.treeview)
+
+ pannable_area = hildon.PannableArea ()
+ pannable_area.add (self.treeview)
+ self.add (pannable_area)
# Menu
menu = hildon.AppMenu ()
if __name__ == "__main__":
- artists_albums = [("Artist &%d" % i, "Album <%d>" % i) for i in range (0, 100)]
+ artists_albums = [("Artist %d the greatest bolero singer in the universe" % i, "Album <%d>" % i) for i in range (0, 100)]
window = MussorgskyAlbumArtPanel (artists_albums)
self.show_edit_panel (list_songs, list_albums, list_artists)
def album_art_clicked (self, widget):
- panel = MussorgskyAlbumArtPanel ()
+ artists_albums = self.tracker.get_all_pairs_artist_album ()
+ panel = MussorgskyAlbumArtPanel (artists_albums)
panel.show_all ()
def create_main_view (self):