now its possible to call ePixmap.setPixmap from python without use of
[enigma2.git] / lib / python / Screens / Menu.py
index 6ef4cc4e9e2a692a2e46b9c189f032b6c2aceb28..113eeb6d06c9634723ef88d89fbf2288cedf5c5a 100644 (file)
@@ -7,11 +7,10 @@ from Components.Label import Label
 from Components.ProgressBar import ProgressBar
 from Components.config import configfile
 from Components.Sources.Clock import Clock
+from Components.PluginComponent import plugins
 
 from Tools.Directories import resolveFilename, SCOPE_SKIN
 
-from enigma import quitMainloop
-
 import xml.dom.minidom
 from xml.dom import EMPTY_NAMESPACE
 from skin import elementsWithTag
@@ -23,7 +22,6 @@ from Tools import XMLTools
 #              <item text="TV-Mode">self.setModeTV()</item>
 #              <item text="Radio-Mode">self.setModeRadio()</item>
 #              <item text="File-Mode">self.setModeFile()</item>
-#              <item text="Scart">self.openDialog(ScartLoopThrough)</item>
 #                      <item text="Sleep Timer"></item>
 
 
@@ -109,14 +107,14 @@ class Menu(Screen):
                # FIXME. somehow
                if arg[0] != "":
                        exec "from " + arg[0] + " import *"
-                       
+
                self.openDialog(*eval(arg[1]))
 
-       def nothing(self):                                                                                                                                      #dummy
+       def nothing(self): #dummy
                pass
 
        def openDialog(self, *dialog):                          # in every layer needed
-               self.session.open(*dialog)
+               self.session.openWithCallback(self.menuClosed, *dialog)
 
        def openSetup(self, dialog):
                self.session.openWithCallback(self.menuClosed, Setup, dialog)
@@ -183,9 +181,8 @@ class Menu(Screen):
                Screen.__init__(self, session)
                
                list = []
-               menuID = ""
-
-               menuID = -1
+               
+               menuID = None
                for x in childNode:                                             #walk through the actual nodelist
                        if x.nodeType != xml.dom.minidom.Element.nodeType:
                            continue
@@ -198,13 +195,19 @@ class Menu(Screen):
                        elif x.tagName == "id":
                                menuID = x.getAttribute("val")
                                count = 0
-                       if menuID != -1:
+
+                       if menuID is not None:
+                               # menuupdater?
                                if menuupdater.updatedMenuAvailable(menuID):
                                        for x in menuupdater.getUpdatedMenu(menuID):
                                                if x[1] == count:
                                                        list.append((x[0], boundFunction(self.runScreen, (x[2], x[3] + ", "))))
                                                        count += 1
 
+               if menuID is not None:
+                       # plugins
+                       for l in plugins.getPluginsForMenu(menuID):
+                               list.append((l[0], boundFunction(l[1], self.session)))
 
                self["menu"] = MenuList(list)   
                                                        
@@ -236,21 +239,3 @@ class MainMenu(Menu):
        def __init__(self, *x):
                Menu.__init__(self, *x)
                self.skinName = "Menu"
-
-       def openDialog(self, dialog):
-               self.session.open(dialog)
-
-       def openSetup(self, dialog):
-               self.session.open(Setup, dialog)
-
-       def setModeTV(self):
-               print "set Mode to TV"
-               pass
-
-       def setModeRadio(self):
-               print "set Mode to Radio"
-               pass
-
-       def setModeFile(self):
-               print "set Mode to File"
-               pass