allow burning DVDs with multiple titles where playback automatically jumps to the...
[enigma2.git] / lib / python / Plugins / Extensions / GraphMultiEPG / GraphMultiEpg.py
index d6d27595e69104db3d44b467a1d434f3bd77c06b..036cb7a6fd7a88f50abbd8761ba63fd32de9fe6e 100644 (file)
@@ -7,7 +7,6 @@ from Components.HTMLComponent import HTMLComponent
 from Components.GUIComponent import GUIComponent
 from Components.EpgList import Rect
 from Components.Sources.Event import Event
-from Components.Sources.Source import ObsoleteSource
 from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest
 from Screens.Screen import Screen
 from Screens.EventView import EventViewSimple
@@ -39,7 +38,7 @@ class EPGList(HTMLComponent, GUIComponent):
                if overjump_empty:
                        self.l.setSelectableFunc(self.isSelectable)
                self.epgcache = eEPGCache.getInstance()
-               self.clock_pixmap = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, 'epgclock-fs8.png'))
+               self.clock_pixmap = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, 'skin_default/icons/epgclock.png'))
                self.time_base = None
                self.time_epoch = time_epoch
                self.list = None
@@ -53,7 +52,7 @@ class EPGList(HTMLComponent, GUIComponent):
                self.foreColorService = None
                self.backColorService = None
 
-       def applySkin(self, desktop):
+       def applySkin(self, desktop, screen):
                if self.skinAttributes is not None:
                        attribs = [ ]
                        for (attrib, value) in self.skinAttributes:
@@ -74,7 +73,7 @@ class EPGList(HTMLComponent, GUIComponent):
                                else:
                                        attribs.append((attrib,value))
                        self.skinAttributes = attribs
-               return GUIComponent.applySkin(self, desktop)
+               return GUIComponent.applySkin(self, desktop, screen)
 
        def isSelectable(self, service, sname, event_list):
                return (event_list and len(event_list) and True) or False
@@ -170,6 +169,10 @@ class EPGList(HTMLComponent, GUIComponent):
                self.l.setFont(1, gFont("Regular", 14))
                self.l.setSelectionClip(eRect(0,0,0,0), False)
 
+       def preWidgetRemove(self, instance):
+               instance.selectionChanged.get().remove(self.serviceChanged)
+               instance.setContent(None)
+
        def recalcEntrySize(self):
                esize = self.l.getItemSize()
                width = esize.width()
@@ -215,7 +218,7 @@ class EPGList(HTMLComponent, GUIComponent):
                        borderColor = self.borderColor
 
                        for ev in events:  #(event_id, event_title, begin_time, duration)
-                               rec=self.timer.isInTimer(ev[0], ev[2], ev[3], service) > ((ev[3]/10)*8)
+                               rec=ev[2] and self.timer.isInTimer(ev[0], ev[2], ev[3], service) > ((ev[3]/10)*8)
                                xpos, ewidth = self.calcEntryPosAndWidthHelper(ev[2], ev[3], start, end, width)
                                res.append(MultiContentEntryText(pos = (left+xpos, top), size = (ewidth, height), font = 1, flags = RT_HALIGN_CENTER | RT_VALIGN_CENTER | RT_WRAP, text = ev[1], color = foreColor, color_sel = foreColorSelected, backcolor = backColor, backcolor_sel = backColorSelected, border_width = 1, border_color = borderColor))
                                if rec and ewidth > 23:
@@ -272,7 +275,7 @@ class EPGList(HTMLComponent, GUIComponent):
                        self.cur_service = None
                        self.time_base = int(stime)
                        test = [ (service.ref.toString(), 0, self.time_base, self.time_epoch) for service in services ]
-               test.insert(0, 'RnITBD')
+               test.insert(0, 'XRnITBD')
                epg_data = self.queryEPG(test)
 
                self.list = [ ]
@@ -343,7 +346,6 @@ class GraphMultiEPG(Screen):
                self["key_green"] = Button(_("Add timer"))
                self["timeline_text"] = TimelineText()
                self["Event"] = Event()
-               self["Clock"] = ObsoleteSource(new_source = "global.CurrentTime", removal_date = "2008-01")
                self.time_lines = [ ]
                for x in (0,1,2,3,4,5):
                        pm = Pixmap()
@@ -380,7 +382,7 @@ class GraphMultiEPG(Screen):
                        },-1)
 
                self.updateTimelineTimer = eTimer()
-               self.updateTimelineTimer.timeout.get().append(self.moveTimeLines)
+               self.updateTimelineTimer.callback.append(self.moveTimeLines)
                self.updateTimelineTimer.start(60*1000)
                self.onLayoutFinish.append(self.onCreate)
 
@@ -496,7 +498,7 @@ class GraphMultiEPG(Screen):
                serviceref = cur[1]
                if event is None:
                        return
-               newEntry = RecordTimerEntry(serviceref, checkOldTimers = True, *parseEvent(event))
+               newEntry = RecordTimerEntry(serviceref, checkOldTimers = True, dirname = config.movielist.last_timer_videodir.value, *parseEvent(event))
                self.session.openWithCallback(self.timerEditFinished, TimerEntry, newEntry)
 
        def timerEditFinished(self, answer):