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())
|
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()
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue