git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avswitch: reset video mode only when it has changed
[enigma2.git]
/
lib
/
python
/
Components
/
PerServiceDisplay.py
diff --git
a/lib/python/Components/PerServiceDisplay.py
b/lib/python/Components/PerServiceDisplay.py
index 01e5cc8224e13c51e9eb4bcc508b525a200c4345..23f6ecce6828e18191687262f506e2aae29b8555 100644
(file)
--- a/
lib/python/Components/PerServiceDisplay.py
+++ b/
lib/python/Components/PerServiceDisplay.py
@@
-2,8
+2,8
@@
from GUIComponent import *
from VariableText import *
from VariableValue import *
from VariableText import *
from VariableValue import *
-from enigma import
pNavigation
-from enigma import eLabel, eSlider
+from enigma import
iPlayableService
+from enigma import eLabel, eSlider
, eTimer
class PerServiceDisplay(GUIComponent, VariableText):
"""Mixin for building components which display something which changes on navigation events, for example "service name" """
class PerServiceDisplay(GUIComponent, VariableText):
"""Mixin for building components which display something which changes on navigation events, for example "service name" """
@@
-14,9
+14,11
@@
class PerServiceDisplay(GUIComponent, VariableText):
self.eventmap = eventmap
self.navcore = navcore
self.navcore.event.append(self.event)
self.eventmap = eventmap
self.navcore = navcore
self.navcore.event.append(self.event)
-
+ self.poll_timer = eTimer()
+ self.poll_timer.timeout.get().append(self.poll)
+
# start with stopped state, so simulate that
# start with stopped state, so simulate that
- self.event(
pNavigation.evStopService
)
+ self.event(
iPlayableService.evEnd
)
def event(self, ev):
# loop up if we need to handle this event
def event(self, ev):
# loop up if we need to handle this event
@@
-29,6
+31,17
@@
class PerServiceDisplay(GUIComponent, VariableText):
g = eLabel(parent)
return g
g = eLabel(parent)
return g
+ def enablePolling(self, interval=60000):
+ if interval:
+ self.poll_timer.start(interval)
+ else:
+ self.poll_timer.stop()
+
+ def disablePolling(self):
+ self.enablePolling(interval=0)
+
+ def poll(self):
+ pass
class PerServiceDisplayProgress(GUIComponent, VariableValue, PerServiceDisplay):
def __init__(self, navcore, eventmap):
class PerServiceDisplayProgress(GUIComponent, VariableValue, PerServiceDisplay):
def __init__(self, navcore, eventmap):
@@
-39,11
+52,10
@@
class PerServiceDisplayProgress(GUIComponent, VariableValue, PerServiceDisplay):
self.navcore.event.append(self.event)
# start with stopped state, so simulate that
self.navcore.event.append(self.event)
# start with stopped state, so simulate that
- self.event(
pNavigation.evStopService
)
+ self.event(
iPlayableService.evEnd
)
def createWidget(self, parent):
# by default, we use a label to display our data.
self.g = eSlider(parent)
return self.g
def createWidget(self, parent):
# by default, we use a label to display our data.
self.g = eSlider(parent)
return self.g
-
\ No newline at end of file