From ac0f23ab808dd5ad7c522d83851fe39dbd32fff4 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sat, 21 May 2011 22:34:39 -0400 Subject: [PATCH] ocarina: Remove oldlibrary code The new library covers everything, so this is no longer needed. --- ocarina/__init__.py | 1 - ocarina/body/button.py | 2 +- ocarina/callbacks.py | 5 ---- ocarina/oldlibrary.py | 54 ------------------------------------------ 4 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 ocarina/oldlibrary.py diff --git a/ocarina/__init__.py b/ocarina/__init__.py index 2cb6f1f4..9c1ce209 100644 --- a/ocarina/__init__.py +++ b/ocarina/__init__.py @@ -23,7 +23,6 @@ import window import playlist import queue import library -import oldlibrary import callbacks def run(): diff --git a/ocarina/body/button.py b/ocarina/body/button.py index c33ccafe..8022d9f5 100644 --- a/ocarina/body/button.py +++ b/ocarina/body/button.py @@ -83,7 +83,7 @@ def export_button(show): return make_button(gtk.STOCK_CONVERT, export.export, "Export Library", show) def update_button(show): - return make_button(gtk.STOCK_REFRESH, sources.oldlibrary.update_bg, "Update Library", show) + return make_button(gtk.STOCK_REFRESH, sources.library.update_lib, "Update Library", show) def open_button(show): def open_func(): diff --git a/ocarina/callbacks.py b/ocarina/callbacks.py index a626ee73..48ddbb43 100644 --- a/ocarina/callbacks.py +++ b/ocarina/callbacks.py @@ -7,7 +7,6 @@ from ocarina.body import footer from libsaria import callbacks import playlist import library -import oldlibrary def on_play(): footer.on_play() @@ -39,10 +38,6 @@ def on_load_playlist(): playlist.refresh() callbacks.on_load_playlist = on_load_playlist -def on_load_library(): - oldlibrary.refresh() -callbacks.on_new_source = on_load_library - def library_updated(): library.refresh() callbacks.on_library_updated = library_updated diff --git a/ocarina/oldlibrary.py b/ocarina/oldlibrary.py deleted file mode 100644 index deb97dcc..00000000 --- a/ocarina/oldlibrary.py +++ /dev/null @@ -1,54 +0,0 @@ -# Bryan Schumaker (11/26/2010) - -import libsaria -import sources -import body - -library = libsaria.sources.oldlibrary -lib_page = sources.Source() -LIB_PAGE = body.add_page(lib_page, "Old Library") -LIB_PAGE.goto = lib_page.goto - -def set_label_text(): - LIB_PAGE.label.set_text("Old Library (%s)" % library.num_visible()) - -def fill_library(): - songs = library.walk_library("id", "title", "lenstr", "artist", "album", "year") - lib_page.insert(songs) - set_label_text() -fill_library() - -def refresh(): - lib_page.clear() - fill_library() - -def do_refilter(list, iter): - return library.is_visible(list[iter][0]) -lib_page.set_filter_func(do_refilter) - -def filter(text): - library.filter(text) - lib_page.refilter() - set_label_text() -LIB_PAGE.filter = filter - -import playlist -import queue - -def clear(): - queue.clear() - playlist.clear() - lib_page.clear() - library.reset() - library.save() - refresh() -LIB_PAGE.clear = clear - -menu_items = [ - ("Add to Queue", queue.add_to_queue), - ("Add to Playlist", playlist.add_to_playlist), -] -def show_menu(event): - m = sources.Menu(lib_page, menu_items) - m.show(event) -lib_page.set_right_click(show_menu)