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, eServiceReference, 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 if InfoBar_instance.servicelist.mode == 1:
179 InfoBar_instance.showTv()
181 bouquets = InfoBar_instance.servicelist.getBouquetList()
186 IBservices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
188 if config.plugins.EasyInfo.buttTV.value == "easysel":
189 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, EINchangeBouquetCB))
190 elif config.plugins.EasyInfo.buttTV.value == "easypg":
191 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
193 if config.plugins.EasyInfo.buttTV.value == "easysel":
194 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, None))
195 if config.plugins.EasyInfo.buttTV.value == "easypg":
196 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
200 def getPluginByName(sstr):
202 for xs in CHOICELIST:
210 def EINPanelEntryComponent(key, text):
212 bpng = LoadPixmap(EasyInfo.EINiconspath + "key-" + text[0] + ".png")
214 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 0, 5, 5, 50, bpng))
215 png = LoadPixmap(EasyInfo.EINiconspath + key + ".png")
217 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 5, 5, 100, 50, png))
218 if config.plugins.EasyInfo.EvInStart.value == "yes" or SKINTYPE == 1:
219 res.append((eListboxPythonMultiContent.TYPE_TEXT, 115, 17, 300, 35, 0, RT_HALIGN_LEFT, getPluginByName(text[1])))
224 class EINPanelList(MenuList):
225 def __init__(self, list, selection = 0, enableWrapAround=True):
226 MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
227 self.l.setFont(0, gFont("Regular", 20))
228 self.l.setItemHeight(60)
229 self.selection = selection
230 def postWidgetCreate(self, instance):
231 MenuList.postWidgetCreate(self, instance)
232 self.moveToIndex(self.selection)
236 class ConfigEasyInfo(ConfigListScreen, Screen):
238 <screen name="ConfigEasyInfo" position="center,center" size="600,410" title="EasyInfo settings...">
239 <widget name="config" position="5,5" scrollbarMode="showOnDemand" size="590,375"/>
240 <eLabel font="Regular;20" foregroundColor="#00ff4A3C" halign="center" position="20,385" size="140,26" text="Cancel"/>
241 <eLabel font="Regular;20" foregroundColor="#0056C856" halign="center" position="165,385" size="140,26" text="Save"/>
243 def __init__(self, session):
244 Screen.__init__(self, session)
245 self.setTitle(_("EasyInfo settings..."))
246 self.session = session
247 self.oldsetting = [config.plugins.EasyInfo.EvInStart.value, config.plugins.EasyInfo.buttTV.value]
249 list.append(getConfigListEntry(_("Start first EventInfo:"), config.plugins.EasyInfo.EvInStart ))
250 list.append(getConfigListEntry(_("Replace TV-button function:"), config.plugins.EasyInfo.buttTV ))
251 list.append(getConfigListEntry(_("EventInfo yellow button:"), config.plugins.EasyInfo.bEvInYellow ))
252 list.append(getConfigListEntry(_("EventInfo blue button:"), config.plugins.EasyInfo.bEvInBlue ))
253 list.append(getConfigListEntry(_("OK function in Easy-PG:"), config.plugins.EasyInfo.epgOKFunc))
254 list.append(getConfigListEntry(_("Easy-PG picons path:"), config.plugins.EasyInfo.myPicons))
255 list.append(getConfigListEntry(_("Easy-PG Primetime 1:"), config.plugins.EasyInfo.Primetime1))
256 list.append(getConfigListEntry(_("Easy-PG Primetime 2 (main):"), config.plugins.EasyInfo.Primetime2))
257 list.append(getConfigListEntry(_("Easy-PG Primetime 3:"), config.plugins.EasyInfo.Primetime3))
258 list.append(getConfigListEntry(_("Position 1 (info button):"), config.plugins.EasyInfo.pos1))
259 list.append(getConfigListEntry(_("Position 2 (red button):"), config.plugins.EasyInfo.pos2))
260 list.append(getConfigListEntry(_("Position 3 (green button):"), config.plugins.EasyInfo.pos3))
261 list.append(getConfigListEntry(_("Position 4 (yellow button):"), config.plugins.EasyInfo.pos4))
262 list.append(getConfigListEntry(_("Position 5 (blue button):"), config.plugins.EasyInfo.pos5))
263 list.append(getConfigListEntry(_("Position 6:"), config.plugins.EasyInfo.pos6))
264 list.append(getConfigListEntry(_("Position 7:"), config.plugins.EasyInfo.pos7))
265 list.append(getConfigListEntry(_("Position 8:"), config.plugins.EasyInfo.pos8))
266 list.append(getConfigListEntry(_("Position 9:"), config.plugins.EasyInfo.pos9))
267 list.append(getConfigListEntry(_("Position 10:"), config.plugins.EasyInfo.pos10))
268 list.append(getConfigListEntry(_("Position 11:"), config.plugins.EasyInfo.pos11))
269 ConfigListScreen.__init__(self, list)
270 self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {"green": self.save, "red": self.exit, "cancel": self.exit, "yellow": self.exit}, -1)
273 for x in self["config"].list:
275 if self.oldsetting != [config.plugins.EasyInfo.EvInStart.value, config.plugins.EasyInfo.buttTV.value]:
276 self.session.open(MessageBox, text = _('You need GUI-restart to load the new settings!'), type = MessageBox.TYPE_INFO)
280 for x in self["config"].list:
286 class EasyInfo(Screen):
288 if config.plugins.EasyInfo.EvInStart.value == "yes":
290 <screen flags="wfNoBorder" position="0,0" size="450,720" title="Easy Info">
291 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/bg.png" position="0,0" size="450,576"/>
292 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/bg.png" position="0,576" size="450,145"/>
293 <widget name="list" position="60,30" size="350,660" scrollbarMode="showNever" transparent="1" zPosition="2"/>
297 <screen backgroundColor="background" flags="wfNoBorder" position="0,0" size="1280,720" title="Easy Info">
298 <widget name="list" position="55,30" size="110,660" scrollbarMode="showNever" transparent="1" zPosition="2"/>
299 <eLabel backgroundColor="#666666" position="250,359" size="1280,2"/>
300 <widget font="Regular;24" foregroundColor="#fcc000" position="630,50" render="Label" size="600,30" source="session.CurrentService" transparent="1" zPosition="1">
301 <convert type="ServiceName">Name</convert>
303 <widget font="Regular;24" position="250,50" render="Label" size="100,30" source="session.Event_Now" transparent="1" zPosition="1">
304 <convert type="EventTime">StartTime</convert>
305 <convert type="ClockToText">Default</convert>
307 <widget font="Regular;24" noWrap="1" position="250,90" render="Label" size="900,30" source="session.Event_Now" transparent="1" zPosition="1">
308 <convert type="EventName">Name</convert>
310 <widget font="Regular;22" foregroundColor="#fcc000" position="350,50" halign="right" render="Label" size="130,30" source="session.Event_Now" transparent="1" zPosition="1">
311 <convert type="EventTime">Remaining</convert>
312 <convert type="RemainingToText">InMinutes</convert>
314 <widget font="Regular;24" position="250,400" render="Label" size="100,30" source="session.Event_Next" transparent="1" zPosition="1">
315 <convert type="EventTime">StartTime</convert>
316 <convert type="ClockToText">Default</convert>
318 <widget font="Regular;24" foregroundColor="#aaaaaa" noWrap="1" position="250,370" render="Label" size="900,30" source="session.Event_Next" transparent="1" zPosition="1">
319 <convert type="EventName">Name</convert>
321 <widget font="Regular;24" foregroundColor="#aaaaaa" position="350,400" render="Label" size="130,30" source="session.Event_Next" transparent="1" zPosition="1">
322 <convert type="EventTime">Duration</convert>
323 <convert type="ClockToText">InMinutes</convert>
325 <widget backgroundColor="#555555" borderColor="#555555" borderWidth="4" position="490,57" render="Progress" size="120,14" source="session.Event_Now" zPosition="2">
326 <convert type="EventTime">Progress</convert>
328 <widget font="Regular;22" position="250,127" render="Label" size="950,225" source="session.Event_Now" transparent="1" valign="top" zPosition="5">
329 <convert type="EventName">ExtendedDescription</convert>
331 <widget font="Regular;22" foregroundColor="#aaaaaa" position="250,437" render="Label" size="950,225" source="session.Event_Next" transparent="1" valign="top" zPosition="5">
332 <convert type="EventName">ExtendedDescription</convert>
336 if config.plugins.EasyInfo.EvInStart.value == "yes":
338 <screen flags="wfNoBorder" position="-20,0" size="450,576" title="Easy Info">
339 <ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/bg.png" position="0,0" size="450,576"/>
340 <widget name="list" position="70,48" size="320,480" scrollbarMode="showNever" transparent="1" zPosition="2"/>
344 <screen backgroundColor="background" flags="wfNoBorder" position="0,0" size="1024,720" title="Easy Info">
345 <widget name="list" position="40,48" scrollbarMode="showNever" size="110,480" transparent="1" zPosition="2"/>
346 <eLabel backgroundColor="#666666" position="210,289" size="1000,2"/>
347 <widget font="Regular;20" foregroundColor="#fcc000" position="570,50" render="Label" size="377,30" source="session.CurrentService" transparent="1" zPosition="1">
348 <convert type="ServiceName">Name</convert>
350 <widget font="Regular;20" position="210,50" render="Label" size="70,30" source="session.Event_Now" transparent="1" zPosition="1">
351 <convert type="EventTime">StartTime</convert>
352 <convert type="ClockToText">Default</convert>
354 <widget font="Regular;20" noWrap="1" position="210,85" render="Label" size="736,30" source="session.Event_Now" transparent="1" zPosition="1">
355 <convert type="EventName">Name</convert>
357 <widget font="Regular;20" foregroundColor="#fcc000" halign="right" position="290,50" render="Label" size="130,30" source="session.Event_Now" transparent="1" zPosition="1">
358 <convert type="EventTime">Remaining</convert>
359 <convert type="RemainingToText">InMinutes</convert>
361 <widget font="Regular;20" position="210,333" render="Label" size="82,30" source="session.Event_Next" transparent="1" zPosition="1">
362 <convert type="EventTime">StartTime</convert>
363 <convert type="ClockToText">Default</convert>
365 <widget font="Regular;20" foregroundColor="#aaaaaa" noWrap="1" position="210,300" render="Label" size="900,30" source="session.Event_Next" transparent="1" zPosition="1">
366 <convert type="EventName">Name</convert>
368 <widget font="Regular;20" foregroundColor="#aaaaaa" position="295,333" render="Label" size="130,30" source="session.Event_Next" transparent="1" zPosition="1">
369 <convert type="EventTime">Duration</convert>
370 <convert type="ClockToText">InMinutes</convert>
372 <widget backgroundColor="#555555" borderColor="#555555" borderWidth="4" position="425,55" render="Progress" size="120,14" source="session.Event_Now" zPosition="2">
373 <convert type="EventTime">Progress</convert>
375 <widget font="Regular;18" position="210,115" render="Label" size="736,170" source="session.Event_Now" transparent="1" valign="top" zPosition="5">
376 <convert type="EventName">ExtendedDescription</convert>
378 <widget font="Regular;18" foregroundColor="#aaaaaa" position="210,362" render="Label" size="736,170" source="session.Event_Next" transparent="1" valign="top" zPosition="5">
379 <convert type="EventName">ExtendedDescription</convert>
384 <screen position="center,center" size="320,440" title="Easy Info">
385 <widget name="list" position="10,10" size="300,420" scrollbarMode="showOnDemand" />
387 if pathExists('/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/icons/'):
388 EINiconspath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/icons/'
390 EINiconspath = '/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/'
391 def __init__(self, session):
392 Screen.__init__(self, session)
393 self.session = session
399 if config.plugins.EasyInfo.pos1.value != "no":
400 self.__keys.append(config.plugins.EasyInfo.pos1.value)
401 MPaskList.append(("info", config.plugins.EasyInfo.pos1.value))
402 self["key_info"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos1.value)))
404 if config.plugins.EasyInfo.pos2.value != "no" and not fertig:
405 self.__keys.append(config.plugins.EasyInfo.pos2.value)
406 MPaskList.append(("red", config.plugins.EasyInfo.pos2.value))
407 self["key_red"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos2.value)))
409 if config.plugins.EasyInfo.pos3.value != "no" and not fertig:
410 self.__keys.append(config.plugins.EasyInfo.pos3.value)
411 MPaskList.append(("green", config.plugins.EasyInfo.pos3.value))
412 self["key_green"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos3.value)))
414 if config.plugins.EasyInfo.pos4.value != "no" and not fertig:
415 self.__keys.append(config.plugins.EasyInfo.pos4.value)
416 MPaskList.append(("yellow", config.plugins.EasyInfo.pos4.value))
417 self["key_yellow"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos4.value)))
419 if config.plugins.EasyInfo.pos5.value != "no" and not fertig:
420 self.__keys.append(config.plugins.EasyInfo.pos5.value)
421 MPaskList.append(("blue", config.plugins.EasyInfo.pos5.value))
422 self["key_blue"] = StaticText(_(getPluginByName(config.plugins.EasyInfo.pos5.value)))
424 if config.plugins.EasyInfo.pos6.value != "no" and not fertig:
425 self.__keys.append(config.plugins.EasyInfo.pos6.value)
426 MPaskList.append(("x", config.plugins.EasyInfo.pos6.value))
428 if config.plugins.EasyInfo.pos7.value != "no" and not fertig:
429 self.__keys.append(config.plugins.EasyInfo.pos7.value)
430 MPaskList.append(("x", config.plugins.EasyInfo.pos7.value))
432 if config.plugins.EasyInfo.pos8.value != "no" and not fertig:
433 self.__keys.append(config.plugins.EasyInfo.pos8.value)
434 MPaskList.append(("x", config.plugins.EasyInfo.pos8.value))
436 if config.plugins.EasyInfo.pos9.value != "no" and not fertig:
437 self.__keys.append(config.plugins.EasyInfo.pos9.value)
438 MPaskList.append(("x", config.plugins.EasyInfo.pos9.value))
440 if config.plugins.EasyInfo.pos10.value != "no" and not fertig:
441 self.__keys.append(config.plugins.EasyInfo.pos10.value)
442 MPaskList.append(("x", config.plugins.EasyInfo.pos10.value))
444 if config.plugins.EasyInfo.pos11.value != "no" and not fertig:
445 self.__keys.append(config.plugins.EasyInfo.pos11.value)
446 MPaskList.append(("x", config.plugins.EasyInfo.pos11.value))
450 strpos = str(self.__keys[pos])
451 self.list.append(EINPanelEntryComponent(key = strpos, text = x))
452 if self.__keys[pos] != "":
453 self.keymap[self.__keys[pos]] = MPaskList[pos]
455 self["list"] = EINPanelList(list = self.list, selection = 0)
456 self["actions"] = ActionMap(["WizardActions", "MenuActions", "ColorActions", "EPGSelectActions"],
460 "menu": self.emContextMenu,
461 "green": self.shotgreen,
463 "blue": self.shotblue,
464 "yellow": self.shotyellow,
465 "info": self.shotinfo
472 cursel = self["list"].l.getCurrentSelection()
475 antw = antw and antw[1]
476 EINcallbackFunc(antw)
478 def emContextMenu(self):
479 self.session.open(ConfigEasyInfo)
482 self["list"].moveToIndex(0)
486 self["list"].moveToIndex(1)
490 self["list"].moveToIndex(2)
493 def shotyellow(self):
494 self["list"].moveToIndex(3)
498 self["list"].moveToIndex(4)
503 def EINchangeBouquetCB(direction, epg):
505 IBbouquets = InfoBar_instance.servicelist.getBouquetList()
506 if EINposition>0 and direction<0:
507 EINposition = EINposition - 1
508 elif EINposition==0 and direction<0:
509 EINposition = len(IBbouquets) - 1
510 elif EINposition<(len(IBbouquets)-1) and direction>0:
511 EINposition = EINposition + 1
512 elif EINposition==(len(IBbouquets)-1) and direction>0:
514 IBservices = InfoBar_instance.getBouquetServices(IBbouquets[EINposition][1])
516 epg.setServices(IBservices)
520 def EINzapTo(NewService):
521 IBbouquets = InfoBar_instance.servicelist.getBouquetList()
522 NewBbouquet = IBbouquets[EINposition][1]
523 InfoBar_instance.servicelist.clearPath()
524 if InfoBar_instance.servicelist.bouquet_root != NewBbouquet:
525 InfoBar_instance.servicelist.enterPath(InfoBar_instance.servicelist.bouquet_root)
526 InfoBar_instance.servicelist.enterPath(NewBbouquet)
527 InfoBar_instance.servicelist.setCurrentSelection(NewService)
528 InfoBar_instance.servicelist.zap()
532 def EINcallbackFunc(answer):
533 if answer is None: return
534 if EINsession is None: return
535 if not InfoBar_instance: return
536 if answer == "singleepg":
537 ref=InfoBar_instance.servicelist.getCurrentSelection()
539 InfoBar_instance.servicelist.savedService = ref
540 EINsession.openWithCallback(InfoBar_instance.servicelist.SingleServiceEPGClosed, EPGSelection, ref, serviceChangeCB = InfoBar_instance.servicelist.changeServiceCB)
541 elif answer == "easypg":
542 bouquets = InfoBar_instance.servicelist.getBouquetList()
547 IBservices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
549 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, EINchangeBouquetCB))
551 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasyPG, IBservices, EINzapTo, None, None))
552 elif answer == "easysel":
553 bouquets = InfoBar_instance.servicelist.getBouquetList()
558 IBservices = InfoBar_instance.getBouquetServices(InfoBar_instance.servicelist.getRoot())
560 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, EINchangeBouquetCB))
562 InfoBar_instance.dlg_stack.append(InfoBar_instance.session.open(EasySelection, IBservices, EINzapTo, None, None))
563 elif answer == "timers":
564 EINsession.open(TimerEditList)
565 elif answer == "multiepg":
566 bouquets = InfoBar_instance.servicelist.getBouquetList()
572 InfoBar_instance.bouquetSel = EINsession.openWithCallback(InfoBar_instance.closed, BouquetSelector, bouquets, InfoBar_instance.openBouquetEPG, enableWrapAround=True)
573 InfoBar_instance.dlg_stack.append(InfoBar_instance.bouquetSel)
575 InfoBar_instance.openBouquetEPG(bouquets[0][1], True)
576 elif answer == "eventinfo":
578 InfoBar_instance.epglist = epglist
579 service = EINsession.nav.getCurrentService()
580 ref = EINsession.nav.getCurrentlyPlayingServiceReference()
581 info = service.info()
589 EINsession.open(EventViewSimple, epglist[0], ServiceReference(ref), InfoBar_instance.eventViewCallback)
590 elif answer == "merlinepg":
591 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/MerlinEPG/plugin.pyo"):
592 from Plugins.Extensions.MerlinEPG.plugin import Merlin_PGII, Merlin_PGd
593 if config.plugins.MerlinEPG.Columns.value:
594 EINsession.open(Merlin_PGII, InfoBar_instance.servicelist)
596 EINsession.open(Merlin_PGd, InfoBar_instance.servicelist)
598 EINsession.open(MessageBox, text = _('MerlinEPG is not installed!'), type = MessageBox.TYPE_INFO)
599 elif answer == "autotimer":
600 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/AutoTimer/AutoTimerEditor.pyo"):
601 from Plugins.Extensions.AutoTimer.plugin import main as AutoTimerView
602 AutoTimerView(EINsession)
604 EINsession.open(MessageBox, text = _('Autotimer is not installed!'), type = MessageBox.TYPE_INFO)
605 elif answer == "epgsearch":
606 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGSearch/plugin.pyo"):
607 from Plugins.Extensions.EPGSearch.EPGSearch import EPGSearch
608 service = EINsession.nav.getCurrentService()
609 info = service.info()
610 epg_event=info.getEvent(0)
612 epg_name = epg_event and epg_event.getEventName() or ''
613 EINsession.open(EPGSearch, epg_name, False)
615 EINsession.open(MessageBox, text = _('EPGsearch is not installed!'), type = MessageBox.TYPE_INFO)
616 elif answer == "channelinfo":
617 EINsession.open(ServiceInfo, InfoBar_instance.servicelist.getCurrentSelection())
618 elif answer == "imdbinfo":
619 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/IMDb/plugin.pyo"):
620 from Plugins.Extensions.IMDb.plugin import IMDB
621 service = EINsession.nav.getCurrentService()
622 info = service.info()
623 epg_event=info.getEvent(0)
625 IeventName = epg_event.getEventName()
626 EINsession.open(IMDB, IeventName)
628 EINsession.open(MessageBox, text = _('IMDB is not installed!'), type = MessageBox.TYPE_INFO)
629 elif answer == "graphepg":
630 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/GraphMultiEPG/plugin.pyo"):
631 from Plugins.Extensions.GraphMultiEPG.plugin import main as gmepgmain
632 gmepgmain(EINsession, InfoBar_instance.servicelist)
634 EINsession.open(MessageBox, text = _('GraphMultiEPG is not installed!'), type = MessageBox.TYPE_INFO)
635 elif answer == "primetime":
636 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/PrimeTimeManager/plugin.pyo"):
637 from Plugins.Extensions.PrimeTimeManager.plugin import main as ptmanmain
638 ptmanmain(EINsession)
640 EINsession.open(MessageBox, text = _('Prime Time Manager is not installed!'), type = MessageBox.TYPE_INFO)
641 elif answer == "epgrefresh":
642 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGRefresh/plugin.pyo"):
643 from Plugins.Extensions.EPGRefresh.plugin import main as epgrefmain
644 epgrefmain(EINsession)
646 EINsession.open(MessageBox, text = _('EPGRefresh is not installed!'), type = MessageBox.TYPE_INFO)
647 elif answer == "cooltv":
648 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/CoolTVGuide/plugin.pyo"):
649 from Plugins.Extensions.CoolTVGuide.plugin import main as ctvmain
650 ctvmain(EINsession, InfoBar_instance.servicelist)
652 EINsession.open(MessageBox, text = _('CoolTVGuide is not installed!'), type = MessageBox.TYPE_INFO)
653 elif answer == "sysinfo":
654 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/Sherlock/plugin.pyo"):
655 from Plugins.Extensions.Sherlock.plugin import SherlockII
656 EINsession.open(SherlockII)
658 EINsession.open(MessageBox, text = _('Sherlock is not installed!'), type = MessageBox.TYPE_INFO)
659 elif answer == "sleep":
660 from Screens.SleepTimerEdit import SleepTimerEdit
661 EINsession.open(SleepTimerEdit)
663 EINsession.open(MessageBox, text = _('This function is yet not available!'), type = MessageBox.TYPE_INFO)
667 class EasyEvent(Screen, EventViewBase):
668 def __init__(self, session, Event, Ref, callback=None, singleEPGCB=None, multiEPGCB=None):
669 Screen.__init__(self, session)
670 self.session = session
671 self.skinName = "EventView"
672 EventViewBase.__init__(self, Event, Ref, callback=InfoBar_instance.eventViewCallback)
673 self["key_yellow"].setText(_(getPluginByName(config.plugins.EasyInfo.bEvInYellow.value)))
674 self["key_blue"].setText(_(getPluginByName(config.plugins.EasyInfo.bEvInBlue.value)))
675 self["key_red"].setText(_("Similar"))
676 self["epgactions"] = ActionMap(["EventViewEPGActions", "EPGSelectActions", "EventViewActions"],
678 "openSingleServiceEPG": self.singleEPGCB,
679 "openMultiServiceEPG": self.multiEPGCB,
680 "openSimilarList": self.openSimilarList,
681 "info": self.newExit,
682 "pageUp": self.pageUp,
683 "pageDown": self.pageDown,
684 "prevEvent": self.prevEvent,
685 "nextEvent": self.nextEvent
688 def openSimilarList(self):
690 EINcallbackFunc("epgsearch")
693 def singleEPGCB(self):
695 EINcallbackFunc(config.plugins.EasyInfo.bEvInYellow.value)
698 def multiEPGCB(self):
700 EINcallbackFunc(config.plugins.EasyInfo.bEvInBlue.value)
703 def setEvent(self, event):
707 text = event.getEventName()
708 short = event.getShortDescription()
709 ext = event.getExtendedDescription()
710 if short and short != text:
711 text += '\n\n' + short
716 self.setTitle(event.getEventName())
717 self["epg_description"].setText(text)
718 self["datetime"].setText(event.getBeginTimeString())
719 self["duration"].setText(_("%d min")%(event.getDuration()/60))
720 self["key_red"].setText(_("Similar"))
721 serviceref = self.currentService
722 eventid = self.event.getEventId()
723 refstr = serviceref.ref.toString()
724 isRecordEvent = False
725 for timer in self.session.nav.RecordTimer.timer_list:
726 if timer.eit == eventid and timer.service_ref.ref.toString() == refstr:
729 if isRecordEvent and self.key_green_choice != self.REMOVE_TIMER:
730 self["key_green"].setText(_("Remove timer"))
731 self.key_green_choice = self.REMOVE_TIMER
732 elif not isRecordEvent and self.key_green_choice != self.ADD_TIMER:
733 self["key_green"].setText(_("Add timer"))
734 self.key_green_choice = self.ADD_TIMER
738 self.session.open(EasyInfo)
743 class EvNewList(EPGList):
744 def __init__(self, type=EPG_TYPE_MULTI, selChangedCB=None, timer = None):
745 EPGList.__init__(self, type, selChangedCB, timer)
746 self.l.setFont(0, gFont("Regular", 20))
747 self.l.setFont(1, gFont("Regular", 18))
748 self.l.setItemHeight(50)
749 self.l.setBuildFunc(self.buildMultiEntry)
753 def recalcEntrySize(self):
754 esize = self.l.getItemSize()
755 self.breite = esize.width() - 200
757 def buildMultiEntry(self, changecount, service, eventId, beginTime, duration, EventName, nowTime, service_name):
758 (clock_pic, rec) = self.getPixmapForEntry(service, eventId, beginTime, duration)
760 sref = str(service)[:-1].replace(':','_')
761 Spixmap = LoadPixmap(path=(config.plugins.EasyInfo.myPicons.value + sref + '.png'))
762 if Spixmap is not None:
763 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, 5, 4, 70, 42, Spixmap))
765 res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 77, 50, 1, RT_HALIGN_CENTER|RT_VALIGN_CENTER|RT_WRAP, service_name))
767 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 80, 16, 21, 21, clock_pic))
768 if beginTime is not None and len(EventName) > 60:
769 if nowTime < beginTime:
770 begin = localtime(beginTime)
771 end = localtime(beginTime+duration)
773 (eListboxPythonMultiContent.TYPE_TEXT, 100, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
774 (eListboxPythonMultiContent.TYPE_TEXT, 110, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
775 (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
778 percent = (nowTime - beginTime)*100/duration
779 restzeit = ((beginTime+duration)-nowTime)
781 (eListboxPythonMultiContent.TYPE_PROGRESS, 110, 11, 40, 8, percent),
782 (eListboxPythonMultiContent.TYPE_TEXT, 110, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
783 (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
785 elif beginTime is not None:
786 if nowTime < beginTime:
787 begin = localtime(beginTime)
788 end = localtime(beginTime+duration)
790 (eListboxPythonMultiContent.TYPE_TEXT, 100, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
791 (eListboxPythonMultiContent.TYPE_TEXT, 110, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
792 (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
795 percent = (nowTime - beginTime)*100/duration
796 restzeit = ((beginTime+duration)-nowTime)
798 (eListboxPythonMultiContent.TYPE_PROGRESS, 110, 11, 40, 8, percent),
799 (eListboxPythonMultiContent.TYPE_TEXT, 110, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
800 (eListboxPythonMultiContent.TYPE_TEXT, 180, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
804 def moveToService(self,serviceref):
808 refstr = serviceref.toString()
811 self.instance.moveSelectionTo(index)
815 self.instance.moveSelectionTo(0)
819 class EasyPG(EPGSelection, Screen):
822 <screen name="EasyPG" backgroundColor="#101220" flags="wfNoBorder" position="0,0" size="1280,720" title="Easy PG">
823 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="60,35" size="660,650" zPosition="-1"/>
824 <widget font="Regular;20" position="785,30" render="Label" size="202,25" source="global.CurrentTime" transparent="1" zPosition="1">
825 <convert type="ClockToText">Format:%a %d. %b %H:%M</convert>
827 <widget backgroundColor="#ff000000" position="755,125" render="Pig" size="497,280" source="session.VideoPicture" zPosition="1"/>
828 <widget foregroundColor="#fcc000" font="Regular;20" name="date" position="755,415" size="100,25" transparent="1"/>
829 <widget name="list" position="60,35" scrollbarMode="showNever" size="660,650" transparent="1"/>
830 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-red.png" position="785,65" size="5,20"/>
831 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-green.png" position="785,90" size="5,20"/>
832 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-yellow.png" position="1005,65" size="5,20"/>
833 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-blue.png" position="1005,90" size="5,20"/>
834 <eLabel font="Regular;18" position="800,63" size="150,25" text="Similar" transparent="1"/>
835 <eLabel font="Regular;18" position="800,90" size="150,25" text="Timer" transparent="1"/>
836 <eLabel font="Regular;18" position="1015,63" size="150,25" text="Back" transparent="1"/>
837 <eLabel font="Regular;18" position="1015,90" size="150,25" text="Next" transparent="1"/>
838 <widget font="Regular;20" halign="right" position="870,415" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
839 <convert type="EventTime">StartTime</convert>
840 <convert type="ClockToText">Default</convert>
842 <eLabel font="Regular;18" position="945,415" size="10,25" text="-" transparent="1"/>
843 <widget font="Regular;20" position="955,415" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
844 <convert type="EventTime">EndTime</convert>
845 <convert type="ClockToText">Default</convert>
847 <widget font="Regular;20" position="1050,415" render="Label" size="171,25" source="Event" transparent="1" zPosition="1">
848 <convert type="EventTime">Duration</convert>
849 <convert type="ClockToText">InMinutes</convert>
851 <widget font="Regular;20" position="755,445" render="Label" size="480,25" source="Event" transparent="1" zPosition="2" noWrap="1">
852 <convert type="EventName">ShortDescription</convert>
854 <widget font="Regular;18" position="755,475" render="Label" size="480,210" source="Event" transparent="1" zPosition="3">
855 <convert type="EventName">ExtendedDescription</convert>
860 <screen name="EasyPG" backgroundColor="#0e1018" flags="wfNoBorder" position="0,0" size="1024,576" title="Easy PG">
861 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="50,50" size="520,450" zPosition="-1"/>
862 <eLabel backgroundColor="#666666" position="0,518" size="1024,1"/>
863 <widget font="Regular;20" position="50,525" render="Label" size="186,25" source="global.CurrentTime" transparent="1" zPosition="1">
864 <convert type="ClockToText">Format:%a %d. %b %H:%M</convert>
866 <widget backgroundColor="#ff000000" position="590,30" render="Pig" size="384,216" source="session.VideoPicture" zPosition="-1"/>
867 <widget foregroundColor="#fcc000" font="Regular;20" name="date" position="590,255" size="100,25" transparent="1"/>
868 <widget name="list" position="50,48" scrollbarMode="showNever" size="520,450" transparent="1"/>
869 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-red.png" position="275,525" size="5,20"/>
870 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-green.png" position="450,525" size="5,20"/>
871 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-yellow.png" position="625,525" size="5,20"/>
872 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-blue.png" position="800,525" size="5,20"/>
873 <eLabel font="Regular;18" position="290,526" size="150,25" text="Similar" transparent="1"/>
874 <eLabel font="Regular;18" position="465,526" size="150,25" text="Timer" transparent="1"/>
875 <eLabel font="Regular;18" position="640,526" size="150,25" text="Back" transparent="1"/>
876 <eLabel font="Regular;18" position="815,526" size="150,25" text="Next" transparent="1"/>
877 <widget font="Regular;20" halign="right" position="695,255" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
878 <convert type="EventTime">StartTime</convert>
879 <convert type="ClockToText">Default</convert>
881 <eLabel font="Regular;18" position="770,255" size="10,25" text="-" transparent="1"/>
882 <widget font="Regular;20" position="780,255" render="Label" size="70,25" source="Event" transparent="1" zPosition="1">
883 <convert type="EventTime">EndTime</convert>
884 <convert type="ClockToText">Default</convert>
886 <widget font="Regular;20" position="855,255" render="Label" size="130,25" source="Event" transparent="1" zPosition="1">
887 <convert type="EventTime">Duration</convert>
888 <convert type="ClockToText">InMinutes</convert>
890 <widget font="Regular;20" noWrap="1" position="590,285" render="Label" size="390,25" source="Event" transparent="1" zPosition="2">
891 <convert type="EventName">ShortDescription</convert>
893 <widget font="Regular;18" position="590,315" render="Label" size="390,190" source="Event" transparent="1" zPosition="3">
894 <convert type="EventName">ExtendedDescription</convert>
900 <screen name="EasyPG" backgroundColor="background" flags="wfNoBorder" position="0,0" size="720,576" title="Easy PG">
901 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="50,48" size="620,450" zPosition="-1"/>
902 <eLabel backgroundColor="#666666" position="0,522" size="756,1"/>
903 <widget foregroundColor="#fcc000" font="Regular;20" name="date" position="50,525" size="100,25" transparent="1"/>
904 <widget name="list" position="50,48" scrollbarMode="showOnDemand" size="620,450" transparent="1"/>
905 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-red.png" position="175,525" size="5,20"/>
906 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-yellow.png" position="350,525" size="5,20"/>
907 <ePixmap alphatest="blend" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/key-blue.png" position="525,525" size="5,20"/>
908 <eLabel font="Regular;18" position="190,526" size="150,25" text="Similar" transparent="1"/>
909 <eLabel font="Regular;18" position="365,526" size="150,25" text="Back" transparent="1"/>
910 <eLabel font="Regular;18" position="540,526" size="150,25" text="Next" transparent="1"/>
913 def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None, serviceChangeCB=None):
914 Screen.__init__(self, session)
915 EPGSelection.__init__(self, session, service, zapFunc, eventid, bouquetChangeCB, serviceChangeCB)
918 allbouq = InfoBar_instance.servicelist.getBouquetList()
919 for newpos in range(0, len(allbouq)):
920 if InfoBar_instance.servicelist.getRoot() == allbouq[newpos][1]:
924 self.session = session
925 EPGSelection.skinName = "EasyPG"
926 self.PThour = config.plugins.EasyInfo.Primetime2.value[0]
927 self.PTmin = config.plugins.EasyInfo.Primetime2.value[1]
928 self["list"] = EvNewList(type = EPG_TYPE_MULTI, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
929 self.skinName = "EasyPG"
930 self.RefrTimer = eTimer()
931 self.RefrTimer.callback.append(self.RefreshEPG)
932 self["actions"] = ActionMap(["EPGSelectActions", "OkCancelActions", "NumberActions", "InfobarActions"],
934 "cancel": self.closeScreen,
935 "ok": self.newOKFunc,
936 "timerAdd": self.timerAdd,
937 "yellow": self.yellowButtonPressed,
938 "blue": self.blueButtonPressed,
939 "info": self.infoKeyPressed,
940 "red": self.newRedFunc,
941 "input_date_time": self.einContextMenu,
942 "nextBouquet": self.nextBouquet,
943 "prevBouquet": self.prevBouquet,
944 "nextService": self.PTfor,
945 "prevService": self.PTback,
946 "showMovies": self.enterDateTime,
947 "showTv": self.zapTo,
948 "showRadio": self.zapForRefr,
955 def closeScreen(self):
959 self["list"].fillMultiEPG(self.services, -1)
962 def GoPrimetime(self):
964 pt = (heute[0],heute[1],heute[2],self.PThour,self.PTmin,0,heute[6],heute[7],0)
965 self.ask_time = int(mktime(pt))
967 if self.ask_time > int(mktime(heute)):
968 self["list"].fillMultiEPG(self.services, self.ask_time)
971 if config.plugins.EasyInfo.epgOKFunc.value == "exitzap":
974 elif config.plugins.EasyInfo.epgOKFunc.value == "zap":
977 self.infoKeyPressed()
979 def newRedFunc(self):
980 if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EPGSearch/plugin.pyo"):
981 from Plugins.Extensions.EPGSearch.EPGSearch import EPGSearch
982 epg_event = self["list"].getCurrent()[0]
984 epg_name = epg_event and epg_event.getEventName() or ''
985 self.session.open(EPGSearch, epg_name, False)
987 self.session.open(MessageBox, text = _('EPGsearch is not installed!'), type = MessageBox.TYPE_INFO)
990 if not self["list"].getCurrent()[0]:
994 pt = (heute[0],heute[1],heute[2],self.PThour,self.PTmin,0,heute[6],heute[7],0)
995 self.ask_time = int(mktime(pt))
997 if self.ask_time < int(mktime(heute)):
998 self.ask_time = self.ask_time + 86400
1000 self.ask_time = self.ask_time + 86400
1001 self["list"].fillMultiEPG(self.services, self.ask_time)
1006 pt = (heute[0],heute[1],heute[2],self.PThour,self.PTmin,0,heute[6],heute[7],0)
1007 self.ask_time = int(mktime(pt))
1010 self.ask_time = self.ask_time - 86400
1011 if self.ask_time > int(mktime(heute)):
1012 self["list"].fillMultiEPG(self.services, self.ask_time)
1014 self["list"].fillMultiEPG(self.services, -1)
1018 self.PThour = config.plugins.EasyInfo.Primetime1.value[0]
1019 self.PTmin = config.plugins.EasyInfo.Primetime1.value[1]
1023 self.PThour = config.plugins.EasyInfo.Primetime2.value[0]
1024 self.PTmin = config.plugins.EasyInfo.Primetime2.value[1]
1028 self.PThour = config.plugins.EasyInfo.Primetime3.value[0]
1029 self.PTmin = config.plugins.EasyInfo.Primetime3.value[1]
1032 def einContextMenu(self):
1033 self.session.open(ConfigEasyInfo)
1035 def zapForRefr(self):
1037 self.RefrTimer.start(4000, True)
1039 def RefreshEPG(self):
1040 self.RefrTimer.stop()
1045 class ESListNext(EPGList):
1046 def __init__(self, type=EPG_TYPE_MULTI, selChangedCB=None, timer = None):
1047 EPGList.__init__(self, type, selChangedCB, timer)
1048 self.l.setFont(0, gFont("Regular", 20))
1049 self.l.setFont(1, gFont("Regular", 18))
1050 self.l.setItemHeight(50)
1051 self.l.setBuildFunc(self.buildMultiEntry)
1055 def recalcEntrySize(self):
1056 esize = self.l.getItemSize()
1057 self.breite = esize.width() - 100
1059 def buildMultiEntry(self, changecount, service, eventId, beginTime, duration, EventName, nowTime, service_name):
1060 (clock_pic, rec) = self.getPixmapForEntry(service, eventId, beginTime, duration)
1063 res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, 58, 16, 21, 21, clock_pic))
1064 if beginTime is not None and len(EventName) > 60:
1065 if nowTime < beginTime:
1066 begin = localtime(beginTime)
1067 end = localtime(beginTime+duration)
1069 (eListboxPythonMultiContent.TYPE_TEXT, 0, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
1070 (eListboxPythonMultiContent.TYPE_TEXT, 10, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
1071 (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
1074 percent = (nowTime - beginTime)*100/duration
1075 restzeit = ((beginTime+duration)-nowTime)
1077 (eListboxPythonMultiContent.TYPE_PROGRESS, 10, 11, 40, 8, percent),
1078 (eListboxPythonMultiContent.TYPE_TEXT, 10, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
1079 (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_TOP|RT_WRAP, EventName)
1081 elif beginTime is not None:
1082 if nowTime < beginTime:
1083 begin = localtime(beginTime)
1084 end = localtime(beginTime+duration)
1086 (eListboxPythonMultiContent.TYPE_TEXT, 0, 4, 10, 20, 1, RT_HALIGN_RIGHT, '>'),
1087 (eListboxPythonMultiContent.TYPE_TEXT, 10, 4, 70, 44, 1, RT_HALIGN_LEFT, "%02d.%02d\n%02d.%02d"%(begin[3],begin[4],end[3],end[4])),
1088 (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
1091 percent = (nowTime - beginTime)*100/duration
1092 restzeit = ((beginTime+duration)-nowTime)
1094 (eListboxPythonMultiContent.TYPE_PROGRESS, 10, 11, 40, 8, percent),
1095 (eListboxPythonMultiContent.TYPE_TEXT, 10, 25, 60, 22, 1, RT_HALIGN_LEFT, "+%d:%02d" % (restzeit/3600, (restzeit/60)-((restzeit /3600)*60))),
1096 (eListboxPythonMultiContent.TYPE_TEXT, 80, 1, self.breite, 48, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER|RT_WRAP, EventName)
1100 def moveToService(self,serviceref):
1104 refstr = serviceref.toString()
1107 self.instance.moveSelectionTo(index)
1111 self.instance.moveSelectionTo(0)
1115 class EasySelection(EPGSelection, Screen):
1118 <screen name="EasySelection" backgroundColor="background" flags="wfNoBorder" position="0,0" size="1280,720" title="Easy Selection">
1119 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="60,35" size="660,650" zPosition="-1"/>
1120 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="720,35" size="500,650" zPosition="-1"/>
1121 <widget name="list" position="60,35" scrollbarMode="showNever" size="660,650" transparent="1"/>
1122 <widget name="listN" position="720,35" scrollbarMode="showNever" size="500,650" transparent="1"/>
1126 <screen name="EasySelection" backgroundColor="background" flags="wfNoBorder" position="0,0" size="1024,576" title="Easy Selection">
1127 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="40,38" size="660,500" zPosition="-1"/>
1128 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="700,38" size="284,500" zPosition="-1"/>
1129 <widget name="list" position="40,38" scrollbarMode="showNever" size="520,500" transparent="1"/>
1130 <widget name="listN" position="560,38" scrollbarMode="showNever" size="444,500" transparent="1"/>
1135 <screen name="EasySelection" backgroundColor="background" flags="wfNoBorder" position="0,0" size="720,576" title="Easy Selection">
1136 <ePixmap alphatest="on" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/EasyInfo/lines.png" position="50,38" size="620,500" zPosition="-1"/>
1137 <widget name="list" position="50,38" scrollbarMode="showOnDemand" size="620,500" transparent="1"/>
1140 def __init__(self, session, service, zapFunc=None, eventid=None, bouquetChangeCB=None, serviceChangeCB=None):
1141 Screen.__init__(self, session)
1142 EPGSelection.__init__(self, session, service, zapFunc, eventid, bouquetChangeCB, serviceChangeCB)
1145 allbouq = InfoBar_instance.servicelist.getBouquetList()
1146 for newpos in range(0, len(allbouq)):
1147 if InfoBar_instance.servicelist.getRoot() == allbouq[newpos][1]:
1148 EINposition = newpos
1150 self.session = session
1151 EPGSelection.skinName = "EasySelection"
1152 self["list"] = EvNewList(type = EPG_TYPE_MULTI, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
1153 self["listN"] = ESListNext(type = EPG_TYPE_MULTI, selChangedCB = self.onSelectionChanged, timer = session.nav.RecordTimer)
1154 self.skinName = "EasySelection"
1155 self["actions"] = ActionMap(["EPGSelectActions", "OkCancelActions", "DirectionActions"],
1157 "cancel": self.closeScreen,
1158 "ok": self.newOKFunc,
1159 "info": self.infoKeyPressed,
1160 "nextBouquet": self.nextBouquet,
1161 "prevBouquet": self.prevBouquet,
1162 "right": self.right,
1163 "rightRepeated": self.right,
1165 "leftRepeated": self.left,
1167 "upRepeated": self.up,
1169 "downRepeated": self.down,
1170 "nextService": self.PrimeTimeLook,
1171 "prevService": self.NowNextLook
1173 self.onLayoutFinish.append(self.byLayoutEnd)
1175 def byLayoutEnd(self):
1176 self["listN"].recalcEntrySize()
1177 self["listN"].fillMultiEPG(self.services, -1)
1178 self["listN"].moveToService(self.session.nav.getCurrentlyPlayingServiceReference())
1179 self["listN"].updateMultiEPG(1)
1181 def closeScreen(self):
1184 def newOKFunc(self):
1189 self["list"].instance.moveSelection(self["list"].instance.pageUp)
1190 self["listN"].instance.moveSelection(self["list"].instance.pageUp)
1193 self["list"].instance.moveSelection(self["list"].instance.pageDown)
1194 self["listN"].instance.moveSelection(self["list"].instance.pageDown)
1197 self["list"].moveUp()
1198 self["listN"].moveUp()
1201 self["list"].moveDown()
1202 self["listN"].moveDown()
1204 def nextBouquet(self):
1205 if self.bouquetChangeCB:
1206 self.bouquetChangeCB(1, self)
1209 def prevBouquet(self):
1210 if self.bouquetChangeCB:
1211 self.bouquetChangeCB(-1, self)
1214 def PrimeTimeLook(self):
1216 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)
1217 ask_time = int(mktime(pt))
1218 if ask_time > int(mktime(heute)):
1219 self["list"].fillMultiEPG(self.services, ask_time)
1220 pt = (heute[0],heute[1],heute[2],config.plugins.EasyInfo.Primetime3.value[0],config.plugins.EasyInfo.Primetime3.value[1],0,heute[6],heute[7],0)
1221 ask_time = int(mktime(pt))
1222 self["listN"].fillMultiEPG(self.services, ask_time)
1224 def NowNextLook(self):
1225 self["list"].fillMultiEPG(self.services, -1)
1226 self["listN"].fillMultiEPG(self.services, -1)
1227 self["listN"].updateMultiEPG(1)
1229 def infoKeyPressed(self):
1230 cur = self["list"].getCurrent()
1231 service = cur[1].ref.toString()
1232 ref = eServiceReference(service)
1234 InfoBar_instance.servicelist.savedService = ref
1235 self.session.openWithCallback(InfoBar_instance.servicelist.SingleServiceEPGClosed, EPGSelection, ref, serviceChangeCB = InfoBar_instance.servicelist.changeServiceCB)