2011-06-18 10:47:00 -04:00
|
|
|
# Bryan Schumaker (6 / 18 / 2011)
|
|
|
|
|
|
|
|
import gtk
|
2011-06-18 11:10:18 -04:00
|
|
|
import libsaria
|
2011-06-18 10:47:00 -04:00
|
|
|
|
|
|
|
page = gtk.VBox()
|
|
|
|
text = "Library"
|
2011-06-18 11:10:18 -04:00
|
|
|
|
|
|
|
def remove_path(button, path):
|
|
|
|
print "Removing:", path
|
|
|
|
|
|
|
|
def add_panel(panel):
|
|
|
|
full_box = gtk.VBox()
|
|
|
|
full_box.pack_start(panel)
|
|
|
|
full_box.pack_start(gtk.HSeparator())
|
|
|
|
full_box.show_all()
|
|
|
|
page.pack_start(full_box, False, False)
|
|
|
|
|
|
|
|
def show_source(path, lib):
|
|
|
|
panel = gtk.HBox()
|
|
|
|
info_box = gtk.VBox()
|
|
|
|
|
|
|
|
path_lbl = gtk.Label()
|
|
|
|
path_lbl.set_markup("<span size='xx-large' weight='bold'>%s</span>" % path)
|
|
|
|
count_lbl = gtk.Label()
|
|
|
|
count_lbl.set_markup("<span size='large'>%s songs</span>" % len(lib))
|
|
|
|
|
|
|
|
remove_button = gtk.Button("Remove", gtk.STOCK_REMOVE)
|
|
|
|
remove_button.connect("clicked", remove_path, path)
|
|
|
|
|
|
|
|
info_box.pack_start(path_lbl)
|
|
|
|
info_box.pack_start(count_lbl)
|
|
|
|
panel.pack_start(info_box)
|
|
|
|
panel.pack_start(remove_button, False, False)
|
|
|
|
add_panel(panel)
|
|
|
|
|
|
|
|
for path, lib in libsaria.sources.library.list_paths():
|
|
|
|
show_source(path, lib)
|