[EasyInfo] mark not available entrys in EasyPG and EasySelection
[enigma2-plugins.git] / easyinfo / src / plugin.py
1 #######################################################################
2 #
3 #    EasyInfo for Dreambox-Enigma2
4 #    Coded by Vali (c)2011
5 #    Support: www.dreambox-tools.info
6 #
7 #  This plugin is licensed under the Creative Commons 
8 #  Attribution-NonCommercial-ShareAlike 3.0 Unported License.
9 #  To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
10 #  or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
11 #
12 #  Alternatively, this plugin may be distributed and executed on hardware which
13 #  is licensed by Dream Multimedia GmbH.
14 #
15 #  This plugin is NOT free software. It is open source, you are allowed to
16 #  modify it (if you keep the license), but it may not be commercially 
17 #  distributed other than under the conditions noted above.
18 #
19 #######################################################################
20
21
22
23 from Plugins.Plugin import PluginDescriptor
24 from Screens.Screen import Screen
25 from Screens.MessageBox import MessageBox
26 from Screens.InfoBarGenerics import InfoBarPlugins
27 from Screens.ChoiceBox import ChoiceBox
28 from Screens.TimerEdit import TimerEditList
29 from Screens.EpgSelection import EPGSelection
30 from Screens.EventView import EventViewSimple, EventViewBase
31 from Screens.ServiceInfo import ServiceInfo
32 from Screens.ChannelSelection import BouquetSelector
33 from Screens.TimeDateInput import TimeDateInput
34 from Components.ActionMap import ActionMap
35 from Components.MenuList import MenuList
36 from Components.Label import Label
37 from Components.EpgList import EPGList, EPG_TYPE_MULTI
38 from Components.ConfigList import ConfigListScreen
39 from Components.config import config, getConfigListEntry, ConfigSubsection, ConfigSelection, ConfigClock
40 from Components.Sources.StaticText import StaticText
41 from Components.TimerSanityCheck import TimerSanityCheck
42 from Tools.Directories import fileExists, pathExists
43 from Tools.LoadPixmap import LoadPixmap
44 from Tools.HardwareInfo import HardwareInfo
45 from ServiceReference import ServiceReference
46 from skin import parseColor
47 from enigma import eListboxPythonMultiContent, gFont, getDesktop, eTimer, eServiceReference, RT_HALIGN_LEFT, RT_HALIGN_CENTER, RT_VALIGN_CENTER, RT_WRAP, RT_HALIGN_RIGHT, RT_VALIGN_TOP
48 from time import localtime, time, mktime
49
50
51
52 EINbaseInfoBarPlugins__init__ = None
53 EINStartOnlyOneTime = False
54 EINsession = None
55 EINposition = 0
56 InfoBar_instance = None
57 mepg_config_initialized = False
58 sz_w = getDesktop(0).size().width()
59 if sz_w == 1280:
60         SKINTYPE = 3
61 elif sz_w == 1024:
62         SKINTYPE = 2
63 else:
64         SKINTYPE = 1
65
66
67
68 CHOICELIST=[("no", _("Disabled")),
69                         ("eventinfo", _("Event info")),
70                         ("singleepg", _("Single EPG")),
71                         ("multiepg", _("Multi EPG")),
72                         ("easypg", _("Easy-PG")),
73                         ("easysel", _("Easy-Selection")),
74                         ("graphepg", _("Graphik multi-EPG")),
75                         ("merlinepg", _("Merlin EPG")),
76                         ("cooltv", _("Cool-TV")),
77                         ("timers", _("Timerlist")),
78                         ("epgsearch", _("EPG search")),
79                         ("autotimer", _("Autotimer")),
80                         ("channelinfo", _("Channel info")),
81                         ("imdbinfo", _("IMDB info")),
82                         ("primetime", _("Prime Time Manager")),
83                         ("epgrefresh", _("EPG refresh")),
84                         ("sleep", _("Sleep timer")),
85                         ("sysinfo", _("Sherlock"))
86                         ]
87 config.plugins.EasyInfo  = ConfigSubsection()
88 config.plugins.EasyInfo.pos1 = ConfigSelection(default="eventinfo", choices = CHOICELIST)
89 config.plugins.EasyInfo.pos2 = ConfigSelection(default="singleepg", choices = CHOICELIST)
90 config.plugins.EasyInfo.pos3 = ConfigSelection(default="merlinepg", choices = CHOICELIST)
91 config.plugins.EasyInfo.pos4 = ConfigSelection(default="timers", choices = CHOICELIST)
92 config.plugins.EasyInfo.pos5 = ConfigSelection(default="channelinfo", choices = CHOICELIST)
93 config.plugins.EasyInfo.pos6 = ConfigSelection(default="no", choices = CHOICELIST)
94 config.plugins.EasyInfo.pos7 = ConfigSelection(default="no", choices = CHOICELIST)
95 config.plugins.EasyInfo.pos8 = ConfigSelection(default="no", choices = CHOICELIST)
96 config.plugins.EasyInfo.pos9 = ConfigSelection(default="no", choices = CHOICELIST)
97 config.plugins.EasyInfo.pos10 = ConfigSelection(default="no", choices = CHOICELIST)
98 config.plugins.EasyInfo.pos11 = ConfigSelection(default="no", choices = CHOICELIST)
99 config.plugins.EasyInfo.EvInStart = ConfigSelection(default="yes", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
100 config.plugins.EasyInfo.bEvInYellow = ConfigSelection(default="singleepg", choices=[("singleepg", _("Single EPG")),("multiepg", _("Multi EPG")),("easypg", _("Easy-PG")),("graphepg", _("Graphik multi-EPG")),("merlinepg", _("Merlin EPG")),("cooltv", _("Cool-TV")),("imdbinfo", _("IMDB info"))])
101 config.plugins.EasyInfo.bEvInBlue = ConfigSelection(default="multiepg", choices=[("singleepg", _("Single EPG")),("multiepg", _("Multi EPG")),("easypg", _("Easy-PG")),("graphepg", _("Graphik multi-EPG")),("merlinepg", _("Merlin EPG")),("cooltv", _("Cool-TV")),("imdbinfo", _("IMDB info"))])
102 config.plugins.EasyInfo.myPicons = ConfigSelection(default="/media/usb/epgpicon/", choices = [("/media/usb/epgpicon/", "/media/usb/epgpicon/"), ("/media/cf/epgpicon/", "/media/cf/epgpicon/"), ("/media/hdd/epgpicon/", "/media/hdd/epgpicon/")])
103 config.plugins.EasyInfo.epgOKFunc = ConfigSelection(default="info", choices = [("info", _("Event info")), ("zap", _("Just zap")),("exitzap", _("Zap and Exit"))])
104 config.plugins.EasyInfo.Primetime1 = ConfigClock(default = 63000)
105 config.plugins.EasyInfo.Primetime2 = ConfigClock(default = 69300)
106 config.plugins.EasyInfo.Primetime3 = ConfigClock(default = 75600)
107 config.plugins.EasyInfo.buttTV = ConfigSelection(default="easysel", choices = [("no", _("Disabled")), ("easysel", _("Easy-Selection")), ("easypg", _("Easy-PG"))])
108
109
110
111 def Plugins(**kwargs):
112         return [PluginDescriptor(where = PluginDescriptor.WHERE_SESSIONSTART, fnc = EasyInfoAutostart)]
113
114
115
116 def EasyInfoAutostart(reason, **kwargs):
117         global EINbaseInfoBarPlugins__init__
118         if "session" in kwargs:
119                 global EINsession
120                 EINsession = kwargs["session"]
121                 if EINbaseInfoBarPlugins__init__ is None:
122                         EINbaseInfoBarPlugins__init__ = InfoBarPlugins.__init__
123                 InfoBarPlugins.__init__ = InfoBarPlugins__init__
124                 InfoBarPlugins.info = info
125                 if config.plugins.EasyInfo.buttTV.value != "no":
126                         InfoBarPlugins.tvbut = tvbut
127
128
129
130 def InfoBarPlugins__init__(self):
131         global EINStartOnlyOneTime
132         if not EINStartOnlyOneTime: 
133                 EINStartOnlyOneTime = True
134                 global InfoBar_instance
135                 InfoBar_instance = self
136                 if config.plugins.EasyInfo.buttTV.value != "no":
137                         self["EasyInfoActions"] = ActionMap(["EasyInfoActions"],
138                                 {"info_but": self.info, "tv_but": self.tvbut}, -1)
139                 else:
140                         self["EasyInfoActions"] = ActionMap(["EasyInfoActionsALT"],
141                                 {"info_but": self.info}, -1)
142         else:
143                 InfoBarPlugins.__init__ = InfoBarPlugins.__init__
144                 InfoBarPlugins.info = None
145                 if config.plugins.EasyInfo.buttTV.value != "no":
146                         InfoBarPlugins.tvbut = None
147         EINbaseInfoBarPlugins__init__(self)
148
149
150
151 def info(self):
152         if config.plugins.EasyInfo.EvInStart.value == "yes":
153                 epglist = [ ]
154                 self.epglist = epglist
155                 service = self.session.nav.getCurrentService()
156                 ref = self.session.nav.getCurrentlyPlayingServiceReference()
157                 info = service.info()
158                 ptr=info.getEvent(0)
159                 if ptr:
160                         epglist.append(ptr)
161                 ptr=info.getEvent(1)
162                 if ptr:
163                         epglist.append(ptr)
164                 if epglist:
165                         self.session.open(EasyEvent, epglist[0], ServiceReference(ref))
166                 else:
167                         self.session.open(EasyInfo)
168         else:
169                 self.session.open(EasyInfo)
170
171
172
173 def tvbut(self):
174         myService = self.session.nav.getCurrentService()
175         myTS = myService and myService.timeshift()
176         if myTS is not None:
177                 if myTS.isTimeshiftActive():
178                         InfoBar_instance.stopTimeshift()
179                         return
180         bouquets = InfoBar_instance.servicelist.getBouquetList()
181         if bouquets is None:
182                 cnt = 0
183         else:
184                 cnt = len(bouquets)
185                 IBservices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
186         if cnt > 1:
187                 if config.plugins.EasyInfo.buttTV.value == "easysel":
188                         InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, EINchangeBouquetCB))
189                 elif config.plugins.EasyInfo.buttTV.value == "easypg":
190                         InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
191         elif cnt == 1:
192                 if config.plugins.EasyInfo.buttTV.value == "easysel":
193                         InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, None))
194                 if config.plugins.EasyInfo.buttTV.value == "easypg":
195                         InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
196
197
198
199 def getPluginByName(sstr):
200         sret = " "
201         for xs in CHOICELIST:
202                 if sstr == xs[0]:
203                         sret = xs[1]
204                         break
205         return sret
206
207
208
209 def EINPanelEntryComponent(key, text):
210         res = [ text ]
211         bpng = LoadPixmap(EasyInfo.EINiconspath + "key-" + text[0] + ".png")
212         if bpng is not None:
213                 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 5, 5, 50, bpng))
214         png = LoadPixmap(EasyInfo.EINiconspath + key + ".png")
215         if png is not None:
216                 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5, 5, 100, 50, png))
217         if config.plugins.EasyInfo.EvInStart.value == "yes" or SKINTYPE == 1:
218                 res.append((eListboxPythonMultiContent.TYPE_TEXT, 115, 17, 300, 35, 0, RT_HALIGN_LEFT, getPluginByName(text[1])))
219         return res
220
221
222
223 class EINPanelList(MenuList):
224         def __init__(self, list, selection = 0, enableWrapAround=True):
225                 MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
226                 self.l.setFont(0, gFont("Regular", 20))
227                 self.l.setItemHeight(60)
228                 self.selection = selection
229         def postWidgetCreate(self, instance):
230                 MenuList.postWidgetCreate(self, instance)
231                 self.moveToIndex(self.selection)
232
233
234
235 class ConfigEasyInfo(ConfigListScreen, Screen):
236         skin = """
237                 <screen name="ConfigEasyInfo" position="center,center" size="600,410" title="EasyInfo settings...">
238                         <widget name="config" position="5,5" scrollbarMode="showOnDemand" size="590,375"/>
239                         <eLabel font="Regular;20" foregroundColor="#00ff4A3C" halign="center" position="20,385" size="140,26" text="Cancel"/>
240                         <eLabel font="Regular;20" foregroundColor="#0056C856" halign="center" position="165,385" size="140,26" text="Save"/>
241                 </screen>"""
242         def __init__(self, session):
243                 Screen.__init__(self, session)
244                 self.setTitle(_("EasyInfo settings..."))
245                 self.session = session
246                 self.oldsetting = [config.plugins.EasyInfo.EvInStart.value, config.plugins.EasyInfo.buttTV.value]
247                 list = []
248                 list.append(getConfigListEntry(_("Start first EventInfo:"), config.plugins.EasyInfo.EvInStart ))
249                 list.append(getConfigListEntry(_("Replace TV-button function:"), config.plugins.EasyInfo.buttTV ))
250                 list.append(getConfigListEntry(_("EventInfo yellow button:"), config.plugins.EasyInfo.bEvInYellow ))
251                 list.append(getConfigListEntry(_("EventInfo blue button:"), config.plugins.EasyInfo.bEvInBlue ))
252                 list.append(getConfigListEntry(_("OK function in Easy-PG:"), config.plugins.EasyInfo.epgOKFunc))
253                 list.append(getConfigListEntry(_("Easy-PG picons path:"), config.plugins.EasyInfo.myPicons))
254                 list.append(getConfigListEntry(_("Easy-PG Primetime 1:"), config.plugins.EasyInfo.Primetime1))
255                 list.append(getConfigListEntry(_("Easy-PG Primetime 2 (main):"), config.plugins.EasyInfo.Primetime2))
256                 list.append(getConfigListEntry(_("Easy-PG Primetime 3:"), config.plugins.EasyInfo.Primetime3))
257                 list.append(getConfigListEntry(_("Position 1 (info button):"), config.plugins.EasyInfo.pos1))
258                 list.append(getConfigListEntry(_("Position 2 (red button):"), config.plugins.EasyInfo.pos2))
259                 list.append(getConfigListEntry(_("Position 3 (green button):"), config.plugins.EasyInfo.pos3))
260                 list.append(getConfigListEntry(_("Position 4 (yellow button):"), config.plugins.EasyInfo.pos4))
261                 list.append(getConfigListEntry(_("Position 5 (blue button):"), config.plugins.EasyInfo.pos5))
262                 list.append(getConfigListEntry(_("Position 6:"), config.plugins.EasyInfo.pos6))
263                 list.append(getConfigListEntry(_("Position 7:"), config.plugins.EasyInfo.pos7))
264                 list.append(getConfigListEntry(_("Position 8:"), config.plugins.EasyInfo.pos8))
265                 list.append(getConfigListEntry(_("Position 9:"), config.plugins.EasyInfo.pos9))
266                 list.append(getConfigListEntry(_("Position 10:"), config.plugins.EasyInfo.pos10))
267                 list.append(getConfigListEntry(_("Position 11:"), config.plugins.EasyInfo.pos11))
268                 ConfigListScreen.__init__(self, list)
269                 self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {"green": self.save, "red": self.exit, "cancel": self.exit, "yellow": self.exit}, -1)
270
271         def save(self):
272                 for x in self["config"].list:
273                         x[1].save()
274                 if self.oldsetting != [config.plugins.EasyInfo.EvInStart.value, config.plugins.EasyInfo.buttTV.value]:
275                         self.session.open(MessageBox, text = _('You need GUI-restart to load the new settings!'), type = MessageBox.TYPE_INFO)
276                 self.close()
277
278         def exit(self):
279                 for x in self["config"].list:
280                         x[1].cancel()
281                 self.close()
282
283
284
285 class EasyInfo(Screen):
286         if SKINTYPE == 3:
287                 if config.plugins.EasyInfo.EvInStart.value == "yes":
288                         skin = """
289                         <screen flags="wfNoBorder" position="0,0" size="450,720" title="Easy Info">
290                                 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/bg.png" position="0,0" size="450,576"/>
291                                 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/bg.png" position="0,576" size="450,145"/>
292                                 <widget name="list" position="60,30" size="350,660" scrollbarMode="showNever" transparent="1" zPosition="2"/>
293                         </screen>"""
294                 else:
295                         skin = """
296                         <screen backgroundColor="background" flags="wfNoBorder" position="0,0" size="1280,720" title="Easy Info">
297                                 <widget name="list" position="55,30" size="110,660" scrollbarMode="showNever" transparent="1" zPosition="2"/>
298                                 <eLabel backgroundColor="#666666" position="250,359" size="1280,2"/>
299                                 <widget font="Regular;24" foregroundColor="#fcc000" position="600,50" render="Label" size="600,30" source="session.CurrentService" transparent="1" zPosition="1">
300                                         <convert type="ServiceName">Name</convert>
301                                 </widget>
302                                 <widget font="Regular;24" position="250,50" render="Label" size="70,30" source="session.Event_Now" transparent="1" zPosition="1">
303                                         <convert type="EventTime">StartTime</convert>
304                                         <convert type="ClockToText">Default</convert>
305                                 </widget>
306                                 <widget font="Regular;24" noWrap="1" position="250,90" render="Label" size="900,30" source="session.Event_Now" transparent="1" zPosition="1">
307                                         <convert type="EventName">Name</convert>
308                                 </widget>
309                                 <widget font="Regular;22" foregroundColor="#fcc000" position="320,50" halign="right" render="Label" size="130,30" source="session.Event_Now" transparent="1" zPosition="1">
310                                         <convert type="EventTime">Remaining</convert>
311                                         <convert type="RemainingToText">InMinutes</convert>
312                                 </widget>
313                                 <widget font="Regular;24" position="250,400" render="Label" size="70,30" source="session.Event_Next" transparent="1" zPosition="1">
314                                         <convert type="EventTime">StartTime</convert>
315                                         <convert type="ClockToText">Default</convert>
316                                 </widget>
317                                 <widget font="Regular;24" foregroundColor="#aaaaaa" noWrap="1" position="250,370" render="Label" size="900,30" source="session.Event_Next" transparent="1" zPosition="1">
318                                         <convert type="EventName">Name</convert>
319                                 </widget>
320                                 <widget font="Regular;24" foregroundColor="#aaaaaa" position="320,400" render="Label" size="130,30" source="session.Event_Next" transparent="1" zPosition="1">
321                                         <convert type="EventTime">Duration</convert>
322                                         <convert type="ClockToText">InMinutes</convert>
323                                 </widget>
324                                 <widget backgroundColor="#555555" borderColor="#555555" borderWidth="4" position="460,57" render="Progress" size="120,14" source="session.Event_Now" zPosition="2">
325                                         <convert type="EventTime">Progress</convert>
326                                 </widget>
327                                 <widget font="Regular;22" position="250,127" render="Label" size="950,225" source="session.Event_Now" transparent="1" valign="top" zPosition="5">
328                                         <convert type="EventName">ExtendedDescription</convert>
329                                 </widget>
330                                 <widget font="Regular;22" foregroundColor="#aaaaaa" position="250,437" render="Label" size="950,225" source="session.Event_Next" transparent="1" valign="top" zPosition="5">
331                                         <convert type="EventName">ExtendedDescription</convert>
332                                 </widget>
333                         </screen>"""
334         elif SKINTYPE == 2:
335                 if config.plugins.EasyInfo.EvInStart.value == "yes":
336                         skin = """
337                         <screen flags="wfNoBorder" position="-20,0" size="450,576" title="Easy Info">
338                                 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/bg.png" position="0,0" size="450,576"/>
339                                 <widget name="list" position="70,48" size="320,480" scrollbarMode="showNever" transparent="1" zPosition="2"/>
340                         </screen>"""
341                 else:
342                         skin = """
343                         <screen backgroundColor="background" flags="wfNoBorder" position="0,0" size="1024,720" title="Easy Info">
344                                 <widget name="list" position="40,48" scrollbarMode="showNever" size="110,480" transparent="1" zPosition="2"/>
345                                 <eLabel backgroundColor="#666666" position="210,289" size="1000,2"/>
346                                 <widget font="Regular;20" foregroundColor="#fcc000" position="570,50" render="Label" size="377,30" source="session.CurrentService" transparent="1" zPosition="1">
347                                         <convert type="ServiceName">Name</convert>
348                                 </widget>
349                                 <widget font="Regular;20" position="210,50" render="Label" size="70,30" source="session.Event_Now" transparent="1" zPosition="1">
350                                         <convert type="EventTime">StartTime</convert>
351                                         <convert type="ClockToText">Default</convert>
352                                 </widget>
353                                 <widget font="Regular;20" noWrap="1" position="210,85" render="Label" size="736,30" source="session.Event_Now" transparent="1" zPosition="1">
354                                         <convert type="EventName">Name</convert>
355                                 </widget>
356                                 <widget font="Regular;20" foregroundColor="#fcc000" halign="right" position="290,50" render="Label" size="130,30" source="session.Event_Now" transparent="1" zPosition="1">
357                                         <convert type="EventTime">Remaining</convert>
358                                         <convert type="RemainingToText">InMinutes</convert>
359                                 </widget>
360                                 <widget font="Regular;20" position="210,333" render="Label" size="82,30" source="session.Event_Next" transparent="1" zPosition="1">
361                                         <convert type="EventTime">StartTime</convert>
362                                         <convert type="ClockToText">Default</convert>
363                                 </widget>
364                                 <widget font="Regular;20" foregroundColor="#aaaaaa" noWrap="1" position="210,300" render="Label" size="900,30" source="session.Event_Next" transparent="1" zPosition="1">
365                                         <convert type="EventName">Name</convert>
366                                 </widget>
367                                 <widget font="Regular;20" foregroundColor="#aaaaaa" position="295,333" render="Label" size="130,30" source="session.Event_Next" transparent="1" zPosition="1">
368                                         <convert type="EventTime">Duration</convert>
369                                         <convert type="ClockToText">InMinutes</convert>
370                                 </widget>
371                                 <widget backgroundColor="#555555" borderColor="#555555" borderWidth="4" position="425,55" render="Progress" size="120,14" source="session.Event_Now" zPosition="2">
372                                         <convert type="EventTime">Progress</convert>
373                                 </widget>
374                                 <widget font="Regular;18" position="210,115" render="Label" size="736,170" source="session.Event_Now" transparent="1" valign="top" zPosition="5">
375                                         <convert type="EventName">ExtendedDescription</convert>
376                                 </widget>
377                                 <widget font="Regular;18" foregroundColor="#aaaaaa" position="210,362" render="Label" size="736,170" source="session.Event_Next" transparent="1" valign="top" zPosition="5">
378                                         <convert type="EventName">ExtendedDescription</convert>
379                                 </widget>
380                         </screen>"""
381         else:
382                 skin = """
383                 <screen position="center,center" size="320,440" title="Easy Info">
384                         <widget name="list" position="10,10" size="300,420" scrollbarMode="showOnDemand" />
385                 </screen>"""
386         if pathExists('/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/icons/'):
387                 EINiconspath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/icons/'
388         else:
389                 EINiconspath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/'
390         def __init__(self, session):
391                 Screen.__init__(self, session)
392                 self.session = session
393                 self.list = []
394                 self.__keys = []
395                 MPaskList = []
396                 fertig = False
397                 if True:
398                         if config.plugins.EasyInfo.pos1.value != "no":
399                                 self.__keys.append(config.plugins.EasyInfo.pos1.value)
400                                 MPaskList.append(("info", config.plugins.EasyInfo.pos1.value))
401                                 self["key_info"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos1.value)))
402                         else: fertig = True
403                         if config.plugins.EasyInfo.pos2.value != "no" and not fertig:
404                                 self.__keys.append(config.plugins.EasyInfo.pos2.value)
405                                 MPaskList.append(("red", config.plugins.EasyInfo.pos2.value))
406                                 self["key_red"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos2.value)))
407                         else: fertig = True
408                         if config.plugins.EasyInfo.pos3.value != "no" and not fertig:
409                                 self.__keys.append(config.plugins.EasyInfo.pos3.value)
410                                 MPaskList.append(("green", config.plugins.EasyInfo.pos3.value))
411                                 self["key_green"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos3.value)))
412                         else: fertig = True
413                         if config.plugins.EasyInfo.pos4.value != "no" and not fertig:
414                                 self.__keys.append(config.plugins.EasyInfo.pos4.value)
415                                 MPaskList.append(("yellow", config.plugins.EasyInfo.pos4.value))
416                                 self["key_yellow"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos4.value)))
417                         else: fertig = True
418                         if config.plugins.EasyInfo.pos5.value != "no" and not fertig:
419                                 self.__keys.append(config.plugins.EasyInfo.pos5.value)
420                                 MPaskList.append(("blue", config.plugins.EasyInfo.pos5.value))
421                                 self["key_blue"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos5.value)))
422                         else: fertig = True
423                         if config.plugins.EasyInfo.pos6.value != "no" and not fertig:
424                                 self.__keys.append(config.plugins.EasyInfo.pos6.value)
425                                 MPaskList.append(("x", config.plugins.EasyInfo.pos6.value))
426                         else: fertig = True
427                         if config.plugins.EasyInfo.pos7.value != "no" and not fertig:
428                                 self.__keys.append(config.plugins.EasyInfo.pos7.value)
429                                 MPaskList.append(("x", config.plugins.EasyInfo.pos7.value))
430                         else: fertig = True
431                         if config.plugins.EasyInfo.pos8.value != "no" and not fertig:
432                                 self.__keys.append(config.plugins.EasyInfo.pos8.value)
433                                 MPaskList.append(("x", config.plugins.EasyInfo.pos8.value))
434                         else: fertig = True
435                         if config.plugins.EasyInfo.pos9.value != "no" and not fertig:
436                                 self.__keys.append(config.plugins.EasyInfo.pos9.value)
437                                 MPaskList.append(("x", config.plugins.EasyInfo.pos9.value))
438                         else: fertig = True
439                         if config.plugins.EasyInfo.pos10.value != "no" and not fertig:
440                                 self.__keys.append(config.plugins.EasyInfo.pos10.value)
441                                 MPaskList.append(("x", config.plugins.EasyInfo.pos10.value))
442                         else: fertig = True
443                         if config.plugins.EasyInfo.pos11.value != "no" and not fertig:
444                                 self.__keys.append(config.plugins.EasyInfo.pos11.value)
445                                 MPaskList.append(("x", config.plugins.EasyInfo.pos11.value))
446                 self.keymap = {}
447                 pos = 0
448                 for x in MPaskList:
449                         strpos = str(self.__keys[pos])
450                         self.list.append(EINPanelEntryComponent(key = strpos, text = x))
451                         if self.__keys[pos] != "":
452                                 self.keymap[self.__keys[pos]] = MPaskList[pos]
453                         pos += 1
454                 self["list"] = EINPanelList(list = self.list, selection = 0)
455                 self["actions"] = ActionMap(["WizardActions", "MenuActions", "ColorActions", "EPGSelectActions"],
456                 {
457                         "ok": self.go,
458                         "back": self.cancel,
459                         "menu": self.emContextMenu,
460                         "green": self.shotgreen,
461                         "red": self.shotred,
462                         "blue": self.shotblue,
463                         "yellow": self.shotyellow,
464                         "info": self.shotinfo
465                 }, -1)
466
467         def cancel(self):
468                 self.close(None)
469
470         def go(self):
471                 cursel = self["list"].l.getCurrentSelection()
472                 if cursel:
473                         antw = cursel[0]
474                         antw = antw and antw[1]
475                         EINcallbackFunc(antw)
476
477         def emContextMenu(self):
478                 self.session.open(ConfigEasyInfo)
479
480         def shotinfo(self):
481                 self["list"].moveToIndex(0)
482                 self.go()
483
484         def shotred(self):
485                 self["list"].moveToIndex(1)
486                 self.go()
487
488         def shotgreen(self):
489                 self["list"].moveToIndex(2)
490                 self.go()
491
492         def shotyellow(self):
493                 self["list"].moveToIndex(3)
494                 self.go()
495
496         def shotblue(self):
497                 self["list"].moveToIndex(4)
498                 self.go()
499
500
501
502 def EINchangeBouquetCB(direction, epg):
503         global EINposition
504         IBbouquets = InfoBar_instance.servicelist.getBouquetList()
505         if EINposition>0 and direction<0:
506                 EINposition = EINposition - 1
507         elif EINposition==0 and direction<0:
508                 EINposition = len(IBbouquets) - 1
509         elif EINposition<(len(IBbouquets)-1) and direction>0:
510                 EINposition = EINposition + 1
511         elif EINposition==(len(IBbouquets)-1) and direction>0:
512                 EINposition = 0
513         IBservices = InfoBar_instance.getBouquetServices(IBbouquets[EINposition][1])
514         if IBservices:
515                 epg.setServices(IBservices)
516
517
518
519 def EINzapTo(NewService):
520         IBbouquets = InfoBar_instance.servicelist.getBouquetList()
521         NewBbouquet = IBbouquets[EINposition][1]
522         InfoBar_instance.servicelist.clearPath()
523         if InfoBar_instance.servicelist.bouquet_root != NewBbouquet:
524                 InfoBar_instance.servicelist.enterPath(InfoBar_instance.servicelist.bouquet_root)
525         InfoBar_instance.servicelist.enterPath(NewBbouquet)
526         InfoBar_instance.servicelist.setCurrentSelection(NewService)
527         InfoBar_instance.servicelist.zap()
528
529
530
531 def EINcallbackFunc(answer):
532         if answer is None: return
533         if EINsession is None: return
534         if not InfoBar_instance: return
535         if answer == "singleepg":
536                 ref=InfoBar_instance.servicelist.getCurrentSelection()
537                 if ref:
538                         InfoBar_instance.servicelist.savedService = ref
539                         EINsession.openWithCallback(InfoBar_instance.servicelist.SingleServiceEPGClosed, EPGSelection, ref, serviceChangeCB = InfoBar_instance.servicelist.changeServiceCB)
540         elif answer == "easypg":
541                 bouquets = InfoBar_instance.servicelist.getBouquetList()
542                 if bouquets is None:
543                         cnt = 0
544                 else:
545                         cnt = len(bouquets)
546                         IBservices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
547                 if cnt > 1:
548                         InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
549                 elif cnt == 1:
550                         InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, None))
551         elif answer == "easysel":
552                 bouquets = InfoBar_instance.servicelist.getBouquetList()
553                 if bouquets is None:
554                         cnt = 0
555                 else:
556                         cnt = len(bouquets)
557                         IBservices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
558                 if cnt > 1:
559                         InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, EINchangeBouquetCB))
560                 elif cnt == 1:
561                         InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, None))
562         elif answer == "timers":
563                 EINsession.open(TimerEditList)
564         elif answer == "multiepg":
565                 bouquets = InfoBar_instance.servicelist.getBouquetList()
566                 if bouquets is None:
567                         cnt = 0
568                 else:
569                         cnt = len(bouquets)
570                 if cnt > 1:
571                         InfoBar_instance.bouquetSel = EINsession.openWithCallback(InfoBar_instance.closed, BouquetSelector, bouquets, InfoBar_instance.openBouquetEPG, enableWrapAround=True)
572                         InfoBar_instance.dlg_stack.append(InfoBar_instance.bouquetSel)
573                 elif cnt == 1:
574                         InfoBar_instance.openBouquetEPG(bouquets[0][1], True)
575         elif answer == "eventinfo":
576                 epglist = [ ]
577                 InfoBar_instance.epglist = epglist
578                 service = EINsession.nav.getCurrentService()
579                 ref = EINsession.nav.getCurrentlyPlayingServiceReference()
580                 info = service.info()
581                 ptr=info.getEvent(0)
582                 if ptr:
583                         epglist.append(ptr)
584                 ptr=info.getEvent(1)
585                 if ptr:
586                         epglist.append(ptr)
587                 if epglist:
588                         EINsession.open(EventViewSimple, epglist[0], ServiceReference(ref), InfoBar_instance.eventViewCallback)
589         elif answer == "merlinepg":
590                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MerlinEPG/plugin.pyo"):
591                         from Plugins.Extensions.MerlinEPG.plugin import Merlin_PGII, Merlin_PGd
592                         if config.plugins.MerlinEPG.Columns.value:
593                                 EINsession.open(Merlin_PGII, InfoBar_instance.servicelist)
594                         else:
595                                 EINsession.open(Merlin_PGd, InfoBar_instance.servicelist)
596                 else:
597                         EINsession.open(MessageBox, text = _('MerlinEPG is not installed!'), type = MessageBox.TYPE_INFO)
598         elif answer == "autotimer":
599                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/AutoTimer/AutoTimerEditor.pyo"):
600                         from Plugins.Extensions.AutoTimer.plugin import main as AutoTimerView
601                         AutoTimerView(EINsession)
602                 else:
603                         EINsession.open(MessageBox, text = _('Autotimer is not installed!'), type = MessageBox.TYPE_INFO)
604         elif answer == "epgsearch":
605                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGSearch/plugin.pyo"):
606                         from Plugins.Extensions.EPGSearch.EPGSearch import EPGSearch
607                         service = EINsession.nav.getCurrentService()
608                         info = service.info()
609                         epg_event=info.getEvent(0)
610                         if epg_event:
611                                 epg_name = epg_event and epg_event.getEventName() or ''
612                                 EINsession.open(EPGSearch, epg_name, False)
613                 else:
614                         EINsession.open(MessageBox, text = _('EPGsearch is not installed!'), type = MessageBox.TYPE_INFO)
615         elif answer == "channelinfo":
616                 EINsession.open(ServiceInfo, InfoBar_instance.servicelist.getCurrentSelection())
617         elif answer == "imdbinfo":
618                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/IMDb/plugin.pyo"):
619                         from Plugins.Extensions.IMDb.plugin import IMDB
620                         service = EINsession.nav.getCurrentService()
621                         info = service.info()
622                         epg_event=info.getEvent(0)
623                         if epg_event:
624                                 IeventName = epg_event.getEventName()
625                                 EINsession.open(IMDB, IeventName)
626                 else:
627                         EINsession.open(MessageBox, text = _('IMDB is not installed!'), type = MessageBox.TYPE_INFO)
628         elif answer == "graphepg":
629                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG/plugin.pyo"):
630                         from Plugins.Extensions.GraphMultiEPG.plugin import main as gmepgmain
631                         gmepgmain(EINsession, InfoBar_instance.servicelist)
632                 else:
633                         EINsession.open(MessageBox, text = _('GraphMultiEPG is not installed!'), type = MessageBox.TYPE_INFO)
634         elif answer == "primetime":
635                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/PrimeTimeManager/plugin.pyo"):
636                         from Plugins.Extensions.PrimeTimeManager.plugin import main as ptmanmain
637                         ptmanmain(EINsession)
638                 else:
639                         EINsession.open(MessageBox, text = _('Prime Time Manager is not installed!'), type = MessageBox.TYPE_INFO)
640         elif answer == "epgrefresh":
641                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGRefresh/plugin.pyo"):
642                         from Plugins.Extensions.EPGRefresh.plugin import main as epgrefmain
643                         epgrefmain(EINsession)
644                 else:
645                         EINsession.open(MessageBox, text = _('EPGRefresh is not installed!'), type = MessageBox.TYPE_INFO)
646         elif answer == "cooltv":
647                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/CoolTVGuide/plugin.pyo"):
648                         from Plugins.Extensions.CoolTVGuide.plugin import main as ctvmain
649                         ctvmain(EINsession, InfoBar_instance.servicelist)
650                 else:
651                         EINsession.open(MessageBox, text = _('CoolTVGuide is not installed!'), type = MessageBox.TYPE_INFO)
652         elif answer == "sysinfo":
653                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/Sherlock/plugin.pyo"):
654                         from Plugins.Extensions.Sherlock.plugin import SherlockII
655                         EINsession.open(SherlockII)
656                 else:
657                         EINsession.open(MessageBox, text = _('Sherlock is not installed!'), type = MessageBox.TYPE_INFO)
658         elif answer == "sleep":
659                 from Screens.SleepTimerEdit import SleepTimerEdit
660                 EINsession.open(SleepTimerEdit)
661         else:
662                 EINsession.open(MessageBox, text = _('This function is yet not available!'), type = MessageBox.TYPE_INFO)
663
664
665
666 class EasyEvent(Screen, EventViewBase):
667         def __init__(self, session, Event, Ref, callback=None, singleEPGCB=None, multiEPGCB=None):
668                 Screen.__init__(self, session)
669                 self.session = session
670                 self.skinName = "EventView"
671                 EventViewBase.__init__(self, Event, Ref, callback=InfoBar_instance.eventViewCallback)
672                 self["key_yellow"].setText(_(getPluginByName(config.plugins.EasyInfo.bEvInYellow.value)))
673                 self["key_blue"].setText(_(getPluginByName(config.plugins.EasyInfo.bEvInBlue.value)))
674                 self["key_red"].setText(_("Similar"))
675                 self["epgactions"] = ActionMap(["EventViewEPGActions", "EPGSelectActions",  "EventViewActions"],
676                         {
677                                 "openSingleServiceEPG": self.singleEPGCB,
678                                 "openMultiServiceEPG": self.multiEPGCB,
679                                 "openSimilarList": self.openSimilarList,
680                                 "info": self.newExit,
681                                 "pageUp": self.pageUp,
682                                 "pageDown": self.pageDown,
683                                 "prevEvent": self.prevEvent,
684                                 "nextEvent": self.nextEvent
685                         },-1)
686
687         def openSimilarList(self):
688                 self.hide()
689                 EINcallbackFunc("epgsearch")
690                 self.close()
691
692         def singleEPGCB(self):
693                 self.hide()
694                 EINcallbackFunc(config.plugins.EasyInfo.bEvInYellow.value)
695                 self.close()
696
697         def multiEPGCB(self):
698                 self.hide()
699                 EINcallbackFunc(config.plugins.EasyInfo.bEvInBlue.value)
700                 self.close()
701
702         def setEvent(self, event):
703                 self.event = event
704                 if event is None:
705                         return
706                 text = event.getEventName()
707                 short = event.getShortDescription()
708                 ext = event.getExtendedDescription()
709                 if short and short != text:
710                         text += '\n\n' + short
711                 if ext:
712                         if text:
713                                 text += '\n\n'
714                         text += ext
715                 self.setTitle(event.getEventName())
716                 self["epg_description"].setText(text)
717                 self["datetime"].setText(event.getBeginTimeString())
718                 self["duration"].setText(_("%d min")%(event.getDuration()/60))
719                 self["key_red"].setText(_("Similar"))
720                 serviceref = self.currentService
721                 eventid = self.event.getEventId()
722                 refstr = serviceref.ref.toString()
723                 isRecordEvent = False
724                 for timer in self.session.nav.RecordTimer.timer_list:
725                         if timer.eit == eventid and timer.service_ref.ref.toString() == refstr:
726                                 isRecordEvent = True
727                                 break
728                 if isRecordEvent and self.key_green_choice != self.REMOVE_TIMER:
729                         self["key_green"].setText(_("Remove timer"))
730                         self.key_green_choice = self.REMOVE_TIMER
731                 elif not isRecordEvent and self.key_green_choice != self.ADD_TIMER:
732                         self["key_green"].setText(_("Add timer"))
733                         self.key_green_choice = self.ADD_TIMER
734
735         def newExit(self):
736                 self.hide()
737                 self.session.open(EasyInfo)
738                 self.close()
739
740
741
742 class DummyTimerEntry:
743         def __init__(self, serviceref, begin, end):
744                 self.service_ref = serviceref
745                 self.begin = begin
746                 self.end = end
747                 self.repeated = 0
748                 self.disabled = False
749
750
751
752 class EvNewList(EPGList):
753         def __init__(self, type=EPG_TYPE_MULTI, selChangedCB=None, timer = None):
754                 EPGList.__init__(self, type, selChangedCB, timer)
755                 self.l.setFont(0, gFont("Regular", 20))
756                 self.l.setFont(1, gFont("Regular", 18))
757                 self.l.setItemHeight(50)
758                 self.l.setBuildFunc(self.buildMultiEntry)
759                 self.breite = 200
760                 MyPiconPath = "/"
761
762         def recalcEntrySize(self):
763                 esize = self.l.getItemSize()
764                 self.breite = esize.width() - 200
765
766         def buildMultiEntry(self, changecount, service, eventId, beginTime, duration, EventName, nowTime, service_name):
767                 (clock_pic, rec) = self.getPixmapForEntry(service, eventId, beginTime, duration)
768                 colorEventAvailable = self.getColorEventAvailable(service, beginTime, duration)
769                 res = [ None ]
770                 sref = str(service)[:-1].replace(':','_')
771                 Spixmap = LoadPixmap(path=(config.plugins.EasyInfo.myPicons.value + sref + '.png'))
772                 if Spixmap is not None:
773                         res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, 5, 4, 70, 42, Spixmap))
774                 else:
775                         res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 77, 50, 1, RT_HALIGN_CENTER|RT_VALIGN_CENTER|RT_WRAP, service_name))
776                 if rec:
777                         res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 80, 16, 21, 21, clock_pic))
778                 if beginTime is not None and len(EventName) > 60:
779                         if nowTime < beginTime:
780                                 begin = localtime(beginTime)
781                                 end = localtime(beginTime+duration)
782                                 res.extend((
783                                         (eListboxPythonMultiContent.TYPE_TEXT, 100, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
784                                         (eListboxPythonMultiContent.TYPE_TEXT, 110, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
785                                         (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
786                                 ))
787                         else:
788                                 percent = (nowTime - beginTime)*100/duration
789                                 restzeit = ((beginTime+duration)-nowTime)
790                                 res.extend((
791                                         (eListboxPythonMultiContent.TYPE_PROGRESS, 110, 11, 40, 8, percent),
792                                         (eListboxPythonMultiContent.TYPE_TEXT, 110, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
793                                         (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
794                                 ))
795                 elif beginTime is not None:
796                         if nowTime < beginTime:
797                                 begin = localtime(beginTime)
798                                 end = localtime(beginTime+duration)
799                                 res.extend((
800                                         (eListboxPythonMultiContent.TYPE_TEXT, 100, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
801                                         (eListboxPythonMultiContent.TYPE_TEXT, 110, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
802                                         (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName, colorEventAvailable, colorEventAvailable)
803                                 ))
804                         else:
805                                 percent = (nowTime - beginTime)*100/duration
806                                 restzeit = ((beginTime+duration)-nowTime)
807                                 res.extend((
808                                         (eListboxPythonMultiContent.TYPE_PROGRESS, 110, 11, 40, 8, percent),
809                                         (eListboxPythonMultiContent.TYPE_TEXT, 110, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
810                                         (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName, colorEventAvailable, colorEventAvailable)
811                                 ))
812                 return res
813
814         def moveToService(self,serviceref):
815                 if not serviceref:
816                         return
817                 index = 0
818                 refstr = serviceref.toString()
819                 for x in self.list:
820                         if x[1] == refstr:
821                                 self.instance.moveSelectionTo(index)
822                                 break
823                         index += 1
824                 if x[1] != refstr:
825                         self.instance.moveSelectionTo(0)
826         
827         def getColorEventAvailable(self, service, beginTime, duration):
828                 colorEventAvailable =  None
829                 if beginTime and duration:
830                         endTime = beginTime + duration
831                         timerlist = []
832                         serviceref = ServiceReference(service)
833                         for x in self.timer.timer_list:
834                                 if x.repeated and not x.disabled:
835                                         timerlist = self.timer.timer_list
836                                         break
837                         if not timerlist:
838                                 ref = serviceref.ref
839                                 refList = []
840                                 if ref.flags & eServiceReference.isGroup:
841                                         serviceList = serviceHandler.list(ref)
842                                         if serviceList:
843                                                 for ref in serviceList.getContent("R"):
844                                                         refList.append(ref.toString())
845                                 else:
846                                         refList.append(ref.toString())          
847                                 for timer in self.timer.timer_list:
848                                         if not x.disabled:                                      
849                                                 check = 0
850                                                 ref = timer.service_ref.ref
851                                                 if ref.flags & eServiceReference.isGroup:
852                                                         serviceList = serviceHandler.list(ref)
853                                                         if serviceList:
854                                                                 for ref in serviceList.getContent("R"):
855                                                                         if ref.toString() not in refList:
856                                                                                 check = 1
857                                                                                 break
858                                                 else:
859                                                         if ref.toString() not in refList:
860                                                                 check = 1
861                                                 if check:
862                                                         if (max(beginTime, timer.begin) < min(endTime, timer.end)):
863                                                                 timerlist.append(timer)
864                         if timerlist:
865                                 timersanitycheck = TimerSanityCheck(timerlist, DummyTimerEntry(serviceref, beginTime, endTime))
866                                 if not timersanitycheck.check(filter_check = 1):
867                                         colorEventAvailable = 0x777777
868                 return colorEventAvailable
869
870
871
872 class EasyPG(EPGSelection, Screen):
873         if SKINTYPE == 3:
874                 skin = """
875                 <screen name="EasyPG" backgroundColor="#101220" flags="wfNoBorder" position="0,0" size="1280,720" title="Easy PG">
876                         <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="60,35" size="660,650" zPosition="-1"/>
877                         <widget font="Regular;20" position="785,30" render="Label" size="202,25" source="global.CurrentTime" transparent="1" zPosition="1">
878                                 <convert type="ClockToText">Format:%a %d. %b   %H:%M</convert>
879                         </widget>
880                         <widget backgroundColor="#ff000000" position="755,125" render="Pig" size="497,280" source="session.VideoPicture" zPosition="1"/>
881                         <widget foregroundColor="#fcc000" font="Regular;20" name="date" position="755,415" size="100,25" transparent="1"/>
882                         <widget name="list" position="60,35" scrollbarMode="showNever" size="660,650" transparent="1"/>
883                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-red.png" position="785,65" size="5,20"/>
884                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-green.png" position="785,90" size="5,20"/>
885                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-yellow.png" position="1005,65" size="5,20"/>
886                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-blue.png" position="1005,90" size="5,20"/>
887                         <eLabel font="Regular;18" position="800,63" size="150,25" text="Similar" transparent="1"/>
888                         <eLabel font="Regular;18" position="800,90" size="150,25" text="Timer" transparent="1"/>
889                         <eLabel font="Regular;18" position="1015,63" size="150,25" text="Back" transparent="1"/>
890                         <eLabel font="Regular;18" position="1015,90" size="150,25" text="Next" transparent="1"/>
891                         <widget font="Regular;20" halign="right" position="870,415" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
892                                 <convert type="EventTime">StartTime</convert>
893                                 <convert type="ClockToText">Default</convert>
894                         </widget>
895                         <eLabel font="Regular;18" position="945,415" size="10,25" text="-" transparent="1"/>
896                         <widget font="Regular;20" position="955,415" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
897                                 <convert type="EventTime">EndTime</convert>
898                                 <convert type="ClockToText">Default</convert>
899                         </widget>
900                         <widget font="Regular;20" position="1050,415" render="Label" size="171,25" source="Event" transparent="1" zPosition="1">
901                         <convert type="EventTime">Duration</convert>
902                                 <convert type="ClockToText">InMinutes</convert>
903                         </widget>
904                         <widget font="Regular;20" position="755,445" render="Label" size="480,25" source="Event" transparent="1" zPosition="2" noWrap="1">
905                                 <convert type="EventName">ShortDescription</convert>
906                         </widget>
907                         <widget font="Regular;18" position="755,475" render="Label" size="480,210" source="Event" transparent="1" zPosition="3">
908                                 <convert type="EventName">ExtendedDescription</convert>
909                         </widget>
910                 </screen>"""
911         elif SKINTYPE == 2:
912                 skin = """
913                 <screen name="EasyPG" backgroundColor="#0e1018" flags="wfNoBorder" position="0,0" size="1024,576" title="Easy PG">
914                         <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="50,50" size="520,450" zPosition="-1"/>
915                         <eLabel backgroundColor="#666666" position="0,518" size="1024,1"/>
916                         <widget font="Regular;20" position="50,525" render="Label" size="186,25" source="global.CurrentTime" transparent="1" zPosition="1">
917                                 <convert type="ClockToText">Format:%a %d. %b   %H:%M</convert>
918                         </widget>
919                         <widget backgroundColor="#ff000000" position="590,30" render="Pig" size="384,216" source="session.VideoPicture" zPosition="-1"/>
920                         <widget foregroundColor="#fcc000" font="Regular;20" name="date" position="590,255" size="100,25" transparent="1"/>
921                         <widget name="list" position="50,48" scrollbarMode="showNever" size="520,450" transparent="1"/>
922                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-red.png" position="275,525" size="5,20"/>
923                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-green.png" position="450,525" size="5,20"/>
924                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-yellow.png" position="625,525" size="5,20"/>
925                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-blue.png" position="800,525" size="5,20"/>
926                         <eLabel font="Regular;18" position="290,526" size="150,25" text="Similar" transparent="1"/>
927                         <eLabel font="Regular;18" position="465,526" size="150,25" text="Timer" transparent="1"/>
928                         <eLabel font="Regular;18" position="640,526" size="150,25" text="Back" transparent="1"/>
929                         <eLabel font="Regular;18" position="815,526" size="150,25" text="Next" transparent="1"/>
930                         <widget font="Regular;20" halign="right" position="695,255" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
931                                 <convert type="EventTime">StartTime</convert>
932                                 <convert type="ClockToText">Default</convert>
933                         </widget>
934                         <eLabel font="Regular;18" position="770,255" size="10,25" text="-" transparent="1"/>
935                         <widget font="Regular;20" position="780,255" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
936                                 <convert type="EventTime">EndTime</convert>
937                                 <convert type="ClockToText">Default</convert>
938                         </widget>
939                         <widget font="Regular;20" position="855,255" render="Label" size="130,25" source="Event" transparent="1" zPosition="1">
940                         <convert type="EventTime">Duration</convert>
941                                 <convert type="ClockToText">InMinutes</convert>
942                         </widget>
943                         <widget font="Regular;20" noWrap="1" position="590,285" render="Label" size="390,25" source="Event" transparent="1" zPosition="2">
944                                 <convert type="EventName">ShortDescription</convert>
945                         </widget>
946                         <widget font="Regular;18" position="590,315" render="Label" size="390,190" source="Event" transparent="1" zPosition="3">
947                                 <convert type="EventName">ExtendedDescription</convert>
948                         </widget>
949                 </screen>
950                 """
951         else:
952                 skin = """
953                 <screen name="EasyPG" backgroundColor="background" flags="wfNoBorder" position="0,0" size="720,576" title="Easy PG">
954                         <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="50,48" size="620,450" zPosition="-1"/>
955                         <eLabel backgroundColor="#666666" position="0,522" size="756,1"/>
956                         <widget foregroundColor="#fcc000" font="Regular;20" name="date" position="50,525" size="100,25" transparent="1"/>
957                         <widget name="list" position="50,48" scrollbarMode="showOnDemand" size="620,450" transparent="1"/>
958                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-red.png" position="175,525" size="5,20"/>
959                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-yellow.png" position="350,525" size="5,20"/>
960                         <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-blue.png" position="525,525" size="5,20"/>
961                         <eLabel font="Regular;18" position="190,526" size="150,25" text="Similar" transparent="1"/>
962                         <eLabel font="Regular;18" position="365,526" size="150,25" text="Back" transparent="1"/>
963                         <eLabel font="Regular;18" position="540,526" size="150,25" text="Next" transparent="1"/>
964                 </screen>
965                 """
966         def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None, serviceChangeCB=None):
967                 Screen.__init__(self, session)
968                 EPGSelection.__init__(self, session, service, zapFunc, eventid, bouquetChangeCB, serviceChangeCB)
969                 global EINposition
970                 EINposition = 0
971                 allbouq = InfoBar_instance.servicelist.getBouquetList()
972                 for newpos in range(0, len(allbouq)):
973                         if InfoBar_instance.servicelist.getRoot() == allbouq[newpos][1]:
974                                 EINposition = newpos
975                                 break
976                 self.PTinit = False
977                 self.session = session
978                 EPGSelection.skinName = "EasyPG"
979                 self.PThour = config.plugins.EasyInfo.Primetime2.value[0]
980                 self.PTmin = config.plugins.EasyInfo.Primetime2.value[1]
981                 self["list"] = EvNewList(type = EPG_TYPE_MULTI, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
982                 self.skinName = "EasyPG"
983                 self.RefrTimer = eTimer()
984                 self.RefrTimer.callback.append(self.RefreshEPG)
985                 self["actions"] = ActionMap(["EPGSelectActions", "OkCancelActions", "NumberActions", "InfobarActions"],
986                         {
987                                 "cancel": self.closeScreen,
988                                 "ok": self.newOKFunc,
989                                 "timerAdd": self.timerAdd,
990                                 "yellow": self.yellowButtonPressed,
991                                 "blue": self.blueButtonPressed,
992                                 "info": self.infoKeyPressed,
993                                 "red": self.newRedFunc,
994                                 "input_date_time": self.einContextMenu,
995                                 "nextBouquet": self.nextBouquet,
996                                 "prevBouquet": self.prevBouquet,
997                                 "nextService": self.PTfor,
998                                 "prevService": self.PTback,
999                                 "showMovies": self.enterDateTime,
1000                                 "showTv": self.zapTo,
1001                                 "showRadio": self.zapForRefr,
1002                                 "0": self.GoFirst,
1003                                 "1": self.SetPT1,
1004                                 "2": self.SetPT2,
1005                                 "3": self.SetPT3
1006                         },-1)
1007
1008         def closeScreen(self):
1009                 self.close(True)
1010
1011         def GoFirst(self):
1012                 self["list"].fillMultiEPG(self.services, -1)
1013                 self.PTinit = False
1014
1015         def GoPrimetime(self):
1016                 heute = localtime()
1017                 pt = (heute[0],heute[1],heute[2],self.PThour,self.PTmin,0,heute[6],heute[7],0)
1018                 self.ask_time = int(mktime(pt))
1019                 self.PTinit = True
1020                 if self.ask_time > int(mktime(heute)):
1021                         self["list"].fillMultiEPG(self.services, self.ask_time)
1022
1023         def newOKFunc(self):
1024                 if  config.plugins.EasyInfo.epgOKFunc.value == "exitzap":
1025                         self.zapTo()
1026                         self.close(True)
1027                 elif config.plugins.EasyInfo.epgOKFunc.value == "zap":
1028                         self.zapTo()
1029                 else:
1030                         self.infoKeyPressed()
1031
1032         def newRedFunc(self):
1033                 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGSearch/plugin.pyo"):
1034                         from Plugins.Extensions.EPGSearch.EPGSearch import EPGSearch
1035                         epg_event = self["list"].getCurrent()[0]
1036                         if epg_event:
1037                                 epg_name = epg_event and epg_event.getEventName() or ''
1038                                 self.session.open(EPGSearch, epg_name, False)
1039                 else:
1040                         self.session.open(MessageBox, text = _('EPGsearch is not installed!'), type = MessageBox.TYPE_INFO)
1041
1042         def PTfor(self):
1043                 if not self["list"].getCurrent()[0]:
1044                         return
1045                 heute = localtime()
1046                 if not self.PTinit:
1047                         pt = (heute[0],heute[1],heute[2],self.PThour,self.PTmin,0,heute[6],heute[7],0)
1048                         self.ask_time = int(mktime(pt))
1049                         self.PTinit = True
1050                         if self.ask_time < int(mktime(heute)):
1051                                 self.ask_time = self.ask_time + 86400
1052                 else:
1053                         self.ask_time = self.ask_time + 86400
1054                 self["list"].fillMultiEPG(self.services, self.ask_time)
1055
1056         def PTback(self):
1057                 heute = localtime()
1058                 if not self.PTinit:
1059                         pt = (heute[0],heute[1],heute[2],self.PThour,self.PTmin,0,heute[6],heute[7],0)
1060                         self.ask_time = int(mktime(pt))
1061                         self.PTinit = True
1062                 else:
1063                         self.ask_time = self.ask_time - 86400
1064                 if self.ask_time > int(mktime(heute)):
1065                         self["list"].fillMultiEPG(self.services, self.ask_time)
1066                 else:
1067                         self["list"].fillMultiEPG(self.services, -1)
1068                         self.PTinit = False
1069
1070         def SetPT1(self):
1071                 self.PThour = config.plugins.EasyInfo.Primetime1.value[0]
1072                 self.PTmin = config.plugins.EasyInfo.Primetime1.value[1]
1073                 self.GoPrimetime()
1074
1075         def SetPT2(self):
1076                 self.PThour = config.plugins.EasyInfo.Primetime2.value[0]
1077                 self.PTmin = config.plugins.EasyInfo.Primetime2.value[1]
1078                 self.GoPrimetime()
1079
1080         def SetPT3(self):
1081                 self.PThour = config.plugins.EasyInfo.Primetime3.value[0]
1082                 self.PTmin = config.plugins.EasyInfo.Primetime3.value[1]
1083                 self.GoPrimetime()
1084
1085         def einContextMenu(self):
1086                 self.session.open(ConfigEasyInfo)
1087
1088         def zapForRefr(self):
1089                 self.zapTo()
1090                 self.RefrTimer.start(4000, True)
1091
1092         def RefreshEPG(self):
1093                 self.RefrTimer.stop()
1094                 self.GoFirst()
1095
1096
1097
1098 class ESListNext(EvNewList):
1099         def __init__(self, type=EPG_TYPE_MULTI, selChangedCB=None, timer = None):
1100                 EvNewList.__init__(self, type, selChangedCB, timer)
1101
1102         def recalcEntrySize(self):
1103                 esize = self.l.getItemSize()
1104                 self.breite = esize.width() - 100
1105
1106         def buildMultiEntry(self, changecount, service, eventId, beginTime, duration, EventName, nowTime, service_name):
1107                 (clock_pic, rec) = self.getPixmapForEntry(service, eventId, beginTime, duration)
1108                 colorEventAvailable = self.getColorEventAvailable(service, beginTime, duration)
1109                 res = [ None ]
1110                 if rec:
1111                         res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 58, 16, 21, 21, clock_pic))
1112                 if beginTime is not None and len(EventName) > 60:
1113                         if nowTime < beginTime:
1114                                 begin = localtime(beginTime)
1115                                 end = localtime(beginTime+duration)
1116                                 res.extend((
1117                                         (eListboxPythonMultiContent.TYPE_TEXT, 0, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
1118                                         (eListboxPythonMultiContent.TYPE_TEXT, 10, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
1119                                         (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName, colorEventAvailable, colorEventAvailable)
1120                                 ))
1121                         else:
1122                                 percent = (nowTime - beginTime)*100/duration
1123                                 restzeit = ((beginTime+duration)-nowTime)
1124                                 res.extend((
1125                                         (eListboxPythonMultiContent.TYPE_PROGRESS, 10, 11, 40, 8, percent),
1126                                         (eListboxPythonMultiContent.TYPE_TEXT, 10, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
1127                                         (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName, colorEventAvailable, colorEventAvailable)
1128                                 ))
1129                 elif beginTime is not None:
1130                         if nowTime < beginTime:
1131                                 begin = localtime(beginTime)
1132                                 end = localtime(beginTime+duration)
1133                                 res.extend((
1134                                         (eListboxPythonMultiContent.TYPE_TEXT, 0, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
1135                                         (eListboxPythonMultiContent.TYPE_TEXT, 10, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
1136                                         (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
1137                                 ))
1138                         else:
1139                                 percent = (nowTime - beginTime)*100/duration
1140                                 restzeit = ((beginTime+duration)-nowTime)
1141                                 res.extend((
1142                                         (eListboxPythonMultiContent.TYPE_PROGRESS, 10, 11, 40, 8, percent),
1143                                         (eListboxPythonMultiContent.TYPE_TEXT, 10, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
1144                                         (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
1145                                 ))
1146                 return res
1147
1148
1149
1150 class EasySelection(EPGSelection, Screen):
1151         if SKINTYPE == 3:
1152                 skin = """
1153                 <screen name="EasySelection" backgroundColor="background" flags="wfNoBorder" position="0,0" size="1280,720" title="Easy Selection">
1154                         <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="60,35" size="660,650" zPosition="-1"/>
1155                         <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="720,35" size="500,650" zPosition="-1"/>
1156                         <widget name="list" position="60,35" scrollbarMode="showNever" size="660,650" transparent="1"/>
1157                         <widget name="listN" position="720,35" scrollbarMode="showNever" size="500,650" transparent="1"/>
1158                 </screen>"""
1159         elif SKINTYPE == 2:
1160                 skin = """
1161                 <screen name="EasySelection" backgroundColor="background" flags="wfNoBorder" position="0,0" size="1024,576" title="Easy Selection">
1162                         <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="40,38" size="660,500" zPosition="-1"/>
1163                         <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="700,38" size="284,500" zPosition="-1"/>
1164                         <widget name="list" position="40,38" scrollbarMode="showNever" size="520,500" transparent="1"/>
1165                         <widget name="listN" position="560,38" scrollbarMode="showNever" size="444,500" transparent="1"/>
1166                 </screen>
1167                 """
1168         else:
1169                 skin = """
1170                 <screen name="EasySelection" backgroundColor="background" flags="wfNoBorder" position="0,0" size="720,576" title="Easy Selection">
1171                         <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="50,38" size="620,500" zPosition="-1"/>
1172                         <widget name="list" position="50,38" scrollbarMode="showOnDemand" size="620,500" transparent="1"/>
1173                 </screen>
1174                 """
1175         def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None, serviceChangeCB=None):
1176                 Screen.__init__(self, session)
1177                 EPGSelection.__init__(self, session, service, zapFunc, eventid, bouquetChangeCB, serviceChangeCB)
1178                 global EINposition
1179                 EINposition = 0
1180                 allbouq = InfoBar_instance.servicelist.getBouquetList()
1181                 for newpos in range(0, len(allbouq)):
1182                         if InfoBar_instance.servicelist.getRoot() == allbouq[newpos][1]:
1183                                 EINposition = newpos
1184                                 break
1185                 self.session = session
1186                 EPGSelection.skinName = "EasySelection"
1187                 self["list"] = EvNewList(type = EPG_TYPE_MULTI, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
1188                 self["listN"] = ESListNext(type = EPG_TYPE_MULTI, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
1189                 self.skinName = "EasySelection"
1190                 self["actions"] = ActionMap(["EPGSelectActions", "OkCancelActions", "DirectionActions"],
1191                         {
1192                                 "cancel": self.closeScreen,
1193                                 "ok": self.newOKFunc,
1194                                 "info": self.infoKeyPressed,
1195                                 "nextBouquet": self.nextBouquet,
1196                                 "prevBouquet": self.prevBouquet,
1197                                 "right": self.right,
1198                                 "rightRepeated": self.right,
1199                                 "left": self.left,
1200                                 "leftRepeated": self.left,
1201                                 "up": self.up,
1202                                 "upRepeated": self.up,
1203                                 "down": self.down,
1204                                 "downRepeated": self.down,
1205                                 "nextService": self.PrimeTimeLook,
1206                                 "prevService": self.NowNextLook
1207                         },-1)
1208                 self.onLayoutFinish.append(self.byLayoutEnd)
1209
1210         def byLayoutEnd(self):
1211                 self["listN"].recalcEntrySize()
1212                 self["listN"].fillMultiEPG(self.services, -1)
1213                 self["listN"].moveToService(self.session.nav.getCurrentlyPlayingServiceReference())
1214                 self["listN"].updateMultiEPG(1)
1215
1216         def closeScreen(self):
1217                 self.close(True)
1218
1219         def newOKFunc(self):
1220                 self.zapTo()
1221                 self.close(True)
1222
1223         def left(self):
1224                 self["list"].instance.moveSelection(self["list"].instance.pageUp)
1225                 self["listN"].instance.moveSelection(self["list"].instance.pageUp)
1226
1227         def right(self):
1228                 self["list"].instance.moveSelection(self["list"].instance.pageDown)
1229                 self["listN"].instance.moveSelection(self["list"].instance.pageDown)
1230
1231         def up(self):
1232                 self["list"].moveUp()
1233                 self["listN"].moveUp()
1234
1235         def down(self):
1236                 self["list"].moveDown()
1237                 self["listN"].moveDown()
1238
1239         def nextBouquet(self):
1240                 if self.bouquetChangeCB:
1241                         self.bouquetChangeCB(1, self)
1242                         self.byLayoutEnd()
1243
1244         def prevBouquet(self):
1245                 if self.bouquetChangeCB:
1246                         self.bouquetChangeCB(-1, self)
1247                         self.byLayoutEnd()
1248
1249         def PrimeTimeLook(self):
1250                 heute = localtime()
1251                 pt = (heute[0],heute[1],heute[2],config.plugins.EasyInfo.Primetime2.value[0],config.plugins.EasyInfo.Primetime2.value[1],0,heute[6],heute[7],0)
1252                 ask_time = int(mktime(pt))
1253                 if ask_time > int(mktime(heute)):
1254                         self["list"].fillMultiEPG(self.services, ask_time)
1255                         self["listN"].fillMultiEPG(self.services, ask_time)
1256                         self["listN"].updateMultiEPG(1)
1257
1258         def NowNextLook(self):
1259                 self["list"].fillMultiEPG(self.services, -1)
1260                 self["listN"].fillMultiEPG(self.services, -1)
1261                 self["listN"].updateMultiEPG(1)
1262
1263         def infoKeyPressed(self):
1264                 cur = self["list"].getCurrent()
1265                 service = cur[1].ref.toString()
1266                 ref = eServiceReference(service)
1267                 if ref:
1268                         InfoBar_instance.servicelist.savedService = ref
1269                         self.session.openWithCallback(InfoBar_instance.servicelist.SingleServiceEPGClosed, EPGSelection, ref, serviceChangeCB = InfoBar_instance.servicelist.changeServiceCB)
1270
1271
1272
1273
1274
1275
1276
1277         
1278
1279
1280
1281