show bskyb HD services in channelselection
[enigma2.git] / lib / python / Screens / EventView.py
index 56a9e02ce694b870b048bb9d0fc5bfc153102dd5..1bb3d0b16adb184d78f5a71dcbc719f5c9f030a6 100644 (file)
@@ -3,18 +3,17 @@ from Components.ActionMap import ActionMap
 from Components.Button import Button
 from Components.Label import Label
 from Components.ScrollLabel import ScrollLabel
-from enigma import eServiceEventPtr, eEPGCachePtr, eEPGCache, eTimer
-from ServiceReference import ServiceReference
+from enigma import eEPGCache, eTimer, eServiceReference
 from RecordTimer import RecordTimerEntry, parseEvent
 from TimerEntry import TimerEntry
-from time import localtime, asctime
+from time import localtime
 
 class EventViewBase:
        def __init__(self, Event, Ref, callback=None, similarEPGCB=None):
                self.similarEPGCB = similarEPGCB
                self.cbFunc = callback
                self.currentService=Ref
-               self.isRecording = len(Ref.ref.getPath())
+               self.isRecording = (not Ref.ref.flags & eServiceReference.isGroup) and len(Ref.ref.getPath())
                self.event = Event
                self["epg_description"] = ScrollLabel()
                self["datetime"] = Label()
@@ -23,7 +22,7 @@ class EventViewBase:
                self["key_red"] = Button("")
                if similarEPGCB is not None:
                        self.SimilarBroadcastTimer = eTimer()
-                       self.SimilarBroadcastTimer.timeout.get().append(self.getSimilarEvents)
+                       self.SimilarBroadcastTimer.callback.append(self.getSimilarEvents)
                else:
                        self.SimilarBroadcastTimer = None
                if self.isRecording:
@@ -59,7 +58,7 @@ class EventViewBase:
 
        def timerAdd(self):
                if not self.isRecording:
-                       newEntry = RecordTimerEntry(self.currentService, *parseEvent(self.event))
+                       newEntry = RecordTimerEntry(self.currentService, checkOldTimers = True, *parseEvent(self.event))
                        self.session.openWithCallback(self.timerEditFinished, TimerEntry, newEntry)
 
        def timerEditFinished(self, answer):
@@ -89,6 +88,8 @@ class EventViewBase:
 
        def setEvent(self, event):
                self.event = event
+               if event is None:
+                       return
                text = event.getEventName()
                short = event.getShortDescription()
                ext = event.getExtendedDescription()
@@ -131,7 +132,7 @@ class EventViewBase:
                        self["key_red"].setText(_("Similar"))
 
        def openSimilarList(self):
-               if self.similarEPGCB is not None:
+               if self.similarEPGCB is not None and len(self["key_red"].getText()):
                        id = self.event and self.event.getEventId()
                        refstr = str(self.currentService)
                        if id is not None: