git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add possibility to call eConsoleAppContainer execute with unlimited count of arguments
[enigma2.git]
/
lib
/
python
/
Screens
/
Menu.py
diff --git
a/lib/python/Screens/Menu.py
b/lib/python/Screens/Menu.py
index 7ae50cd059a347e83ef3e426de14b979c698d895..92039b429fa4679d860137f8760dbbde14cc2bf8 100644
(file)
--- a/
lib/python/Screens/Menu.py
+++ b/
lib/python/Screens/Menu.py
@@
-5,6
+5,7
@@
from Components.Sources.StaticText import StaticText
from Components.config import configfile
from Components.PluginComponent import plugins
from Components.config import config
from Components.config import configfile
from Components.PluginComponent import plugins
from Components.config import config
+from Components.SystemInfo import SystemInfo
from Tools.Directories import resolveFilename, SCOPE_SKIN
from Tools.Directories import resolveFilename, SCOPE_SKIN
@@
-74,7
+75,8
@@
class Menu(Screen):
def okbuttonClick(self):
print "okbuttonClick"
selection = self["menu"].getCurrent()
def okbuttonClick(self):
print "okbuttonClick"
selection = self["menu"].getCurrent()
- selection[1]()
+ if selection is not None:
+ selection[1]()
def execText(self, text):
exec text
def execText(self, text):
exec text
@@
-101,6
+103,9
@@
class Menu(Screen):
self.session.openWithCallback(self.menuClosed, Setup, dialog)
def addMenu(self, destList, node):
self.session.openWithCallback(self.menuClosed, Setup, dialog)
def addMenu(self, destList, node):
+ requires = node.getAttribute("requires")
+ if requires and not SystemInfo.get(requires, False):
+ return
MenuTitle = _(node.getAttribute("text").encode("UTF-8") or "??")
entryID = node.getAttribute("entryID") or "undefined"
weight = node.getAttribute("weight") or 50
MenuTitle = _(node.getAttribute("text").encode("UTF-8") or "??")
entryID = node.getAttribute("entryID") or "undefined"
weight = node.getAttribute("weight") or 50
@@
-121,6
+126,9
@@
class Menu(Screen):
self.close(True)
def addItem(self, destList, node):
self.close(True)
def addItem(self, destList, node):
+ requires = node.getAttribute("requires")
+ if requires and not SystemInfo.get(requires, False):
+ return
item_text = node.getAttribute("text").encode("UTF-8")
entryID = node.getAttribute("entryID") or "undefined"
weight = node.getAttribute("weight") or 50
item_text = node.getAttribute("text").encode("UTF-8")
entryID = node.getAttribute("entryID") or "undefined"
weight = node.getAttribute("weight") or 50
@@
-172,6
+180,7
@@
class Menu(Screen):
continue
elif x.tagName == 'item':
item_level = int(x.getAttribute("level") or "0")
continue
elif x.tagName == 'item':
item_level = int(x.getAttribute("level") or "0")
+
if item_level <= config.usage.setup_level.index:
self.addItem(list, x)
count += 1
if item_level <= config.usage.setup_level.index:
self.addItem(list, x)
count += 1
@@
-193,8
+202,13
@@
class Menu(Screen):
if menuID is not None:
# plugins
for l in plugins.getPluginsForMenu(menuID):
if menuID is not None:
# plugins
for l in plugins.getPluginsForMenu(menuID):
+ # check if a plugin overrides an existing menu
+ plugin_menuid = l[2]
+ for x in list:
+ if x[2] == plugin_menuid:
+ list.remove(x)
+ break
list.append((l[0], boundFunction(l[1], self.session), l[2], l[3] or 50))
list.append((l[0], boundFunction(l[1], self.session), l[2], l[3] or 50))
-
# for the skin: first try a menu_<menuID>, then Menu
self.skinName = [ ]
# for the skin: first try a menu_<menuID>, then Menu
self.skinName = [ ]
@@
-224,6
+238,7
@@
class Menu(Screen):
})
a = parent.getAttribute("title").encode("UTF-8") or None
})
a = parent.getAttribute("title").encode("UTF-8") or None
+ a = a and _(a)
if a is None:
a = _(parent.getAttribute("text").encode("UTF-8"))
self["title"] = StaticText(a)
if a is None:
a = _(parent.getAttribute("text").encode("UTF-8"))
self["title"] = StaticText(a)