ocarina: Added universal open button

I want to redo the chooser for this, but I'll need to redo the sources
first.  I guess it'll have to wait for 4.5?
This commit is contained in:
Bryan Schumaker 2011-04-24 18:46:02 -04:00
parent 8891cb8c36
commit 3b131f33ef
2 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# Bryan Schumaker (2 / 20 / 2011) # Bryan Schumaker (2 / 20 / 2011)
import gtk import gtk
from libsaria.path import files
from libsaria.path import export from libsaria.path import export
from libsaria import controls from libsaria import controls
from libsaria import sources from libsaria import sources
@ -84,6 +85,11 @@ def export_button(show):
def update_button(show): def update_button(show):
return make_button(gtk.STOCK_REFRESH, sources.library.update_bg, "Update Library", show) return make_button(gtk.STOCK_REFRESH, sources.library.update_bg, "Update Library", show)
def open_button(show):
def open_func():
fsselect.run_chooser2(files.universal_open)
return make_button(gtk.STOCK_OPEN, open_func, "Open Anything", show)
def save_button(show): def save_button(show):
def save_func(): def save_func():
loc = fsselect.select_save() loc = fsselect.select_save()

View File

@ -18,6 +18,7 @@ def add_button(name, button):
header_body.pack_start(button, False, False) header_body.pack_start(button, False, False)
header_body.pack_start(entry.entry) header_body.pack_start(entry.entry)
add_button( "OPEN", button.open_button(True))
add_button( "SAVE", button.save_button(True)) add_button( "SAVE", button.save_button(True))
add_button("EXPORT", button.export_button(True)) add_button("EXPORT", button.export_button(True))