optionally call callback with event argument
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 10 Jul 2006 16:21:51 +0000 (16:21 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 10 Jul 2006 16:21:51 +0000 (16:21 +0000)
lib/python/Components/PerServiceDisplay.py

index 500538c..a36d4a6 100644 (file)
@@ -6,12 +6,13 @@ from enigma import iPlayableService
 from enigma import eLabel, eSlider, eTimer
 
 class PerServiceBase(object):
 from enigma import eLabel, eSlider, eTimer
 
 class PerServiceBase(object):
-       def __init__(self, navcore, eventmap):
+       def __init__(self, navcore, eventmap, with_event=False):
                self.eventmap = eventmap
                self.navcore = navcore
                self.navcore.event.append(self.event)
                self.poll_timer = eTimer()
                self.poll_timer.timeout.get().append(self.poll)
                self.eventmap = eventmap
                self.navcore = navcore
                self.navcore.event.append(self.event)
                self.poll_timer = eTimer()
                self.poll_timer.timeout.get().append(self.poll)
+               self.with_event = with_event
                
                # start with stopped state, so simulate that
                self.event(iPlayableService.evEnd)
                
                # start with stopped state, so simulate that
                self.event(iPlayableService.evEnd)
@@ -23,7 +24,10 @@ class PerServiceBase(object):
                # loop up if we need to handle this event
                if self.eventmap.has_key(ev):
                        # call handler
                # loop up if we need to handle this event
                if self.eventmap.has_key(ev):
                        # call handler
-                       self.eventmap[ev]()
+                       if self.with_event:
+                               self.eventmap[ev](ev)
+                       else:
+                               self.eventmap[ev]()
        
        def enablePolling(self, interval=60000):
                if interval:
        
        def enablePolling(self, interval=60000):
                if interval: