use Tools.Directories to get paths
[enigma2.git] / lib / python / Screens / Menu.py
index 4ad36d18a73c78b5d6a7ca3049f6d860598482bf..68a8ef98bfca4c31ac86551499efaa8c6d951914 100644 (file)
@@ -6,6 +6,8 @@ from Components.Button import Button
 from Components.Label import Label
 from Components.ProgressBar import ProgressBar
 
+from Tools.Directories import resolveFilename, SCOPE_SKIN
+
 from enigma import quitMainloop
 
 import xml.dom.minidom
@@ -29,12 +31,7 @@ def doGlobal(screen):
 
 
 # read the menu
-try:
-       # first we search in the current path
-       menufile = file('data/menu.xml', 'r')
-except IOError:
-       # if not found in the current path, we use the global datadir-path
-       menufile = file('/usr/share/enigma2/menu.xml', 'r')
+menufile = file(resolveFilename(SCOPE_SKIN, 'menu.xml'), 'r')
 mdom = xml.dom.minidom.parseString(menufile.read())
 menufile.close()
 
@@ -91,7 +88,8 @@ class Menu(Screen):
                #        plus possible arguments, as 
                #        string (as we want to reference 
                #        stuff which is just imported)
-               # FIXME. somehow.
+               # FIXME. somehow
+               print arg
                if arg[0] != "":
                        exec "from " + arg[0] + " import *"
                        
@@ -120,11 +118,14 @@ class Menu(Screen):
                                if x.nodeType != xml.dom.minidom.Element.nodeType:
                                        continue
                                elif x.tagName == 'screen':
-                                       module = "Screens." + getValbyAttr(x, "module")
+                                       module = getValbyAttr(x, "module")
                                        screen = getValbyAttr(x, "screen")
 
                                        if len(screen) == 0:
                                                screen = module
+
+                                       if module != "":
+                                               module = "Screens." + module
                                        
                                        # check for arguments. they will be appended to the 
                                        # openDialog call