From 7e3e90678897a0924cd365e117fd71679032dc40 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Fri, 2 Sep 2005 04:57:47 +0000 Subject: [PATCH] network setup ConfigList style --- data/menu.xml | 2 +- data/setup.xml | 3 +++ lib/python/Components/Makefile.am | 2 +- lib/python/Components/__init__.py | 2 +- lib/python/Components/config.py | 36 +++++++++++++++++++++++++++++++ mytest.py | 3 +++ 6 files changed, 45 insertions(+), 3 deletions(-) diff --git a/data/menu.xml b/data/menu.xml index 0fa83dba..c5ce8abd 100644 --- a/data/menu.xml +++ b/data/menu.xml @@ -23,7 +23,7 @@ self.openSetup("keyboard") self.openSetup("osd") self.openSetup("lcd") - self.openDialog(Network) + self.openSetup("network") self.openSetup("parental") diff --git a/data/setup.xml b/data/setup.xml index 183880f5..18222175 100644 --- a/data/setup.xml +++ b/data/setup.xml @@ -15,6 +15,9 @@ config.av.defaultac3 config.av.vcrswitch + + config.network.ip + config.rfmod.enable config.rfmod.test diff --git a/lib/python/Components/Makefile.am b/lib/python/Components/Makefile.am index 546d3e14..bcecc1ef 100644 --- a/lib/python/Components/Makefile.am +++ b/lib/python/Components/Makefile.am @@ -8,4 +8,4 @@ install_DATA = \ EventInfo.py Label.py ServiceScan.py VolumeBar.py \ GUIComponent.py MenuList.py TextInput.py __init__.py MovieList.py \ InputDevice.py ServicePosition.py SetupDevices.py Harddisk.py \ - AVSwitch.py VariableIP.py IPAddress.py IPNameserver.py IPGateway.py + AVSwitch.py VariableIP.py IPAddress.py IPNameserver.py IPGateway.py Network.py diff --git a/lib/python/Components/__init__.py b/lib/python/Components/__init__.py index a6191e04..1e47fde6 100644 --- a/lib/python/Components/__init__.py +++ b/lib/python/Components/__init__.py @@ -5,5 +5,5 @@ __all__ = ["ActionMap", "Button", "Clock", "ConfigList", "EventInfo", "ServiceName", "ServiceScan", "VariableText", "VariableValue", "VolumeBar", "components", "config", "TimerList", "TimeInput", "MovieList", "InputDevice", "ServicePosition", "IPAddress", "VariableIP", "IPGateway", - "IPNameserver" ] + "IPNameserver", "Network" ] diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index 5a96a100..14c03655 100644 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -77,6 +77,42 @@ class configBoolean: def __call__(self): #needed by configlist self.checkValues() return ("text", self.parent.vals[self.parent.value]) + +class configSequence: + def __init__(self, parent): + self.parent = parent + + def checkValues(self): + pass +# if self.parent.value < 0: +# self.parent.value = 0 +# +# if(self.parent.value >= (len(self.parent.vals) - 1)): +# self.parent.value = len(self.parent.vals) - 1 +# + def cancel(self): + self.parent.reload() + + def save(self): + self.parent.save() + + def handleKey(self, key): + if key == config.prevElement: + self.parent.value = self.parent.value - 1 + if key == config.nextElement: + self.parent.value = self.parent.value + 1 + + self.checkValues() + + self.parent.change() + + def __call__(self): #needed by configlist + value = "" + for i in self.parent.value: + if (value != ""): + value += self.parent.vals[0] + value += str(i) + return ("text", value) class configValue: def __init__(self, obj): diff --git a/mytest.py b/mytest.py index 53054d9a..a3f28d7b 100644 --- a/mytest.py +++ b/mytest.py @@ -175,6 +175,9 @@ Components.InputDevice.InitInputDevices() import Components.AVSwitch Components.AVSwitch.InitAVSwitch() +import Components.Network +Components.Network.InitNetwork() + import Components.SetupDevices Components.SetupDevices.InitSetupDevices() -- 2.30.2