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()) LIB_PAGE.label.set_text("Library (%s)" % library.num_visible())
def fill_library(): def fill_library():
attrs = ("id", "title", "lenstr", "artist", "album", "year") songs = libsaria.sources.list_library(*sources.column.attrs)
songs = libsaria.sources.list_library(*attrs)
lib_page.insert(songs) lib_page.insert(songs)
set_label_text() set_label_text()
fill_library() fill_library()

View File

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

View File

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

View File

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