parent
df3c9702be
commit
8891cb8c36
|
@ -4,6 +4,7 @@ import gtk
|
|||
from libsaria.path import export
|
||||
from libsaria import controls
|
||||
from libsaria import sources
|
||||
from ocarina import fsselect
|
||||
|
||||
SIZE = gtk.ICON_SIZE_MENU
|
||||
|
||||
|
@ -83,6 +84,13 @@ def export_button(show):
|
|||
def update_button(show):
|
||||
return make_button(gtk.STOCK_REFRESH, sources.library.update_bg, "Update Library", show)
|
||||
|
||||
def save_button(show):
|
||||
def save_func():
|
||||
loc = fsselect.select_save()
|
||||
if loc != None:
|
||||
export.save_playlist(loc)
|
||||
return make_button(gtk.STOCK_SAVE, save_func, "Save Current Playlist", show)
|
||||
|
||||
def up_button(show):
|
||||
def up_func():
|
||||
from ocarina.body import footer
|
||||
|
|
|
@ -18,6 +18,7 @@ def add_button(name, button):
|
|||
header_body.pack_start(button, False, False)
|
||||
|
||||
header_body.pack_start(entry.entry)
|
||||
add_button( "SAVE", button.save_button(True))
|
||||
add_button("EXPORT", button.export_button(True))
|
||||
|
||||
sep = gtk.VSeparator()
|
||||
|
|
|
@ -38,16 +38,6 @@ class OpenButton(Button):
|
|||
fsselect.run_chooser2(LS.path.files.universal_open)
|
||||
ocarina.playlist.refresh()
|
||||
|
||||
class SaveButton(Button):
|
||||
def __init__(self):
|
||||
Button.__init__(self, gtk.STOCK_SAVE, "Save current playlist")
|
||||
def clicked(self, button):
|
||||
from ocarina import fsselect
|
||||
from libsaria.path import export
|
||||
loc = fsselect.save()
|
||||
if loc != None:
|
||||
export.save_playlist(loc)
|
||||
|
||||
class SettingsButton(Button):
|
||||
def __init__(self):
|
||||
Button.__init__(self, gtk.STOCK_PREFERENCES, "Configure Preferences")
|
||||
|
|
|
@ -82,6 +82,6 @@ def select_dir(title = "Select a directory"):
|
|||
chooser = make_chooser(title, gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)
|
||||
return run_chooser(chooser)
|
||||
|
||||
def save(title = "Select a location"):
|
||||
def select_save(title = "Select a location"):
|
||||
chooser = make_chooser(title, gtk.FILE_CHOOSER_ACTION_SAVE)
|
||||
return run_chooser(chooser)
|
||||
|
|
Loading…
Reference in New Issue