try to add a epglist (not working yet)
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 10 Nov 2005 15:27:23 +0000 (15:27 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 10 Nov 2005 15:27:23 +0000 (15:27 +0000)
lib/python/Components/EpgList.py [new file with mode: 0644]
lib/python/Screens/ChannelSelection.py
lib/python/Screens/EpgSelection.py [new file with mode: 0644]
lib/python/Screens/InfoBar.py

diff --git a/lib/python/Components/EpgList.py b/lib/python/Components/EpgList.py
new file mode 100644 (file)
index 0000000..5fa5476
--- /dev/null
@@ -0,0 +1,44 @@
+from HTMLComponent import *
+from GUIComponent import *
+
+from enigma import *
+
+class EPGList(HTMLComponent, GUIComponent):
+       def __init__(self):
+               GUIComponent.__init__(self)
+               self.l = eListboxEPGContent()
+
+       def getCurrent(self):
+               r = eServiceEventPtr()
+               self.l.getCurrent(r)
+               return r
+
+       def moveUp(self):
+               self.instance.moveSelection(self.instance.moveUp)
+
+       def moveDown(self):
+               self.instance.moveSelection(self.instance.moveDown)
+
+       def GUIcreate(self, parent):
+               self.instance = eListbox(parent)
+               self.instance.setContent(self.l)
+
+       def GUIdelete(self):
+               self.instance = None
+
+       def setRoot(self, root):
+               self.l.setRoot(root)
+               self.l.sort()
+
+#      def setMode(self, mode):
+#              if mode == self.MODE_NORMAL:
+#                      self.instance.setItemHeight(20)
+#                      self.l.setVisualMode(eListboxServiceContent.visModeSimple)
+#              else:
+#                      self.instance.setItemHeight(40)
+#                      self.l.setElementFont(self.l.celServiceName, gFont("Arial", 30))
+#                      self.l.setElementPosition(self.l.celServiceName, eRect(40, 0, self.instance.size().width(), 40))
+#                      self.l.setElementFont(self.l.celServiceNumber, gFont("Arial", 20))
+#                      self.l.setElementPosition(self.l.celServiceNumber, eRect(0, 10, 40, 30))
+#
+#                      self.l.setVisualMode(eListboxServiceContent.visModeComplex)
index 1fe572e90f30ac57fbd92f358506c2114434d3f9..c8bfb2cb4021a43cef90e2a10eb219d4b8c3167d 100644 (file)
@@ -154,7 +154,10 @@ class ChannelSelection(Screen):
                        self.movemode = False
                else:
                        self.movemode = True
-       
+
+       def getCurrent(self):
+               return self["list"].getCurrent()
+
        def showFavourites(self):
                l = self["list" ]
                l.setRoot(eServiceReference('1:0:1:0:0:0:0:0:0:0:(provider == "fav")'))
diff --git a/lib/python/Screens/EpgSelection.py b/lib/python/Screens/EpgSelection.py
new file mode 100644 (file)
index 0000000..aeab4f0
--- /dev/null
@@ -0,0 +1,42 @@
+from Screen import Screen
+from Components.Button import Button
+from Components.EpgList import EPGList
+from Components.ActionMap import ActionMap
+
+from enigma import eServiceReference
+
+from Screens.FixedMenu import FixedMenu
+
+import xml.dom.minidom
+
+class EPGSelection(Screen):
+       def __init__(self, session):
+               Screen.__init__(self, session)
+
+               self["list"] = EPGList()
+#              self["list"].setRoot(root)
+
+               class ChannelActionMap(ActionMap):
+                       def action(self, contexts, action):
+                                       ActionMap.action(self, contexts, action)
+
+               self["actions"] = ChannelActionMap(["ChannelSelectActions", "OkCancelActions"], 
+                       {
+                               "cancel": self.close,
+                               "ok": self.eventSelected,
+                       })
+               self["actions"].csel = self
+
+       def eventSelected(self):
+               ref = self["list"].getCurrent()
+# open eventdetail view... not finished yet
+               self.close()
+       
+       def setRoot(self, root):
+               self["list"].setRoot(root)
+
+       def moveUp(self):
+               self["list"].moveUp()
+
+       def moveDown(self):
+               self["list"].moveDown()
index 9892e40b55694603671d023b87e422db2b1d5f45..39f547e604e046a6fcb5f6ac0213ad3bc8336214 100644 (file)
@@ -1,4 +1,5 @@
 from Screen import Screen
+from EpgSelection import EPGSelection
 from ChannelSelection import ChannelSelection
 from Components.Clock import Clock
 from Components.ActionMap import ActionMap
@@ -58,7 +59,8 @@ class InfoBar(Screen):
                                "hide": self.hide,
                                "toggleShow": self.toggleShow,
                                "showMovies": self.showMovies,
-                               "quit": self.quit
+                               "quit": self.quit,
+                               "showEPGList": self.showEPGList
                        })
 #              self["okbutton"] = Button("mainMenu", [self.mainMenu])
                
@@ -152,8 +154,13 @@ class InfoBar(Screen):
                        self.muteDialog.instance.show()
                else:
                        self.muteDialog.instance.hide()
-                       
-       def     quit(self):
+
+       def showEPGList(self):
+# TODO hier irgendwie EPGSelection benutzen und setRoot benutzen um nen service zu uebergeben
+# self.session.nav.getCurrentlyPlayingServiceReference() sollte das wohl sein
+               print "hier soll mal ne EPGList aufgehen"
+
+       def quit(self):
                configfile.save()
                quitMainloop()