ocarina: Switch over to new preferences methods
I removed the old methods, so I need to use the new methods for ocarina to start up. This patch switches everything over. NOTE: As of this patch, ocarina should work again.
This commit is contained in:
parent
3dc0b208cf
commit
6cb857d988
|
@ -28,22 +28,22 @@ gobject.timeout_add(500, update_pos)
|
|||
def show_more():
|
||||
tiny.hide()
|
||||
detailed.show()
|
||||
libsaria.prefs.set_pref("ocarina.footer.up", True)
|
||||
libsaria.prefs.set("ocarina.footer.up", True)
|
||||
|
||||
def show_less():
|
||||
tiny.show()
|
||||
detailed.hide()
|
||||
libsaria.prefs.set_pref("ocarina.footer.up", False)
|
||||
libsaria.prefs.set("ocarina.footer.up", False)
|
||||
|
||||
def toggle_footer():
|
||||
up = libsaria.prefs.get_pref("ocarina.footer.up")
|
||||
up = libsaria.prefs.get("ocarina.footer.up")
|
||||
if up == True:
|
||||
show_less()
|
||||
else:
|
||||
show_more()
|
||||
shortcuts.register_shortcut("f", toggle_footer)
|
||||
|
||||
up = libsaria.init_pref("ocarina.footer.up", False)
|
||||
up = libsaria.prefs.init("ocarina.footer.up", False)
|
||||
if up == True:
|
||||
show_more()
|
||||
else:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Bryan Schumaker (11/25/2010)
|
||||
|
||||
import gtk
|
||||
import libsaria
|
||||
from libsaria import prefs
|
||||
from ocarina.body import button
|
||||
import entry
|
||||
|
||||
|
@ -29,8 +29,8 @@ header_body.pack_start(sep, False, False)
|
|||
add_button("UPDATE", button.update_button(True))
|
||||
add_button( "CLEAR", button.clear_button(True))
|
||||
add_button( "GOTO", button.goto_button(True))
|
||||
add_button("RANDOM", button.random_button(libsaria.prefs.get_pref("libsaria.random"), True))
|
||||
add_button("VOLUME", button.volume_button(libsaria.prefs.get_pref("libsaria.audio.volume"), True))
|
||||
add_button("RANDOM", button.random_button(prefs.get("libsaria.random"), True))
|
||||
add_button("VOLUME", button.volume_button(prefs.get("libsaria.audio.volume"), True))
|
||||
|
||||
#import ocarina
|
||||
#from ocarina.components import button
|
||||
|
|
|
@ -11,8 +11,8 @@ TARGET_TYPE_URI_LIST = 80
|
|||
DND_MASK = gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP
|
||||
DND_LIST = [("text/uri-list", 0, TARGET_TYPE_URI_LIST)]
|
||||
|
||||
width = libsaria.init_pref("ocarina.window.width", 800)
|
||||
height = libsaria.init_pref("ocarina.window.height", 600)
|
||||
width = libsaria.prefs.init("ocarina.window.width", 800)
|
||||
height = libsaria.prefs.init("ocarina.window.height", 600)
|
||||
|
||||
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||
window.resize(width, height)
|
||||
|
@ -36,10 +36,10 @@ def set_icon(icon = "images/ocarina.png"):
|
|||
set_icon()
|
||||
|
||||
def resized(widget, geom):
|
||||
if libsaria.prefs.get_pref("ocarina.window.width") != geom.width:
|
||||
libsaria.prefs.set_pref("ocarina.window.width", geom.width)
|
||||
if libsaria.prefs.get_pref("ocarina.window.height") != geom.height:
|
||||
libsaria.prefs.set_pref("ocarina.window.height", geom.height)
|
||||
if libsaria.prefs.get("ocarina.window.width") != geom.width:
|
||||
libsaria.prefs.set("ocarina.window.width", geom.width)
|
||||
if libsaria.prefs.get("ocarina.window.height") != geom.height:
|
||||
libsaria.prefs.set("ocarina.window.height", geom.height)
|
||||
window.connect("size-allocate", resized)
|
||||
|
||||
def dnd_receive(widget, context, x, y, selection, type, time):
|
||||
|
|
Loading…
Reference in New Issue