show plugin description in plugin list
[enigma2.git] / lib / python / Screens / ChannelSelection.py
index cad9961624389e050ff34431969ecb464417425b..d4a1e7cea08d9911cd5eece5d98f3b65efc7c0d2 100644 (file)
@@ -8,6 +8,9 @@ from Components.config import config, configElement, ConfigSubsection, configTex
 from Screens.FixedMenu import FixedMenu
 from Tools.NumericalTextInput import NumericalTextInput
 from Components.NimManager import nimmanager
+from Components.ServiceName import ServiceName
+from Components.Clock import Clock
+from Components.EventInfo import EventInfo
 
 import xml.dom.minidom
 
@@ -542,6 +545,18 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit):
                if lastservice.valid() and self.getCurrentSelection() != lastservice:
                        self.servicelist.setCurrent(lastservice)
 
+class ServiceInfoWindow(Screen):
+       def __init__(self, session):
+               Screen.__init__(self, session)
+               self["Service_Name"] = ServiceName(self.session.nav)
+               self["Clock"] = Clock()
+               self["Event_Now_StartTime"] = EventInfo(self.session.nav, EventInfo.Now_StartTime)
+               self["Event_Next_StartTime"] = EventInfo(self.session.nav, EventInfo.Next_StartTime)
+               self["Event_Now"] = EventInfo(self.session.nav, EventInfo.Now)
+               self["Event_Next"] = EventInfo(self.session.nav, EventInfo.Next)
+               self["Event_Now_Duration"] = EventInfo(self.session.nav, EventInfo.Now_Duration)
+               self["Event_Next_Duration"] = EventInfo(self.session.nav, EventInfo.Next_Duration)
+
 class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit):
        def __init__(self, session):
                ChannelSelectionBase.__init__(self, session)
@@ -552,6 +567,8 @@ class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit):
                config.radio.lastroot = configElement("config.radio.lastroot", configText, "", 0);
                self.onLayoutFinish.append(self.onCreate)
 
+               self.info = session.instantiateDialog(ServiceInfoWindow)
+
                class ChannelActionMap(NumberActionMap):
                        def action(self, contexts, action):
                                if not self.csel.enterBouquet(action):
@@ -593,6 +610,7 @@ class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit):
                        self.servicelist.setCurrent(lastservice)
                        self.session.nav.playService(lastservice)
                        self.servicelist.setPlayableIgnoreService(lastservice)
+               self.info.instance.show()
 
        def channelSelected(self): # just return selected service
                ref = self.getCurrentSelection()
@@ -607,17 +625,14 @@ class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit):
                        self.servicelist.setPlayableIgnoreService(ref)
                        config.radio.lastservice.value = ref.toString()
                        config.radio.lastservice.save()
-
+                       config.radio.lastroot.value = self.getRoot().toString()
+                       config.radio.lastroot.save()
+               
        def setRoot(self, root, justSet=False):
                self.setRootBase(root, justSet)
 
        def closeRadio(self):
-               lastroot=eServiceReference(config.radio.lastroot.value)
-               lastservice=eServiceReference(config.radio.lastservice.value)
-               if lastroot.valid() and self.getRoot() != lastroot:
-                       self.setRoot(lastroot)
-               if lastservice.valid() and self.getCurrentSelection() != lastservice:
-                       self.servicelist.setCurrent(lastservice)
+               self.info.instance.hide()
                #set previous tv service
                lastservice=eServiceReference(config.tv.lastservice.value)
                self.session.nav.playService(lastservice)