show servicename in eventview
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 13 Nov 2005 11:08:33 +0000 (11:08 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Sun, 13 Nov 2005 11:08:33 +0000 (11:08 +0000)
lib/python/Screens/EpgSelection.py
lib/python/Screens/EventView.py
lib/service/event.cpp

index 03228f60a44241d52420fd8c988726087dfab4f9..def51d49d66e9affa2ccb384294bf0b1b17c316a 100644 (file)
@@ -41,7 +41,7 @@ class EPGSelection(Screen):
 
        def eventSelected(self):
                event = self["list"].getCurrent()
-               self.session.open(EventView, event, self.eventViewCallback)
+               self.session.open(EventView, event, self.currentService, self.eventViewCallback)
        
        def timerAdd(self):
                epg = self["list"].getCurrent()
@@ -69,8 +69,9 @@ class EPGSelection(Screen):
                        self.session.nav.RecordTimer.record(answer[1])
                else:
                        print "Timeredit aborted"       
-                       
+
        def setRoot(self, root):
+               self.currentService=ServiceReference(root)
                self["list"].setRoot(root)
 
        def moveUp(self):
index 6dfb389480583ff6bd756462c21d059a183d5364..275b8952008cad50d6aa3a7e17cd3ae475238a92 100644 (file)
@@ -2,12 +2,14 @@ from Screen import Screen
 from Components.ActionMap import ActionMap
 from Components.Label import Label
 from Components.ScrollLabel import ScrollLabel
-from enigma import eWidget, eServiceEventPtr, eLabel
+from enigma import eServiceEventPtr
+from ServiceReference import ServiceReference
 
 class EventView(Screen):
-       def __init__(self, session, Event, callback=None):
+       def __init__(self, session, Event, Ref, callback=None):
                Screen.__init__(self, session)
                self.cbFunc = callback
+               self.currentService=None
                self["epg_description"] = ScrollLabel()
                self["datetime"] = Label()
                self["channel"] = Label()
@@ -22,6 +24,7 @@ class EventView(Screen):
                                "nextEvent": self.nextEvent
                        })
                self.setEvent(Event)
+               self.setService(Ref)
 
        def prevEvent(self):
                if self.cbFunc is not None:
@@ -31,14 +34,23 @@ class EventView(Screen):
                if self.cbFunc is not None:
                        self.cbFunc(self.setEvent, +1)
 
+       def setService(self, service):
+               self.currentService=service
+               name = self.currentService.getServiceName()
+               if name is not None:
+                       self["channel"].setText(name)
+               else:
+                       self["channel"].setText("unknown service")
+
        def setEvent(self, event):
+#              FIXME .. how to set eWindow titlebar?
+#              self.instance.setTitle(event.getEventName())
                text = event.getShortDescription()
                if len(text) > 0:
                        text = text + '\n\n'
                text = text + event.getExtendedDescription()
                self["epg_description"].setText(text)
                self["datetime"].setText(event.getBeginTimeString())
-               self["channel"].setText("Unknown Service")
                self["duration"].setText("%d min"%(event.getDuration()/60))
 
        def pageUp(self):
index 2704ff0fa5df909d144d058f10120cd389e03b30..36446797102ac5930b7a69602479e17e39fcfc4f 100644 (file)
@@ -81,6 +81,7 @@ bool eServiceEvent::loadLanguage(Event *evt, std::string lang)
                                const ExtendedEventList *itemlist = eed->getItems();
                                for (ExtendedEventConstIterator it = itemlist->begin(); it != itemlist->end(); ++it)
                                {
+                                       m_extended_description += '\n';
                                        m_extended_description += convertDVBUTF8((*it)->getItemDescription());
                                        m_extended_description += ' ';
                                        m_extended_description += convertDVBUTF8((*it)->getItem());