1 #######################################################################
3 # EasyInfo for Dreambox-Enigma2
4 # Coded by Vali (c)2011
5 # Support: www.dreambox-tools.info
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.
12 # Alternatively, this plugin may be distributed and executed on hardware which
13 # is licensed by Dream Multimedia GmbH.
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.
19 #######################################################################
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 Tools.Directories import fileExists, pathExists
42 from Tools.LoadPixmap import LoadPixmap
43 from Tools.HardwareInfo import HardwareInfo
44 from ServiceReference import ServiceReference
45 from enigma import eListboxPythonMultiContent, gFont, getDesktop, eTimer, RT_HALIGN_LEFT, RT_HALIGN_CENTER, RT_VALIGN_CENTER, RT_WRAP, RT_HALIGN_RIGHT, RT_VALIGN_TOP
46 from time import localtime, time, mktime
50 EINbaseInfoBarPlugins__init__ = None
51 EINStartOnlyOneTime = False
54 InfoBar_instance = None
55 mepg_config_initialized = False
56 sz_w = getDesktop(0).size().width()
66 CHOICELIST=[("no", _("Disabled")),
67 ("eventinfo", _("Event info")),
68 ("singleepg", _("Single EPG")),
69 ("multiepg", _("Multi EPG")),
70 ("easypg", _("Easy-PG")),
71 ("easysel", _("Easy-Selection")),
72 ("graphepg", _("Graphik multi-EPG")),
73 ("merlinepg", _("Merlin EPG")),
74 ("cooltv", _("Cool-TV")),
75 ("timers", _("Timerlist")),
76 ("epgsearch", _("EPG search")),
77 ("autotimer", _("Autotimer")),
78 ("channelinfo", _("Channel info")),
79 ("imdbinfo", _("IMDB info")),
80 ("primetime", _("Prime Time Manager")),
81 ("epgrefresh", _("EPG refresh")),
82 ("sleep", _("Sleep timer")),
83 ("sysinfo", _("Sherlock"))
85 config.plugins.EasyInfo = ConfigSubsection()
86 config.plugins.EasyInfo.pos1 = ConfigSelection(default="eventinfo", choices = CHOICELIST)
87 config.plugins.EasyInfo.pos2 = ConfigSelection(default="singleepg", choices = CHOICELIST)
88 config.plugins.EasyInfo.pos3 = ConfigSelection(default="merlinepg", choices = CHOICELIST)
89 config.plugins.EasyInfo.pos4 = ConfigSelection(default="timers", choices = CHOICELIST)
90 config.plugins.EasyInfo.pos5 = ConfigSelection(default="channelinfo", choices = CHOICELIST)
91 config.plugins.EasyInfo.pos6 = ConfigSelection(default="no", choices = CHOICELIST)
92 config.plugins.EasyInfo.pos7 = ConfigSelection(default="no", choices = CHOICELIST)
93 config.plugins.EasyInfo.pos8 = ConfigSelection(default="no", choices = CHOICELIST)
94 config.plugins.EasyInfo.pos9 = ConfigSelection(default="no", choices = CHOICELIST)
95 config.plugins.EasyInfo.pos10 = ConfigSelection(default="no", choices = CHOICELIST)
96 config.plugins.EasyInfo.pos11 = ConfigSelection(default="no", choices = CHOICELIST)
97 config.plugins.EasyInfo.EvInStart = ConfigSelection(default="yes", choices = [("no", _("Disabled")), ("yes", _("Enabled"))])
98 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"))])
99 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"))])
100 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/")])
101 config.plugins.EasyInfo.epgOKFunc = ConfigSelection(default="info", choices = [("info", _("Event info")), ("zap", _("Just zap")),("exitzap", _("Zap and Exit"))])
102 config.plugins.EasyInfo.Primetime1 = ConfigClock(default = 63000)
103 config.plugins.EasyInfo.Primetime2 = ConfigClock(default = 69300)
104 config.plugins.EasyInfo.Primetime3 = ConfigClock(default = 75600)
105 config.plugins.EasyInfo.buttTV = ConfigSelection(default="easysel", choices = [("no", _("Disabled")), ("easysel", _("Easy-Selection")), ("easypg", _("Easy-PG"))])
109 def Plugins(**kwargs):
110 return [PluginDescriptor(where = PluginDescriptor.WHERE_SESSIONSTART, fnc = EasyInfoAutostart)]
114 def EasyInfoAutostart(reason, **kwargs):
115 global EINbaseInfoBarPlugins__init__
116 if "session" in kwargs:
118 EINsession = kwargs["session"]
119 if EINbaseInfoBarPlugins__init__ is None:
120 EINbaseInfoBarPlugins__init__ = InfoBarPlugins.__init__
121 InfoBarPlugins.__init__ = InfoBarPlugins__init__
122 InfoBarPlugins.info = info
123 if config.plugins.EasyInfo.buttTV.value != "no":
124 InfoBarPlugins.tvbut = tvbut
128 def InfoBarPlugins__init__(self):
129 global EINStartOnlyOneTime
130 if not EINStartOnlyOneTime:
131 EINStartOnlyOneTime = True
132 global InfoBar_instance
133 InfoBar_instance = self
134 if config.plugins.EasyInfo.buttTV.value != "no":
135 self["EasyInfoActions"] = ActionMap(["EasyInfoActions"],
136 {"info_but": self.info, "tv_but": self.tvbut}, -1)
138 self["EasyInfoActions"] = ActionMap(["EasyInfoActionsALT"],
139 {"info_but": self.info}, -1)
141 InfoBarPlugins.__init__ = InfoBarPlugins.__init__
142 InfoBarPlugins.info = None
143 if config.plugins.EasyInfo.buttTV.value != "no":
144 InfoBarPlugins.tvbut = None
145 EINbaseInfoBarPlugins__init__(self)
150 if config.plugins.EasyInfo.EvInStart.value == "yes":
152 self.epglist = epglist
153 service = self.session.nav.getCurrentService()
154 ref = self.session.nav.getCurrentlyPlayingServiceReference()
155 info = service.info()
163 self.session.open(EasyEvent, epglist[0], ServiceReference(ref))
165 self.session.open(EasyInfo)
167 self.session.open(EasyInfo)
172 myService = self.session.nav.getCurrentService()
173 myTS = myService and myService.timeshift()
175 if myTS.isTimeshiftActive():
176 InfoBar_instance.stopTimeshift()
178 bouquets = InfoBar_instance.servicelist.getBouquetList()
183 IBservices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
185 if config.plugins.EasyInfo.buttTV.value == "easysel":
186 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, EINchangeBouquetCB))
187 elif config.plugins.EasyInfo.buttTV.value == "easypg":
188 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
190 if config.plugins.EasyInfo.buttTV.value == "easysel":
191 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, None))
192 if config.plugins.EasyInfo.buttTV.value == "easypg":
193 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
197 def getPluginByName(sstr):
199 for xs in CHOICELIST:
207 def EINPanelEntryComponent(key, text):
209 bpng = LoadPixmap(EasyInfo.EINiconspath + "key-" + text[0] + ".png")
211 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 5, 5, 50, bpng))
212 png = LoadPixmap(EasyInfo.EINiconspath + key + ".png")
214 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5, 5, 100, 50, png))
215 if config.plugins.EasyInfo.EvInStart.value == "yes" or SKINTYPE == 1:
216 res.append((eListboxPythonMultiContent.TYPE_TEXT, 115, 17, 300, 35, 0, RT_HALIGN_LEFT, getPluginByName(text[1])))
221 class EINPanelList(MenuList):
222 def __init__(self, list, selection = 0, enableWrapAround=True):
223 MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
224 self.l.setFont(0, gFont("Regular", 20))
225 self.l.setItemHeight(60)
226 self.selection = selection
227 def postWidgetCreate(self, instance):
228 MenuList.postWidgetCreate(self, instance)
229 self.moveToIndex(self.selection)
233 class ConfigEasyInfo(ConfigListScreen, Screen):
235 <screen name="ConfigEasyInfo" position="center,center" size="600,410" title="EasyInfo settings...">
236 <widget name="config" position="5,5" scrollbarMode="showOnDemand" size="590,375"/>
237 <eLabel font="Regular;20" foregroundColor="#00ff4A3C" halign="center" position="20,385" size="140,26" text="Cancel"/>
238 <eLabel font="Regular;20" foregroundColor="#0056C856" halign="center" position="165,385" size="140,26" text="Save"/>
240 def __init__(self, session):
241 Screen.__init__(self, session)
242 self.setTitle(_("EasyInfo settings..."))
243 self.session = session
244 self.oldsetting = [config.plugins.EasyInfo.EvInStart.value, config.plugins.EasyInfo.buttTV.value]
246 list.append(getConfigListEntry(_("Start first EventInfo:"), config.plugins.EasyInfo.EvInStart ))
247 list.append(getConfigListEntry(_("Replace TV-button function:"), config.plugins.EasyInfo.buttTV ))
248 list.append(getConfigListEntry(_("EventInfo yellow button:"), config.plugins.EasyInfo.bEvInYellow ))
249 list.append(getConfigListEntry(_("EventInfo blue button:"), config.plugins.EasyInfo.bEvInBlue ))
250 list.append(getConfigListEntry(_("OK function in Easy-PG:"), config.plugins.EasyInfo.epgOKFunc))
251 list.append(getConfigListEntry(_("Easy-PG picons path:"), config.plugins.EasyInfo.myPicons))
252 list.append(getConfigListEntry(_("Easy-PG Primetime 1:"), config.plugins.EasyInfo.Primetime1))
253 list.append(getConfigListEntry(_("Easy-PG Primetime 2 (main):"), config.plugins.EasyInfo.Primetime2))
254 list.append(getConfigListEntry(_("Easy-PG Primetime 3:"), config.plugins.EasyInfo.Primetime3))
255 list.append(getConfigListEntry(_("Position 1 (info button):"), config.plugins.EasyInfo.pos1))
256 list.append(getConfigListEntry(_("Position 2 (red button):"), config.plugins.EasyInfo.pos2))
257 list.append(getConfigListEntry(_("Position 3 (green button):"), config.plugins.EasyInfo.pos3))
258 list.append(getConfigListEntry(_("Position 4 (yellow button):"), config.plugins.EasyInfo.pos4))
259 list.append(getConfigListEntry(_("Position 5 (blue button):"), config.plugins.EasyInfo.pos5))
260 list.append(getConfigListEntry(_("Position 6:"), config.plugins.EasyInfo.pos6))
261 list.append(getConfigListEntry(_("Position 7:"), config.plugins.EasyInfo.pos7))
262 list.append(getConfigListEntry(_("Position 8:"), config.plugins.EasyInfo.pos8))
263 list.append(getConfigListEntry(_("Position 9:"), config.plugins.EasyInfo.pos9))
264 list.append(getConfigListEntry(_("Position 10:"), config.plugins.EasyInfo.pos10))
265 list.append(getConfigListEntry(_("Position 11:"), config.plugins.EasyInfo.pos11))
266 ConfigListScreen.__init__(self, list)
267 self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {"green": self.save, "red": self.exit, "cancel": self.exit, "yellow": self.exit}, -1)
270 for x in self["config"].list:
272 if self.oldsetting != [config.plugins.EasyInfo.EvInStart.value, config.plugins.EasyInfo.buttTV.value]:
273 self.session.open(MessageBox, text = _('You need GUI-restart to load the new settings!'), type = MessageBox.TYPE_INFO)
277 for x in self["config"].list:
283 class EasyInfo(Screen):
285 if config.plugins.EasyInfo.EvInStart.value == "yes":
287 <screen flags="wfNoBorder" position="0,0" size="450,720" title="Easy Info">
288 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/bg.png" position="0,0" size="450,576"/>
289 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/bg.png" position="0,576" size="450,145"/>
290 <widget name="list" position="60,30" size="350,660" scrollbarMode="showNever" transparent="1" zPosition="2"/>
294 <screen backgroundColor="background" flags="wfNoBorder" position="0,0" size="1280,720" title="Easy Info">
295 <widget name="list" position="55,30" size="110,660" scrollbarMode="showNever" transparent="1" zPosition="2"/>
296 <eLabel backgroundColor="#666666" position="250,359" size="1280,2"/>
297 <widget font="Regular;24" foregroundColor="#fcc000" position="600,50" render="Label" size="600,30" source="session.CurrentService" transparent="1" zPosition="1">
298 <convert type="ServiceName">Name</convert>
300 <widget font="Regular;24" position="250,50" render="Label" size="70,30" source="session.Event_Now" transparent="1" zPosition="1">
301 <convert type="EventTime">StartTime</convert>
302 <convert type="ClockToText">Default</convert>
304 <widget font="Regular;24" noWrap="1" position="250,90" render="Label" size="900,30" source="session.Event_Now" transparent="1" zPosition="1">
305 <convert type="EventName">Name</convert>
307 <widget font="Regular;22" foregroundColor="#fcc000" position="320,50" halign="right" render="Label" size="130,30" source="session.Event_Now" transparent="1" zPosition="1">
308 <convert type="EventTime">Remaining</convert>
309 <convert type="RemainingToText">InMinutes</convert>
311 <widget font="Regular;24" position="250,400" render="Label" size="70,30" source="session.Event_Next" transparent="1" zPosition="1">
312 <convert type="EventTime">StartTime</convert>
313 <convert type="ClockToText">Default</convert>
315 <widget font="Regular;24" foregroundColor="#aaaaaa" noWrap="1" position="250,370" render="Label" size="900,30" source="session.Event_Next" transparent="1" zPosition="1">
316 <convert type="EventName">Name</convert>
318 <widget font="Regular;24" foregroundColor="#aaaaaa" position="320,400" render="Label" size="130,30" source="session.Event_Next" transparent="1" zPosition="1">
319 <convert type="EventTime">Duration</convert>
320 <convert type="ClockToText">InMinutes</convert>
322 <widget backgroundColor="#555555" borderColor="#555555" borderWidth="4" position="460,57" render="Progress" size="120,14" source="session.Event_Now" zPosition="2">
323 <convert type="EventTime">Progress</convert>
325 <widget font="Regular;22" position="250,127" render="Label" size="950,225" source="session.Event_Now" transparent="1" valign="top" zPosition="5">
326 <convert type="EventName">ExtendedDescription</convert>
328 <widget font="Regular;22" foregroundColor="#aaaaaa" position="250,437" render="Label" size="950,225" source="session.Event_Next" transparent="1" valign="top" zPosition="5">
329 <convert type="EventName">ExtendedDescription</convert>
333 if config.plugins.EasyInfo.EvInStart.value == "yes":
335 <screen flags="wfNoBorder" position="-20,0" size="450,576" title="Easy Info">
336 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/bg.png" position="0,0" size="450,576"/>
337 <widget name="list" position="70,48" size="320,480" scrollbarMode="showNever" transparent="1" zPosition="2"/>
341 <screen backgroundColor="background" flags="wfNoBorder" position="0,0" size="1024,720" title="Easy Info">
342 <widget name="list" position="40,48" scrollbarMode="showNever" size="110,480" transparent="1" zPosition="2"/>
343 <eLabel backgroundColor="#666666" position="210,289" size="1000,2"/>
344 <widget font="Regular;20" foregroundColor="#fcc000" position="570,50" render="Label" size="377,30" source="session.CurrentService" transparent="1" zPosition="1">
345 <convert type="ServiceName">Name</convert>
347 <widget font="Regular;20" position="210,50" render="Label" size="70,30" source="session.Event_Now" transparent="1" zPosition="1">
348 <convert type="EventTime">StartTime</convert>
349 <convert type="ClockToText">Default</convert>
351 <widget font="Regular;20" noWrap="1" position="210,85" render="Label" size="736,30" source="session.Event_Now" transparent="1" zPosition="1">
352 <convert type="EventName">Name</convert>
354 <widget font="Regular;20" foregroundColor="#fcc000" halign="right" position="290,50" render="Label" size="130,30" source="session.Event_Now" transparent="1" zPosition="1">
355 <convert type="EventTime">Remaining</convert>
356 <convert type="RemainingToText">InMinutes</convert>
358 <widget font="Regular;20" position="210,333" render="Label" size="82,30" source="session.Event_Next" transparent="1" zPosition="1">
359 <convert type="EventTime">StartTime</convert>
360 <convert type="ClockToText">Default</convert>
362 <widget font="Regular;20" foregroundColor="#aaaaaa" noWrap="1" position="210,300" render="Label" size="900,30" source="session.Event_Next" transparent="1" zPosition="1">
363 <convert type="EventName">Name</convert>
365 <widget font="Regular;20" foregroundColor="#aaaaaa" position="295,333" render="Label" size="130,30" source="session.Event_Next" transparent="1" zPosition="1">
366 <convert type="EventTime">Duration</convert>
367 <convert type="ClockToText">InMinutes</convert>
369 <widget backgroundColor="#555555" borderColor="#555555" borderWidth="4" position="425,55" render="Progress" size="120,14" source="session.Event_Now" zPosition="2">
370 <convert type="EventTime">Progress</convert>
372 <widget font="Regular;18" position="210,115" render="Label" size="736,170" source="session.Event_Now" transparent="1" valign="top" zPosition="5">
373 <convert type="EventName">ExtendedDescription</convert>
375 <widget font="Regular;18" foregroundColor="#aaaaaa" position="210,362" render="Label" size="736,170" source="session.Event_Next" transparent="1" valign="top" zPosition="5">
376 <convert type="EventName">ExtendedDescription</convert>
381 <screen position="center,center" size="320,440" title="Easy Info">
382 <widget name="list" position="10,10" size="300,420" scrollbarMode="showOnDemand" />
384 if pathExists('/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/icons/'):
385 EINiconspath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/icons/'
387 EINiconspath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/'
388 def __init__(self, session):
389 Screen.__init__(self, session)
390 self.session = session
396 if config.plugins.EasyInfo.pos1.value != "no":
397 self.__keys.append(config.plugins.EasyInfo.pos1.value)
398 MPaskList.append(("info", config.plugins.EasyInfo.pos1.value))
399 self["key_info"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos1.value)))
401 if config.plugins.EasyInfo.pos2.value != "no" and not fertig:
402 self.__keys.append(config.plugins.EasyInfo.pos2.value)
403 MPaskList.append(("red", config.plugins.EasyInfo.pos2.value))
404 self["key_red"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos2.value)))
406 if config.plugins.EasyInfo.pos3.value != "no" and not fertig:
407 self.__keys.append(config.plugins.EasyInfo.pos3.value)
408 MPaskList.append(("green", config.plugins.EasyInfo.pos3.value))
409 self["key_green"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos3.value)))
411 if config.plugins.EasyInfo.pos4.value != "no" and not fertig:
412 self.__keys.append(config.plugins.EasyInfo.pos4.value)
413 MPaskList.append(("yellow", config.plugins.EasyInfo.pos4.value))
414 self["key_yellow"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos4.value)))
416 if config.plugins.EasyInfo.pos5.value != "no" and not fertig:
417 self.__keys.append(config.plugins.EasyInfo.pos5.value)
418 MPaskList.append(("blue", config.plugins.EasyInfo.pos5.value))
419 self["key_blue"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos5.value)))
421 if config.plugins.EasyInfo.pos6.value != "no" and not fertig:
422 self.__keys.append(config.plugins.EasyInfo.pos6.value)
423 MPaskList.append(("x", config.plugins.EasyInfo.pos6.value))
425 if config.plugins.EasyInfo.pos7.value != "no" and not fertig:
426 self.__keys.append(config.plugins.EasyInfo.pos7.value)
427 MPaskList.append(("x", config.plugins.EasyInfo.pos7.value))
429 if config.plugins.EasyInfo.pos8.value != "no" and not fertig:
430 self.__keys.append(config.plugins.EasyInfo.pos8.value)
431 MPaskList.append(("x", config.plugins.EasyInfo.pos8.value))
433 if config.plugins.EasyInfo.pos9.value != "no" and not fertig:
434 self.__keys.append(config.plugins.EasyInfo.pos9.value)
435 MPaskList.append(("x", config.plugins.EasyInfo.pos9.value))
437 if config.plugins.EasyInfo.pos10.value != "no" and not fertig:
438 self.__keys.append(config.plugins.EasyInfo.pos10.value)
439 MPaskList.append(("x", config.plugins.EasyInfo.pos10.value))
441 if config.plugins.EasyInfo.pos11.value != "no" and not fertig:
442 self.__keys.append(config.plugins.EasyInfo.pos11.value)
443 MPaskList.append(("x", config.plugins.EasyInfo.pos11.value))
447 strpos = str(self.__keys[pos])
448 self.list.append(EINPanelEntryComponent(key = strpos, text = x))
449 if self.__keys[pos] != "":
450 self.keymap[self.__keys[pos]] = MPaskList[pos]
452 self["list"] = EINPanelList(list = self.list, selection = 0)
453 self["actions"] = ActionMap(["WizardActions", "MenuActions", "ColorActions", "EPGSelectActions"],
457 "menu": self.emContextMenu,
458 "green": self.shotgreen,
460 "blue": self.shotblue,
461 "yellow": self.shotyellow,
462 "info": self.shotinfo
469 cursel = self["list"].l.getCurrentSelection()
472 antw = antw and antw[1]
473 EINcallbackFunc(antw)
475 def emContextMenu(self):
476 self.session.open(ConfigEasyInfo)
479 self["list"].moveToIndex(0)
483 self["list"].moveToIndex(1)
487 self["list"].moveToIndex(2)
490 def shotyellow(self):
491 self["list"].moveToIndex(3)
495 self["list"].moveToIndex(4)
500 def EINchangeBouquetCB(direction, epg):
502 IBbouquets = InfoBar_instance.servicelist.getBouquetList()
503 if EINposition>0 and direction<0:
504 EINposition = EINposition - 1
505 elif EINposition==0 and direction<0:
506 EINposition = len(IBbouquets) - 1
507 elif EINposition<(len(IBbouquets)-1) and direction>0:
508 EINposition = EINposition + 1
509 elif EINposition==(len(IBbouquets)-1) and direction>0:
511 IBservices = InfoBar_instance.getBouquetServices(IBbouquets[EINposition][1])
513 epg.setServices(IBservices)
517 def EINzapTo(NewService):
518 IBbouquets = InfoBar_instance.servicelist.getBouquetList()
519 NewBbouquet = IBbouquets[EINposition][1]
520 InfoBar_instance.servicelist.clearPath()
521 if InfoBar_instance.servicelist.bouquet_root != NewBbouquet:
522 InfoBar_instance.servicelist.enterPath(InfoBar_instance.servicelist.bouquet_root)
523 InfoBar_instance.servicelist.enterPath(NewBbouquet)
524 InfoBar_instance.servicelist.setCurrentSelection(NewService)
525 InfoBar_instance.servicelist.zap()
529 def EINcallbackFunc(answer):
530 if answer is None: return
531 if EINsession is None: return
532 if not InfoBar_instance: return
533 if answer == "singleepg":
534 ref=InfoBar_instance.servicelist.getCurrentSelection()
536 InfoBar_instance.servicelist.savedService = ref
537 EINsession.openWithCallback(InfoBar_instance.servicelist.SingleServiceEPGClosed, EPGSelection, ref, serviceChangeCB = InfoBar_instance.servicelist.changeServiceCB)
538 elif answer == "easypg":
539 bouquets = InfoBar_instance.servicelist.getBouquetList()
544 IBservices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
546 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
548 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, None))
549 elif answer == "easysel":
550 bouquets = InfoBar_instance.servicelist.getBouquetList()
555 IBservices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
557 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, EINchangeBouquetCB))
559 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, None))
560 elif answer == "timers":
561 EINsession.open(TimerEditList)
562 elif answer == "multiepg":
563 bouquets = InfoBar_instance.servicelist.getBouquetList()
569 InfoBar_instance.bouquetSel = EINsession.openWithCallback(InfoBar_instance.closed, BouquetSelector, bouquets, InfoBar_instance.openBouquetEPG, enableWrapAround=True)
570 InfoBar_instance.dlg_stack.append(InfoBar_instance.bouquetSel)
572 InfoBar_instance.openBouquetEPG(bouquets[0][1], True)
573 elif answer == "eventinfo":
575 InfoBar_instance.epglist = epglist
576 service = EINsession.nav.getCurrentService()
577 ref = EINsession.nav.getCurrentlyPlayingServiceReference()
578 info = service.info()
586 EINsession.open(EventViewSimple, epglist[0], ServiceReference(ref), InfoBar_instance.eventViewCallback)
587 elif answer == "merlinepg":
588 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MerlinEPG/plugin.pyo"):
589 from Plugins.Extensions.MerlinEPG.plugin import Merlin_PGII, Merlin_PGd
590 if config.plugins.MerlinEPG.Columns.value:
591 EINsession.open(Merlin_PGII, InfoBar_instance.servicelist)
593 EINsession.open(Merlin_PGd, InfoBar_instance.servicelist)
595 EINsession.open(MessageBox, text = _('MerlinEPG is not installed!'), type = MessageBox.TYPE_INFO)
596 elif answer == "autotimer":
597 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/AutoTimer/AutoTimerEditor.pyo"):
598 from Plugins.Extensions.AutoTimer.plugin import main as AutoTimerView
599 AutoTimerView(EINsession)
601 EINsession.open(MessageBox, text = _('Autotimer is not installed!'), type = MessageBox.TYPE_INFO)
602 elif answer == "epgsearch":
603 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGSearch/plugin.pyo"):
604 from Plugins.Extensions.EPGSearch.EPGSearch import EPGSearch
605 service = EINsession.nav.getCurrentService()
606 info = service.info()
607 epg_event=info.getEvent(0)
609 epg_name = epg_event and epg_event.getEventName() or ''
610 EINsession.open(EPGSearch, epg_name, False)
612 EINsession.open(MessageBox, text = _('EPGsearch is not installed!'), type = MessageBox.TYPE_INFO)
613 elif answer == "channelinfo":
614 EINsession.open(ServiceInfo, InfoBar_instance.servicelist.getCurrentSelection())
615 elif answer == "imdbinfo":
616 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/IMDb/plugin.pyo"):
617 from Plugins.Extensions.IMDb.plugin import IMDB
618 service = EINsession.nav.getCurrentService()
619 info = service.info()
620 epg_event=info.getEvent(0)
622 IeventName = epg_event.getEventName()
623 EINsession.open(IMDB, IeventName)
625 EINsession.open(MessageBox, text = _('IMDB is not installed!'), type = MessageBox.TYPE_INFO)
626 elif answer == "graphepg":
627 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG/plugin.pyo"):
628 from Plugins.Extensions.GraphMultiEPG.plugin import main as gmepgmain
629 gmepgmain(EINsession, InfoBar_instance.servicelist)
631 EINsession.open(MessageBox, text = _('GraphMultiEPG is not installed!'), type = MessageBox.TYPE_INFO)
632 elif answer == "primetime":
633 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/PrimeTimeManager/plugin.pyo"):
634 from Plugins.Extensions.PrimeTimeManager.plugin import main as ptmanmain
635 ptmanmain(EINsession)
637 EINsession.open(MessageBox, text = _('Prime Time Manager is not installed!'), type = MessageBox.TYPE_INFO)
638 elif answer == "epgrefresh":
639 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGRefresh/plugin.pyo"):
640 from Plugins.Extensions.EPGRefresh.plugin import main as epgrefmain
641 epgrefmain(EINsession)
643 EINsession.open(MessageBox, text = _('EPGRefresh is not installed!'), type = MessageBox.TYPE_INFO)
644 elif answer == "cooltv":
645 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/CoolTVGuide/plugin.pyo"):
646 from Plugins.Extensions.CoolTVGuide.plugin import main as ctvmain
647 ctvmain(EINsession, InfoBar_instance.servicelist)
649 EINsession.open(MessageBox, text = _('CoolTVGuide is not installed!'), type = MessageBox.TYPE_INFO)
650 elif answer == "sysinfo":
651 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/Sherlock/plugin.pyo"):
652 from Plugins.Extensions.Sherlock.plugin import SherlockII
653 EINsession.open(SherlockII)
655 EINsession.open(MessageBox, text = _('Sherlock is not installed!'), type = MessageBox.TYPE_INFO)
656 elif answer == "sleep":
657 from Screens.SleepTimerEdit import SleepTimerEdit
658 EINsession.open(SleepTimerEdit)
660 EINsession.open(MessageBox, text = _('This function is yet not available!'), type = MessageBox.TYPE_INFO)
664 class EasyEvent(Screen, EventViewBase):
665 def __init__(self, session, Event, Ref, callback=None, singleEPGCB=None, multiEPGCB=None):
666 Screen.__init__(self, session)
667 self.session = session
668 self.skinName = "EventView"
669 EventViewBase.__init__(self, Event, Ref, callback=InfoBar_instance.eventViewCallback)
670 self["key_yellow"].setText(_(getPluginByName(config.plugins.EasyInfo.bEvInYellow.value)))
671 self["key_blue"].setText(_(getPluginByName(config.plugins.EasyInfo.bEvInBlue.value)))
672 self["key_red"].setText(_("Similar"))
673 self["epgactions"] = ActionMap(["EventViewEPGActions", "EPGSelectActions", "EventViewActions"],
675 "openSingleServiceEPG": self.singleEPGCB,
676 "openMultiServiceEPG": self.multiEPGCB,
677 "openSimilarList": self.openSimilarList,
678 "info": self.newExit,
679 "pageUp": self.pageUp,
680 "pageDown": self.pageDown,
681 "prevEvent": self.prevEvent,
682 "nextEvent": self.nextEvent
685 def openSimilarList(self):
687 EINcallbackFunc("epgsearch")
690 def singleEPGCB(self):
692 EINcallbackFunc(config.plugins.EasyInfo.bEvInYellow.value)
695 def multiEPGCB(self):
697 EINcallbackFunc(config.plugins.EasyInfo.bEvInBlue.value)
700 def setEvent(self, event):
704 text = event.getEventName()
705 short = event.getShortDescription()
706 ext = event.getExtendedDescription()
707 if short and short != text:
708 text += '\n\n' + short
713 self.setTitle(event.getEventName())
714 self["epg_description"].setText(text)
715 self["datetime"].setText(event.getBeginTimeString())
716 self["duration"].setText(_("%d min")%(event.getDuration()/60))
717 self["key_red"].setText(_("Similar"))
718 serviceref = self.currentService
719 eventid = self.event.getEventId()
720 refstr = serviceref.ref.toString()
721 isRecordEvent = False
722 for timer in self.session.nav.RecordTimer.timer_list:
723 if timer.eit == eventid and timer.service_ref.ref.toString() == refstr:
726 if isRecordEvent and self.key_green_choice != self.REMOVE_TIMER:
727 self["key_green"].setText(_("Remove timer"))
728 self.key_green_choice = self.REMOVE_TIMER
729 elif not isRecordEvent and self.key_green_choice != self.ADD_TIMER:
730 self["key_green"].setText(_("Add timer"))
731 self.key_green_choice = self.ADD_TIMER
735 self.session.open(EasyInfo)
740 class EvNewList(EPGList):
741 def __init__(self, type=EPG_TYPE_MULTI, selChangedCB=None, timer = None):
742 EPGList.__init__(self, type, selChangedCB, timer)
743 self.l.setFont(0, gFont("Regular", 20))
744 self.l.setFont(1, gFont("Regular", 18))
745 self.l.setItemHeight(50)
746 self.l.setBuildFunc(self.buildMultiEntry)
750 def recalcEntrySize(self):
751 esize = self.l.getItemSize()
752 self.breite = esize.width() - 200
754 def buildMultiEntry(self, changecount, service, eventId, beginTime, duration, EventName, nowTime, service_name):
755 (clock_pic, rec) = self.getPixmapForEntry(service, eventId, beginTime, duration)
757 sref = str(service)[:-1].replace(':','_')
758 Spixmap = LoadPixmap(path=(config.plugins.EasyInfo.myPicons.value + sref + '.png'))
759 if Spixmap is not None:
760 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, 5, 4, 70, 42, Spixmap))
762 res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 77, 50, 1, RT_HALIGN_CENTER|RT_VALIGN_CENTER|RT_WRAP, service_name))
764 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 80, 16, 21, 21, clock_pic))
765 if beginTime is not None and len(EventName) > 60:
766 if nowTime < beginTime:
767 begin = localtime(beginTime)
768 end = localtime(beginTime+duration)
770 (eListboxPythonMultiContent.TYPE_TEXT, 100, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
771 (eListboxPythonMultiContent.TYPE_TEXT, 110, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
772 (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
775 percent = (nowTime - beginTime)*100/duration
776 restzeit = ((beginTime+duration)-nowTime)
778 (eListboxPythonMultiContent.TYPE_PROGRESS, 110, 11, 40, 8, percent),
779 (eListboxPythonMultiContent.TYPE_TEXT, 110, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
780 (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
782 elif beginTime is not None:
783 if nowTime < beginTime:
784 begin = localtime(beginTime)
785 end = localtime(beginTime+duration)
787 (eListboxPythonMultiContent.TYPE_TEXT, 100, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
788 (eListboxPythonMultiContent.TYPE_TEXT, 110, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
789 (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
792 percent = (nowTime - beginTime)*100/duration
793 restzeit = ((beginTime+duration)-nowTime)
795 (eListboxPythonMultiContent.TYPE_PROGRESS, 110, 11, 40, 8, percent),
796 (eListboxPythonMultiContent.TYPE_TEXT, 110, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
797 (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
803 class EasyPG(EPGSelection, Screen):
806 <screen name="EasyPG" backgroundColor="#101220" flags="wfNoBorder" position="0,0" size="1280,720" title="Easy PG">
807 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="60,35" size="660,650" zPosition="-1"/>
808 <widget font="Regular;20" position="785,30" render="Label" size="202,25" source="global.CurrentTime" transparent="1" zPosition="1">
809 <convert type="ClockToText">Format:%a %d. %b %H:%M</convert>
811 <widget backgroundColor="#ff000000" position="755,125" render="Pig" size="497,280" source="session.VideoPicture" zPosition="1"/>
812 <widget foregroundColor="#fcc000" font="Regular;20" name="date" position="755,415" size="100,25" transparent="1"/>
813 <widget name="list" position="60,35" scrollbarMode="showNever" size="660,650" transparent="1"/>
814 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-red.png" position="785,65" size="5,20"/>
815 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-green.png" position="785,90" size="5,20"/>
816 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-yellow.png" position="1005,65" size="5,20"/>
817 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-blue.png" position="1005,90" size="5,20"/>
818 <eLabel font="Regular;18" position="800,63" size="150,25" text="Similar" transparent="1"/>
819 <eLabel font="Regular;18" position="800,90" size="150,25" text="Timer" transparent="1"/>
820 <eLabel font="Regular;18" position="1015,63" size="150,25" text="Back" transparent="1"/>
821 <eLabel font="Regular;18" position="1015,90" size="150,25" text="Next" transparent="1"/>
822 <widget font="Regular;20" halign="right" position="870,415" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
823 <convert type="EventTime">StartTime</convert>
824 <convert type="ClockToText">Default</convert>
826 <eLabel font="Regular;18" position="945,415" size="10,25" text="-" transparent="1"/>
827 <widget font="Regular;20" position="955,415" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
828 <convert type="EventTime">EndTime</convert>
829 <convert type="ClockToText">Default</convert>
831 <widget font="Regular;20" position="1050,415" render="Label" size="171,25" source="Event" transparent="1" zPosition="1">
832 <convert type="EventTime">Duration</convert>
833 <convert type="ClockToText">InMinutes</convert>
835 <widget font="Regular;20" position="755,445" render="Label" size="480,25" source="Event" transparent="1" zPosition="2" noWrap="1">
836 <convert type="EventName">ShortDescription</convert>
838 <widget font="Regular;18" position="755,475" render="Label" size="480,210" source="Event" transparent="1" zPosition="3">
839 <convert type="EventName">ExtendedDescription</convert>
844 <screen name="EasyPG" backgroundColor="#0e1018" flags="wfNoBorder" position="0,0" size="1024,576" title="Easy PG">
845 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="50,50" size="520,450" zPosition="-1"/>
846 <eLabel backgroundColor="#666666" position="0,518" size="1024,1"/>
847 <widget font="Regular;20" position="50,525" render="Label" size="186,25" source="global.CurrentTime" transparent="1" zPosition="1">
848 <convert type="ClockToText">Format:%a %d. %b %H:%M</convert>
850 <widget backgroundColor="#ff000000" position="590,30" render="Pig" size="384,216" source="session.VideoPicture" zPosition="-1"/>
851 <widget foregroundColor="#fcc000" font="Regular;20" name="date" position="590,255" size="100,25" transparent="1"/>
852 <widget name="list" position="50,48" scrollbarMode="showNever" size="520,450" transparent="1"/>
853 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-red.png" position="275,525" size="5,20"/>
854 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-green.png" position="450,525" size="5,20"/>
855 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-yellow.png" position="625,525" size="5,20"/>
856 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-blue.png" position="800,525" size="5,20"/>
857 <eLabel font="Regular;18" position="290,526" size="150,25" text="Similar" transparent="1"/>
858 <eLabel font="Regular;18" position="465,526" size="150,25" text="Timer" transparent="1"/>
859 <eLabel font="Regular;18" position="640,526" size="150,25" text="Back" transparent="1"/>
860 <eLabel font="Regular;18" position="815,526" size="150,25" text="Next" transparent="1"/>
861 <widget font="Regular;20" halign="right" position="695,255" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
862 <convert type="EventTime">StartTime</convert>
863 <convert type="ClockToText">Default</convert>
865 <eLabel font="Regular;18" position="770,255" size="10,25" text="-" transparent="1"/>
866 <widget font="Regular;20" position="780,255" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
867 <convert type="EventTime">EndTime</convert>
868 <convert type="ClockToText">Default</convert>
870 <widget font="Regular;20" position="855,255" render="Label" size="130,25" source="Event" transparent="1" zPosition="1">
871 <convert type="EventTime">Duration</convert>
872 <convert type="ClockToText">InMinutes</convert>
874 <widget font="Regular;20" noWrap="1" position="590,285" render="Label" size="390,25" source="Event" transparent="1" zPosition="2">
875 <convert type="EventName">ShortDescription</convert>
877 <widget font="Regular;18" position="590,315" render="Label" size="390,190" source="Event" transparent="1" zPosition="3">
878 <convert type="EventName">ExtendedDescription</convert>
884 <screen name="EasyPG" backgroundColor="background" flags="wfNoBorder" position="0,0" size="720,576" title="Easy PG">
885 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="50,48" size="620,450" zPosition="-1"/>
886 <eLabel backgroundColor="#666666" position="0,522" size="756,1"/>
887 <widget foregroundColor="#fcc000" font="Regular;20" name="date" position="50,525" size="100,25" transparent="1"/>
888 <widget name="list" position="50,48" scrollbarMode="showOnDemand" size="620,450" transparent="1"/>
889 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-red.png" position="175,525" size="5,20"/>
890 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-yellow.png" position="350,525" size="5,20"/>
891 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-blue.png" position="525,525" size="5,20"/>
892 <eLabel font="Regular;18" position="190,526" size="150,25" text="Similar" transparent="1"/>
893 <eLabel font="Regular;18" position="365,526" size="150,25" text="Back" transparent="1"/>
894 <eLabel font="Regular;18" position="540,526" size="150,25" text="Next" transparent="1"/>
897 def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None, serviceChangeCB=None):
898 Screen.__init__(self, session)
899 EPGSelection.__init__(self, session, service, zapFunc, eventid, bouquetChangeCB, serviceChangeCB)
903 self.session = session
904 EPGSelection.skinName = "EasyPG"
905 self.PThour = config.plugins.EasyInfo.Primetime2.value[0]
906 self.PTmin = config.plugins.EasyInfo.Primetime2.value[1]
907 self["list"] = EvNewList(type = EPG_TYPE_MULTI, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
908 self.skinName = "EasyPG"
909 self.RefrTimer = eTimer()
910 self.RefrTimer.callback.append(self.RefreshEPG)
911 self["actions"] = ActionMap(["EPGSelectActions", "OkCancelActions", "NumberActions", "InfobarActions"],
913 "cancel": self.closeScreen,
914 "ok": self.newOKFunc,
915 "timerAdd": self.timerAdd,
916 "yellow": self.yellowButtonPressed,
917 "blue": self.blueButtonPressed,
918 "info": self.infoKeyPressed,
919 "red": self.newRedFunc,
920 "input_date_time": self.einContextMenu,
921 "nextBouquet": self.nextBouquet,
922 "prevBouquet": self.prevBouquet,
923 "nextService": self.PTfor,
924 "prevService": self.PTback,
925 "showMovies": self.enterDateTime,
926 "showTv": self.zapTo,
927 "showRadio": self.zapForRefr,
934 def closeScreen(self):
938 self["list"].fillMultiEPG(self.services, -1)
941 def GoPrimetime(self):
943 pt = (heute[0],heute[1],heute[2],self.PThour,self.PTmin,0,heute[6],heute[7],0)
944 self.ask_time = int(mktime(pt))
946 if self.ask_time > int(mktime(heute)):
947 self["list"].fillMultiEPG(self.services, self.ask_time)
950 if config.plugins.EasyInfo.epgOKFunc.value == "exitzap":
953 elif config.plugins.EasyInfo.epgOKFunc.value == "zap":
956 self.infoKeyPressed()
958 def newRedFunc(self):
959 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGSearch/plugin.pyo"):
960 from Plugins.Extensions.EPGSearch.EPGSearch import EPGSearch
961 epg_event = self["list"].getCurrent()[0]
963 epg_name = epg_event and epg_event.getEventName() or ''
964 self.session.open(EPGSearch, epg_name, False)
966 self.session.open(MessageBox, text = _('EPGsearch is not installed!'), type = MessageBox.TYPE_INFO)
969 if not self["list"].getCurrent()[0]:
973 pt = (heute[0],heute[1],heute[2],self.PThour,self.PTmin,0,heute[6],heute[7],0)
974 self.ask_time = int(mktime(pt))
976 if self.ask_time < int(mktime(heute)):
977 self.ask_time = self.ask_time + 86400
979 self.ask_time = self.ask_time + 86400
980 self["list"].fillMultiEPG(self.services, self.ask_time)
985 pt = (heute[0],heute[1],heute[2],self.PThour,self.PTmin,0,heute[6],heute[7],0)
986 self.ask_time = int(mktime(pt))
989 self.ask_time = self.ask_time - 86400
990 if self.ask_time > int(mktime(heute)):
991 self["list"].fillMultiEPG(self.services, self.ask_time)
993 self["list"].fillMultiEPG(self.services, -1)
997 self.PThour = config.plugins.EasyInfo.Primetime1.value[0]
998 self.PTmin = config.plugins.EasyInfo.Primetime1.value[1]
1002 self.PThour = config.plugins.EasyInfo.Primetime2.value[0]
1003 self.PTmin = config.plugins.EasyInfo.Primetime2.value[1]
1007 self.PThour = config.plugins.EasyInfo.Primetime3.value[0]
1008 self.PTmin = config.plugins.EasyInfo.Primetime3.value[1]
1011 def einContextMenu(self):
1012 self.session.open(ConfigEasyInfo)
1014 def zapForRefr(self):
1016 self.RefrTimer.start(4000, True)
1018 def RefreshEPG(self):
1019 self.RefrTimer.stop()
1024 class ESListNext(EPGList):
1025 def __init__(self, type=EPG_TYPE_MULTI, selChangedCB=None, timer = None):
1026 EPGList.__init__(self, type, selChangedCB, timer)
1027 self.l.setFont(0, gFont("Regular", 20))
1028 self.l.setFont(1, gFont("Regular", 18))
1029 self.l.setItemHeight(50)
1030 self.l.setBuildFunc(self.buildMultiEntry)
1034 def recalcEntrySize(self):
1035 esize = self.l.getItemSize()
1036 self.breite = esize.width() - 100
1038 def buildMultiEntry(self, changecount, service, eventId, beginTime, duration, EventName, nowTime, service_name):
1039 (clock_pic, rec) = self.getPixmapForEntry(service, eventId, beginTime, duration)
1042 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 58, 16, 21, 21, clock_pic))
1043 if beginTime is not None and len(EventName) > 60:
1044 if nowTime < beginTime:
1045 begin = localtime(beginTime)
1046 end = localtime(beginTime+duration)
1048 (eListboxPythonMultiContent.TYPE_TEXT, 0, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
1049 (eListboxPythonMultiContent.TYPE_TEXT, 10, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
1050 (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
1053 percent = (nowTime - beginTime)*100/duration
1054 restzeit = ((beginTime+duration)-nowTime)
1056 (eListboxPythonMultiContent.TYPE_PROGRESS, 10, 11, 40, 8, percent),
1057 (eListboxPythonMultiContent.TYPE_TEXT, 10, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
1058 (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
1060 elif beginTime is not None:
1061 if nowTime < beginTime:
1062 begin = localtime(beginTime)
1063 end = localtime(beginTime+duration)
1065 (eListboxPythonMultiContent.TYPE_TEXT, 0, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
1066 (eListboxPythonMultiContent.TYPE_TEXT, 10, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
1067 (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
1070 percent = (nowTime - beginTime)*100/duration
1071 restzeit = ((beginTime+duration)-nowTime)
1073 (eListboxPythonMultiContent.TYPE_PROGRESS, 10, 11, 40, 8, percent),
1074 (eListboxPythonMultiContent.TYPE_TEXT, 10, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
1075 (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
1081 class EasySelection(EPGSelection, Screen):
1084 <screen name="EasySelection" backgroundColor="background" flags="wfNoBorder" position="0,0" size="1280,720" title="Easy Selection">
1085 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="60,35" size="660,650" zPosition="-1"/>
1086 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="720,35" size="500,650" zPosition="-1"/>
1087 <widget name="list" position="60,35" scrollbarMode="showNever" size="660,650" transparent="1"/>
1088 <widget name="listN" position="720,35" scrollbarMode="showNever" size="500,650" transparent="1"/>
1092 <screen name="EasySelection" backgroundColor="background" flags="wfNoBorder" position="0,0" size="1024,576" title="Easy Selection">
1093 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="40,38" size="660,500" zPosition="-1"/>
1094 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="700,38" size="284,500" zPosition="-1"/>
1095 <widget name="list" position="40,38" scrollbarMode="showNever" size="520,500" transparent="1"/>
1096 <widget name="listN" position="560,38" scrollbarMode="showNever" size="444,500" transparent="1"/>
1101 <screen name="EasySelection" backgroundColor="background" flags="wfNoBorder" position="0,0" size="720,576" title="Easy Selection">
1102 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="50,38" size="620,500" zPosition="-1"/>
1103 <widget name="list" position="50,38" scrollbarMode="showOnDemand" size="620,500" transparent="1"/>
1106 def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None, serviceChangeCB=None):
1107 Screen.__init__(self, session)
1108 EPGSelection.__init__(self, session, service, zapFunc, eventid, bouquetChangeCB, serviceChangeCB)
1111 self.session = session
1112 EPGSelection.skinName = "EasySelection"
1113 self["list"] = EvNewList(type = EPG_TYPE_MULTI, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
1114 self["listN"] = ESListNext(type = EPG_TYPE_MULTI, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
1115 self.skinName = "EasySelection"
1116 self["actions"] = ActionMap(["EPGSelectActions", "OkCancelActions", "DirectionActions"],
1118 "cancel": self.closeScreen,
1119 "ok": self.newOKFunc,
1120 "info": self.infoKeyPressed,
1121 "nextBouquet": self.nextBouquet,
1122 "prevBouquet": self.prevBouquet,
1123 "right": self.right,
1124 "rightRepeated": self.right,
1126 "leftRepeated": self.left,
1128 "upRepeated": self.up,
1130 "downRepeated": self.down,
1131 "nextService": self.PrimeTimeLook,
1132 "prevService": self.NowNextLook
1134 self.onLayoutFinish.append(self.byLayoutEnd)
1136 def byLayoutEnd(self):
1137 self["listN"].recalcEntrySize()
1138 self["listN"].fillMultiEPG(self.services, -1)
1139 self["listN"].moveToService(self.session.nav.getCurrentlyPlayingServiceReference())
1140 self["listN"].updateMultiEPG(1)
1142 def closeScreen(self):
1145 def newOKFunc(self):
1150 self["list"].instance.moveSelection(self["list"].instance.pageUp)
1151 self["listN"].instance.moveSelection(self["list"].instance.pageUp)
1154 self["list"].instance.moveSelection(self["list"].instance.pageDown)
1155 self["listN"].instance.moveSelection(self["list"].instance.pageDown)
1158 self["list"].moveUp()
1159 self["listN"].moveUp()
1162 self["list"].moveDown()
1163 self["listN"].moveDown()
1165 def nextBouquet(self):
1166 if self.bouquetChangeCB:
1167 self.bouquetChangeCB(1, self)
1170 def prevBouquet(self):
1171 if self.bouquetChangeCB:
1172 self.bouquetChangeCB(-1, self)
1175 def PrimeTimeLook(self):
1177 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)
1178 ask_time = int(mktime(pt))
1179 if ask_time > int(mktime(heute)):
1180 self["list"].fillMultiEPG(self.services, ask_time)
1181 self["listN"].fillMultiEPG(self.services, ask_time)
1182 self["listN"].updateMultiEPG(1)
1184 def NowNextLook(self):
1185 self["list"].fillMultiEPG(self.services, -1)
1186 self["listN"].fillMultiEPG(self.services, -1)
1187 self["listN"].updateMultiEPG(1)