network setup ConfigList style
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Fri, 2 Sep 2005 04:57:47 +0000 (04:57 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Fri, 2 Sep 2005 04:57:47 +0000 (04:57 +0000)
data/menu.xml
data/setup.xml
lib/python/Components/Makefile.am
lib/python/Components/__init__.py
lib/python/Components/config.py
mytest.py

index 0fa83dba70359845a36f6361e83c17f474e0c674..c5ce8abdffec1d756ba471306417bb1c1363735d 100644 (file)
@@ -23,7 +23,7 @@
                                <item text="Keyboard">self.openSetup("keyboard")</item>
                                <item text="OSD">self.openSetup("osd")</item>
                                <item text="LCD">self.openSetup("lcd")</item>
                                <item text="Keyboard">self.openSetup("keyboard")</item>
                                <item text="OSD">self.openSetup("osd")</item>
                                <item text="LCD">self.openSetup("lcd")</item>
-                               <item text="Networksetup">self.openDialog(Network)</item>
+                               <item text="Networksetup">self.openSetup("network")</item>
                        </menu>
                        <item text="Common Interface"></item>
                        <item text="Parental Control">self.openSetup("parental")</item>
                        </menu>
                        <item text="Common Interface"></item>
                        <item text="Parental Control">self.openSetup("parental")</item>
index 183880f5dd2a27fbd28041647e3ab7d93d2af79a..18222175b7dff6b5134d17be30fef3bc49984e30 100644 (file)
@@ -15,6 +15,9 @@
                        <item text="AC3 default">config.av.defaultac3</item>
                        <item text="VCR Switch">config.av.vcrswitch</item>
                </setup>
                        <item text="AC3 default">config.av.defaultac3</item>
                        <item text="VCR Switch">config.av.vcrswitch</item>
                </setup>
+               <setup key="network" title="Networksetup">
+                       <item text="IP Address">config.network.ip</item>
+               </setup>
                <setup key="rfmod" title="UHF Modulator">
                        <item text="Modulator">config.rfmod.enable</item>
                        <item text="Testmode">config.rfmod.test</item>
                <setup key="rfmod" title="UHF Modulator">
                        <item text="Modulator">config.rfmod.enable</item>
                        <item text="Testmode">config.rfmod.test</item>
index 546d3e148ccf9d899058c11cbd0f666746a4abf1..bcecc1efa2eb403d069b84971f00ad2ecaf77e04 100644 (file)
@@ -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                                           \
        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
index a6191e04eef1307838835a95356db5037d39739b..1e47fde62da7838158d4a6d250eaf8f407c86864 100644 (file)
@@ -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",
        "ServiceName", "ServiceScan", "VariableText", "VariableValue", "VolumeBar",
        "components", "config", "TimerList", "TimeInput", "MovieList", 
        "InputDevice",  "ServicePosition", "IPAddress", "VariableIP", "IPGateway",
-       "IPNameserver" ]
+       "IPNameserver", "Network" ]
 
 
index 5a96a100366316b1cc4cd1fab8d4b5e5001cb67c..14c03655e8d702aac685ed0960c6a2420524d350 100644 (file)
@@ -77,6 +77,42 @@ class configBoolean:
        def __call__(self):                     #needed by configlist
                self.checkValues()                      
                return ("text", self.parent.vals[self.parent.value])
        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):
 
 class configValue:
        def __init__(self, obj):
index 53054d9a1d98d4a5c65cf36ecf67c76a6920d836..a3f28d7b5df6a89e979deaaa2aca2dd191b7ec57 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -175,6 +175,9 @@ Components.InputDevice.InitInputDevices()
 import Components.AVSwitch
 Components.AVSwitch.InitAVSwitch()
 
 import Components.AVSwitch
 Components.AVSwitch.InitAVSwitch()
 
+import Components.Network
+Components.Network.InitNetwork()
+
 import Components.SetupDevices
 Components.SetupDevices.InitSetupDevices()
 
 import Components.SetupDevices
 Components.SetupDevices.InitSetupDevices()