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