X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/72340ff944f651577e6175f030ab2f761e971ee6..9b1c4b296ae2f83c62cb83c5babfc35cbc3d52f7:/lib/python/Screens/Menu.py diff --git a/lib/python/Screens/Menu.py b/lib/python/Screens/Menu.py index db41cd57..bba36282 100644 --- a/lib/python/Screens/Menu.py +++ b/lib/python/Screens/Menu.py @@ -5,6 +5,7 @@ from Components.Header import Header from Components.Button import Button from Components.Label import Label from Components.ProgressBar import ProgressBar +from Components.config import configfile from Tools.Directories import resolveFilename, SCOPE_SKIN @@ -89,7 +90,6 @@ class Menu(Screen): # string (as we want to reference # stuff which is just imported) # FIXME. somehow - print arg if arg[0] != "": exec "from " + arg[0] + " import *" @@ -107,10 +107,18 @@ class Menu(Screen): def addMenu(self, destList, node): MenuTitle = _(getValbyAttr(node, "text")) if MenuTitle != "": #check for title - a = boundFunction(self.session.openWithCallback, self.menuClosed, Menu, node, node.childNodes) + x = getValbyAttr(node, "flushConfigOnClose") + if x == "1": + a = boundFunction(self.session.openWithCallback, self.menuClosedWithConfigFlush, Menu, node, node.childNodes) + else: + a = boundFunction(self.session.openWithCallback, self.menuClosed, Menu, node, node.childNodes) #TODO add check if !empty(node.childNodes) destList.append((MenuTitle, a)) + def menuClosedWithConfigFlush(self, *res): + configfile.save() + self.menuClosed(*res) + def menuClosed(self, *res): if len(res) and res[0]: self.close(True)