Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2270
Modified Files:
eventhandler.py
Log Message:
better handling of registered events
Index: eventhandler.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/eventhandler.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** eventhandler.py 15 Sep 2004 19:38:20 -0000 1.9
--- eventhandler.py 15 Sep 2004 20:47:07 -0000 1.10
***************
*** 9,12 ****
--- 9,15 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.10 2004/09/15 20:47:07 dischi
+ # better handling of registered events
+ #
# Revision 1.9 2004/09/15 19:38:20 dischi
# make it possible that the current applications hides
***************
*** 351,356 ****
del self.queue[0]
! _debug_('handling event %s' % str(event), 2)
!
if self.eventhandler_plugins == None:
_debug_('init', 1)
--- 354,359 ----
del self.queue[0]
! _debug_('handling event %s' % str(event), 1)
!
if self.eventhandler_plugins == None:
_debug_('init', 1)
***************
*** 371,374 ****
--- 374,387 ----
try:
+ used = False
+ if str(event) in self.registered:
+ # event is in the list of registered events. This events are special
+ # and should go to the callbacks registered. If at least one of them
+ # uses the event (returns True), do not send this event in the event
+ # queue (e.g. the detach plugin needs PLAY_END, but will only use
+ # it for the audio end and this should not go to the video player)
+ for c in self.registered[str(event)]:
+ used = c.eventhandler(event=event) or used
+
if event == FUNCTION_CALL:
# event is a direct function call, call it and do not pass it
***************
*** 381,390 ****
event.handler(event=event)
! elif str(event) in self.registered:
! # event is in the list of registered events. This events are special
! # and should only go to the callbacks registered
! for c in self.registered[str(event)]:
! c.eventhandler(event=event)
!
elif len(self.popups) and self.popups[-1].eventhandler(event=event):
# handled by the current popup
--- 394,401 ----
event.handler(event=event)
! elif used:
! # used by registered plugin
! pass
!
elif len(self.popups) and self.popups[-1].eventhandler(event=event):
# handled by the current popup
-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog