ocarina: Single list attrs

I was recreating this list once for each of playlist, library and queue.
I expect it is easier to manage from a single location.
This commit is contained in:
Bryan Schumaker 2011-05-25 23:01:17 -04:00
parent 38b075a701
commit e8f633c863
4 changed files with 4 additions and 6 deletions

View File

@ -13,8 +13,7 @@ def set_label_text():
LIB_PAGE.label.set_text("Library (%s)" % library.num_visible())
def fill_library():
attrs = ("id", "title", "lenstr", "artist", "album", "year")
songs = libsaria.sources.list_library(*attrs)
songs = libsaria.sources.list_library(*sources.column.attrs)
lib_page.insert(songs)
set_label_text()
fill_library()

View File

@ -13,8 +13,7 @@ def set_label_text():
PLAYLIST_PAGE.label.set_text("Playlist (%s)" % playlist.num_visible())
def fill_playlist():
attrs = ("id", "title", "lenstr", "artist", "album", "year")
songs = libsaria.sources.list_playlist(*attrs)
songs = libsaria.sources.list_playlist(*sources.column.attrs)
playlist_page.insert(songs)
set_label_text()
fill_playlist()

View File

@ -19,8 +19,7 @@ def set_visible():
body.show_page(QUEUE_PAGE)
def fill_queue():
attrs = ("id", "title", "lenstr", "artist", "album", "year")
songs = libsaria.sources.list_queue(*attrs)
songs = libsaria.sources.list_queue(*sources.column.attrs)
queue_page.insert(songs)
set_label_text()
set_visible()

View File

@ -2,6 +2,7 @@
import gtk
attrs = ("id", "title", "lenstr", "artist", "album", "year")
columns = ["Id", "Title", "Length", "Artist", "Album", "Year"]
col_width = [ 2, 300, 60, 125, 125, 50]