Ocarina: Playlist and library tabs
I've readded these tabs, but I don't fill them in yet. That'll wait until I rewrite sources.
This commit is contained in:
parent
b2db7d3327
commit
d20d4c3fcd
|
@ -21,6 +21,9 @@ def quit(window, event):
|
|||
|
||||
import window
|
||||
|
||||
import playlist
|
||||
import library
|
||||
|
||||
libsaria.startup()
|
||||
print "Startup took:", uptime()
|
||||
gtk.main()
|
||||
|
|
|
@ -15,6 +15,12 @@ class OcarinaPage(gtk.Table):
|
|||
self.attach_center(content)
|
||||
self.show()
|
||||
|
||||
def visible(self):
|
||||
pass
|
||||
|
||||
def invisible(self):
|
||||
pass
|
||||
|
||||
def attach_top(self, content):
|
||||
self.attach(content, 0, 1, 0, 1, GROW, SHRINK)
|
||||
|
||||
|
|
|
@ -1,58 +1,64 @@
|
|||
# Bryan Schumaker (11/26/2010)
|
||||
|
||||
import ocarina
|
||||
from ocarina import body
|
||||
from ocarina import sources
|
||||
import menu
|
||||
import sources
|
||||
import body
|
||||
|
||||
plist_page = sources.Source()
|
||||
playlist_page = sources.Source()
|
||||
PLAYLIST_PAGE = body.add_page(playlist_page, "Playlist")
|
||||
|
||||
gtk = ocarina.gtk
|
||||
sources = ocarina.libsaria.sources
|
||||
playlist = sources.playlist
|
||||
visible = playlist.is_visible
|
||||
#import ocarina
|
||||
#from ocarina import body
|
||||
#from ocarina import sources
|
||||
#import menu
|
||||
|
||||
def init():
|
||||
body.add_page("Playlist", plist_page)
|
||||
sources.init_src(playlist.init_bg, filler)
|
||||
#plist_page = sources.Source()
|
||||
|
||||
def filler():
|
||||
plist_page.init(filter, is_visible, right_click, playlist.play_id, reset)
|
||||
menu.add_plist_menu_item("Add to queue", add_selected_to_queue)
|
||||
menu.add_plist_menu_item("Remove from playlist", rm_selected_from_playlist)
|
||||
ocarina.libsaria.event.invite("POSTLOADPLAYLIST", refresh)
|
||||
plist_page.fill(playlist.walk, True)
|
||||
#gtk = ocarina.gtk
|
||||
#sources = ocarina.libsaria.sources
|
||||
#playlist = sources.playlist
|
||||
#visible = playlist.is_visible
|
||||
|
||||
def filter(text):
|
||||
playlist.filter(text)
|
||||
plist_page.refilter()
|
||||
plist_page.goto()
|
||||
#def init():
|
||||
#body.add_page("Playlist", plist_page)
|
||||
#sources.init_src(playlist.init_bg, filler)
|
||||
|
||||
def is_visible(list, iter):
|
||||
return visible(list[iter][0])
|
||||
#def filler():
|
||||
#plist_page.init(filter, is_visible, right_click, playlist.play_id, reset)
|
||||
#menu.add_plist_menu_item("Add to queue", add_selected_to_queue)
|
||||
#menu.add_plist_menu_item("Remove from playlist", rm_selected_from_playlist)
|
||||
#ocarina.libsaria.event.invite("POSTLOADPLAYLIST", refresh)
|
||||
#plist_page.fill(playlist.walk, True)
|
||||
|
||||
def reset():
|
||||
plist_page.clear()
|
||||
playlist.reset()
|
||||
playlist.save()
|
||||
#def filter(text):
|
||||
#playlist.filter(text)
|
||||
#plist_page.refilter()
|
||||
#plist_page.goto()
|
||||
|
||||
def refresh(*args):
|
||||
plist_page.clear()
|
||||
plist_page.fill(playlist.walk)
|
||||
#def is_visible(list, iter):
|
||||
#return visible(list[iter][0])
|
||||
|
||||
def right_click(button, time):
|
||||
menu.make_plist_menu(button, time)
|
||||
#def reset():
|
||||
#plist_page.clear()
|
||||
#playlist.reset()
|
||||
#playlist.save()
|
||||
|
||||
def rm_selected_from_playlist(menu):
|
||||
plist_page.for_each_selected_id(playlist.rm_id)
|
||||
playlist.save()
|
||||
refresh()
|
||||
#def refresh(*args):
|
||||
#plist_page.clear()
|
||||
#plist_page.fill(playlist.walk)
|
||||
|
||||
def add_to_playlist(source_page):
|
||||
source_page.for_each_selected_id(playlist.add_id)
|
||||
playlist.save()
|
||||
refresh()
|
||||
#def right_click(button, time):
|
||||
#menu.make_plist_menu(button, time)
|
||||
|
||||
def add_selected_to_queue(menu):
|
||||
import queue
|
||||
queue.add_to_queue(plist_page)
|
||||
#def rm_selected_from_playlist(menu):
|
||||
#plist_page.for_each_selected_id(playlist.rm_id)
|
||||
#playlist.save()
|
||||
#refresh()
|
||||
|
||||
#def add_to_playlist(source_page):
|
||||
#source_page.for_each_selected_id(playlist.add_id)
|
||||
#playlist.save()
|
||||
#refresh()
|
||||
|
||||
#def add_selected_to_queue(menu):
|
||||
#import queue
|
||||
#queue.add_to_queue(plist_page)
|
||||
|
|
Loading…
Reference in New Issue
Block a user