From a2631286334924801423dbb88f4f2f7e3c2c3c27 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 30 Aug 2005 23:12:31 +0000 Subject: [PATCH] use menu.xml for the menu instead of an inline string --- data/Makefile.am | 2 +- data/menu.xml | 38 ++++++++++++++++++++++++++++ lib/python/Screens/Menu.py | 52 +++++++++----------------------------- 3 files changed, 51 insertions(+), 41 deletions(-) create mode 100644 data/menu.xml diff --git a/data/Makefile.am b/data/Makefile.am index 42851fa8..77904cb4 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -3,4 +3,4 @@ AUTOMAKE_OPTIONS = gnu installdir = $(DATADIR)/enigma2 install_DATA = \ - skin.xml + skin.xml menu.xml diff --git a/data/menu.xml b/data/menu.xml new file mode 100644 index 00000000..d08d0166 --- /dev/null +++ b/data/menu.xml @@ -0,0 +1,38 @@ + + quitMainloop() + self.openDialog(TimerEditList) + + + + + + + + self.openSetup("satconfig") + + + + self.openDialog(ServiceScan) + + + self.openSetup("timezone") + self.openSetup("avsetup") + self.openSetup("rfmod") + self.openDialog(HarddiskSelection) + self.openSetup("rc") + self.openSetup("keyboard") + self.openSetup("osd") + self.openSetup("lcd") + + + self.openSetup("parental") + self.openSetup("expert") + + + self.openDialog(About) + + quitMainloop() + quitMainloop() + quitMainloop() + + \ No newline at end of file diff --git a/lib/python/Screens/Menu.py b/lib/python/Screens/Menu.py index da36eb38..b773c182 100644 --- a/lib/python/Screens/Menu.py +++ b/lib/python/Screens/Menu.py @@ -36,46 +36,18 @@ def doGlobal(screen): # self.openDialog(ScartLoopThrough) # -mdom = xml.dom.minidom.parseString( - """ - - quitMainloop() - self.openDialog(TimerEditList) - - - - - - - - self.openSetup("satconfig") - - - - self.openDialog(ServiceScan) - - - self.openSetup("timezone") - self.openSetup("avsetup") - self.openSetup("rfmod") - self.openDialog(HarddiskSelection) - self.openSetup("rc") - self.openSetup("keyboard") - self.openSetup("osd") - self.openSetup("lcd") - - - self.openSetup("parental") - self.openSetup("expert") - - - self.openDialog(About) - - quitMainloop() - quitMainloop() - quitMainloop() - - """) + +# read the skin +try: + # first we search in the current path + menufile = file('data/menu.xml', 'r') +except: + # if not found in the current path, we use the global datadir-path + menufile = file('/usr/share/enigma2/menu.xml', 'r') +mdom = xml.dom.minidom.parseString(menufile.read()) +menufile.close() + + def getValbyAttr(x, attr): for p in range(x.attributes.length): -- 2.30.2