pre-lookup libsaria.event.invite for buttons
This commit is contained in:
parent
b5da80d6c2
commit
6f7381c221
|
@ -2,9 +2,9 @@
|
|||
|
||||
import ocarina
|
||||
import image
|
||||
LS = ocarina.libsaria
|
||||
gtk = ocarina.gtk
|
||||
prefs = LS.prefs
|
||||
LS = ocarina.libsaria
|
||||
gtk = ocarina.gtk
|
||||
prefs = LS.prefs
|
||||
invite = LS.event.invite
|
||||
|
||||
|
||||
|
@ -34,9 +34,9 @@ class Button(gtk.Button):
|
|||
class PlayButton(Button):
|
||||
def __init__(self):
|
||||
Button.__init__(self, gtk.STOCK_MEDIA_PLAY)
|
||||
LS.event.invite("POSTPLAY", self.hide)
|
||||
LS.event.invite("POSTPAUSE", self.show)
|
||||
LS.event.invite("POSTSTOP", self.show)
|
||||
invite("POSTPLAY", self.hide)
|
||||
invite("POSTPAUSE", self.show)
|
||||
invite("POSTSTOP", self.show)
|
||||
def clicked(self, button):
|
||||
LS.controls.play()
|
||||
def hide(self, playing):
|
||||
|
@ -49,9 +49,9 @@ class PlayButton(Button):
|
|||
class PauseButton(Button):
|
||||
def __init__(self):
|
||||
Button.__init__(self, gtk.STOCK_MEDIA_PAUSE, show=False)
|
||||
LS.event.invite("POSTPLAY", self.show)
|
||||
LS.event.invite("POSTPAUSE", self.hide)
|
||||
LS.event.invite("POSTSTOP", self.hide)
|
||||
invite("POSTPLAY", self.show)
|
||||
invite("POSTPAUSE", self.hide)
|
||||
invite("POSTSTOP", self.hide)
|
||||
def clicked(self, button):
|
||||
LS.audio.pause()
|
||||
def hide(self, paused):
|
||||
|
@ -150,7 +150,7 @@ class VolumeButton(gtk.VolumeButton):
|
|||
self.resize()
|
||||
|
||||
self.connect("value-changed", self.changed)
|
||||
LS.event.invite("POSTSETVOLUME", self.set_slider)
|
||||
invite("POSTSETVOLUME", self.set_slider)
|
||||
self.show()
|
||||
|
||||
def set_slider(self, prcnt):
|
||||
|
|
Loading…
Reference in New Issue