Up and Down buttons

The up and down buttons have been re-added.  They store their state
between sessions.
This commit is contained in:
Bryan Schumaker 2010-11-25 22:36:37 -05:00
parent 52e9425333
commit 546df4407d
1 changed files with 18 additions and 0 deletions

View File

@ -34,6 +34,16 @@ def add_page(title, widget):
pages[title] = widget
tabs.append_page(widget, label)
def up_button():
tabs.show()
bar.hide()
libsaria.prefs.set_pref("ocarina.footer.up", True)
def down_button():
tabs.hide()
bar.show()
libsaria.prefs.set_pref("ocarina.footer.down", False)
def make_bar():
title.set_text(ocarina.__vers__)
title.set_ellipsize(pango.ELLIPSIZE_END)
@ -48,6 +58,7 @@ def make_bar():
bar_add(button.PauseButton())
bar_add(button.StopButton())
bar_add(button.NextButton())
bar_add(button.UpButton(up_button))
bar.show()
footer.pack_start(bar)
@ -59,6 +70,7 @@ def make_action_bar():
act_bar_add(button.PauseButton())
act_bar_add(button.StopButton())
act_bar_add(button.NextButton())
act_bar_add(button.DownButton(down_button))
act_bar.show()
def make_now_playing_page():
@ -100,5 +112,11 @@ def init():
footer.show_all()
make_bar()
make_tabs()
up = libsaria.init_pref("ocarina.footer.up", False)
if up == True:
up_button()
else:
down_button()
libsaria.event.invite("POSTLOAD", change_title)
init()