X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/301bab11f8453a6899153b7be338a352803b22cb..14a8e1d85dd79328945b1812e639e9693cc4cbb1:/lib/python/Screens/Setup.py diff --git a/lib/python/Screens/Setup.py b/lib/python/Screens/Setup.py index a694ab16..ef24ac83 100644 --- a/lib/python/Screens/Setup.py +++ b/lib/python/Screens/Setup.py @@ -1,7 +1,7 @@ from Screen import Screen from Components.ActionMap import ActionMap from Components.config import config #global config instance -from Components.config import configEntry +#from Components.config import configEntry from Components.config import configBoolean from Components.ConfigList import ConfigList from Components.Label import Label @@ -12,69 +12,15 @@ from skin import elementsWithTag from Tools import XMLTools -setupdom = xml.dom.minidom.parseString( - """ - - - config.inputDevices.repeat - config.inputDevices.delay - config.rc.map - - - config.timezone.val - - - config.av.colorformat - config.av.aspectratio - config.av.tvsystem - config.av.wss - config.av.defaultac3 - config.av.vcrswitch - - - config.rfmod.enable - config.rfmod.test - config.rfmod.sound - config.rfmod.soundcarrier - config.rfmod.channel - config.rfmod.finetune - - - config.keyboard.keymap - - - config.osd.alpha - config.osd.bright - config.osd.contrast - config.osd.language - - - config.lcd.bright - config.lcd.standby - config.lcd.invert - - - config.parental.lock - config.parental.setuplock - - - config.expert.splitsize - config.expert.satpos - config.expert.fastzap - config.expert.skipconfirm - config.expert.hideerrors - config.expert.autoinfo - - - config.sat.diseqcA - config.sat.posA - config.sat.satA - config.sat.diseqcB - config.sat.posB - config.sat.satB - - - """) +# read the setupmenu +try: + # first we search in the current path + setupfile = file('data/setup.xml', 'r') +except: + # if not found in the current path, we use the global datadir-path + setupfile = file('/usr/share/enigma2/setup.xml', 'r') +setupdom = xml.dom.minidom.parseString(setupfile.read()) +setupfile.close() def getValbyAttr(x, attr): for p in range(x.attributes.length): @@ -114,9 +60,15 @@ class Setup(Screen): def keySave(self): print "save requested" - for x in self["config"]: - selection = self["config"].getCurrent() - selection.save() + for x in self["config"].list: + x[1].save() + self.close() + + def keyCancel(self): + print "cancel requested" + for x in self["config"].list: + x[1].cancel() + self.close() def __init__(self, session, setup): Screen.__init__(self, session) @@ -147,7 +99,7 @@ class Setup(Screen): self["actions"] = ActionMap(["SetupActions"], { - "cancel": self.close, + "cancel": self.keyCancel, "ok": self.keyOk, "left": self.keyLeft, "right": self.keyRight,