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:
parent
38b075a701
commit
e8f633c863
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
Loading…
Reference in New Issue