aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2006-03-05 22:41:37 +0000
committerFelix Domke <tmbinc@elitedvb.net>2006-03-05 22:41:37 +0000
commit2495da5b388c7ea646903b0454b26ac74f6e2406 (patch)
treea11851ed922d64c9ddeba8552c19298c67badb03 /lib/python
parente896fc8b8860ec9fc0e1f013d6405c454bfa88c8 (diff)
downloadenigma2-2495da5b388c7ea646903b0454b26ac74f6e2406.tar.gz
enigma2-2495da5b388c7ea646903b0454b26ac74f6e2406.zip
a navigation instance might not be available at AUTOSTART. use first session's navigation instance
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py b/lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py
index 118f0cb6..7dc04d10 100644
--- a/lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py
+++ b/lib/python/Plugins/Extensions/ZappingAlternatives/plugin.py
@@ -232,7 +232,7 @@ class AlternativeZapping(Screen):
pass
-oldPlayService = NavigationInstance.instance.playService
+oldPlayService = None
from Components.PerServiceDisplay import PerServiceDisplay
@@ -274,29 +274,32 @@ class ServiceChanged(PerServiceDisplay):
#print "Alternatives: No playable alternative found!"
-servicechanged = ServiceChanged(NavigationInstance.instance)
+servicechanged = None
def playService(self, ref):
#print "--------------------Alternatives: trying to play service", str(ServiceReference(ref))
servicechanged.lastPlayAction = str(ServiceReference(ref))
servicechanged.nextPlayTry = 0
result = oldPlayService(ref)
-
return result
-def autostart(reason):
+def sessionstart(reason, session, **kwargs):
if reason == 0:
try:
loadAlternatives()
- except:
+ except: # FIXME, THIS IS ILLEGAL CODE AND WILL BE PROSECUTED!
pass
- NavigationInstance.instance.playService = type(NavigationInstance.instance.playService)(playService, NavigationInstance, Navigation)
+ # attach to this sessions navigation instance.
+ global oldPlayService, servicechanged
+ oldPlayService = session.nav.playService
+ session.nav.playService = type(session.nav.playService)(playService, NavigationInstance, Navigation)
+ servicechanged = ServiceChanged(session.nav)
def AlternativeZappingSetup(session, **kwargs):
session.open(AlternativeZapping)
def Plugins(**kwargs):
- return [PluginDescriptor(where = PluginDescriptor.WHERE_AUTOSTART, fnc = autostart),
+ return [PluginDescriptor(where = PluginDescriptor.WHERE_SESSIONSTART, fnc = sessionstart),
PluginDescriptor(name="Alternative services setup" , description="Defines alternatives for services.", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=AlternativeZappingSetup)]