add a small text input component
[enigma2.git] / lib / python / Screens / EpgSelection.py
index 6f5560038607797c66a48e9966266c7978fb86f5..d6fee56759e5b50b32642a5ce888c9a3ae0bc261 100644 (file)
@@ -9,6 +9,7 @@ from RecordTimer import RecordTimerEntry, parseEvent
 from TimerEdit import TimerEditList
 from TimerEntry import TimerEntry
 from ServiceReference import ServiceReference
+from Components.config import config, currentConfigSelectionElement
 
 import xml.dom.minidom
 
@@ -38,16 +39,27 @@ class EPGSelection(Screen):
 
                self["actions"] = ChannelActionMap(["EPGSelectActions", "OkCancelActions"],
                        {
-                               "cancel": self.close,
+                               "cancel": self.closeScreen,
                                "ok": self.eventSelected,
                                "timerAdd": self.timerAdd,
                                "yellow": self.yellowButtonPressed,
-                               "blue": self.blueButtonPressed
+                               "blue": self.blueButtonPressed,
+                               "info": self.infoKeyPressed
                        })
                self["actions"].csel = self
 
                self.onLayoutFinish.append(self.onCreate)
 
+       def infoKeyPressed(self):
+               if currentConfigSelectionElement(config.usage.epgtoggle) == "yes":
+                       self.close(True)
+               else:
+                       self.close(False)
+
+       def closeScreen(self):
+               self.close(False)
+
+
        #just used in multipeg
        def onCreate(self):
                l = self["list"]
@@ -109,7 +121,7 @@ class EPGSelection(Screen):
                self.session.openWithCallback(self.timerEditFinished, TimerEntry, newEntry)
 
        def timerEditFinished(self, answer):
-               if (answer[0]):
+               if answer[0]:
                        self.session.nav.RecordTimer.record(answer[1])
                else:
                        print "Timeredit aborted"