changing service in timer edit is now possible
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 22 Nov 2005 14:07:27 +0000 (14:07 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 22 Nov 2005 14:07:27 +0000 (14:07 +0000)
data/skin.xml
lib/python/Screens/ChannelSelection.py
lib/python/Screens/InfoBarGenerics.py
lib/python/Screens/TimerEntry.py

index 7dafd68..4209f28 100644 (file)
                        <widget name="key_yellow" position="280,0" size="140,40" backgroundColor="yellow" font="Arial;21" />
                        <widget name="key_blue" position="420,0" size="140,40" backgroundColor="blue" font="Arial;21" />
                </screen>
+               <screen name="SimpleChannelSelection" position="90,98" size="560,417" title="Channel Selection">
+                       <widget name="list" position="10,45" size="540,364" />
+                       <widget name="key_red" position="0,0" size="140,40" backgroundColor="red" font="Arial;21" />
+                       <widget name="key_green" position="140,0" size="140,40" backgroundColor="green" font="Arial;21" />
+                       <widget name="key_yellow" position="280,0" size="140,40" backgroundColor="yellow" font="Arial;21" />
+                       <widget name="key_blue" position="420,0" size="140,40" backgroundColor="blue" font="Arial;21" />
+               </screen>
                <screen name="EPGSelection" position="90,100" size="560,415" title="EPG Selection">
                        <widget name="list" position="10,5" size="550,400" />
                </screen>
index 1c1e450..37f594d 100644 (file)
@@ -376,9 +376,9 @@ class ChannelSelection(Screen):
                config.tv.lastservice.save()
 
 class SimpleChannelSelection(ChannelSelection):
-       def __init__(self, session, args):
+       def __init__(self, session, title):
                ChannelSelection.__init__(self, session)
-               self.args = args
+               self.title = title
                
        def channelSelected(self): # just return selected service
                ref = self.servicelist.getCurrent()
index f63e9b1..a9f7754 100644 (file)
@@ -90,7 +90,6 @@ class InfoBarShowHide:
        STATE_SHOWN = 3
        
        def __init__(self):
-               print "INFOBARSHOWHIDE init"
                self["ShowHideActions"] = ActionMap( ["InfobarShowHideActions"] ,
                        {
                                "toggleShow": self.toggleShow,
index 467f851..a03435e 100644 (file)
@@ -1,4 +1,6 @@
 from Screen import Screen
+import ChannelSelection
+from ServiceReference import ServiceReference
 from Components.config import *
 from Components.ActionMap import NumberActionMap
 from Components.ConfigList import ConfigList
@@ -6,7 +8,6 @@ from Components.NimManager import nimmanager
 from Components.Label import Label
 import time
 import datetime
-from math import log
 
 class TimerEntry(Screen):
        def __init__(self, session, timer):
@@ -146,7 +147,7 @@ class TimerEntry(Screen):
                        self.list.append(getConfigListEntry("EndDate", config.timerentry.enddate))
                self.list.append(getConfigListEntry("EndTime", config.timerentry.endtime))
 
-               self.list.append(getConfigListEntry("Channel", config.timerentry.service))
+               self.list.append(getConfigListEntry(_("Channel"), config.timerentry.service))
 
                self["config"].list = self.list
                self["config"].l.setList(self.list)
@@ -173,7 +174,13 @@ class TimerEntry(Screen):
                self.newConfig()
                
        def keySelect(self):
-               pass
+               if self["config"].getCurrent()[0] == _("Channel"):
+                       self.session.openWithCallback(self.finishedChannelSelection, ChannelSelection.SimpleChannelSelection, _("Select channel to record from"))
+
+       def finishedChannelSelection(self, args):
+               self.timer.service_ref = ServiceReference(args)
+               config.timerentry.service.vals = (str(self.timer.service_ref.getServiceName()),)
+               self["config"].invalidate(config.timerentry.service)
 
        def keyNumberGlobal(self, number):
                print "You pressed number " + str(number)