diff options
| author | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-10-11 00:04:14 +0000 |
|---|---|---|
| committer | Stefan Pluecken <stefan.pluecken@multimedia-labs.de> | 2005-10-11 00:04:14 +0000 |
| commit | 495f6c0ff7a37c224319af9f07a3e39fa5e804e1 (patch) | |
| tree | ed776188ecab23d7a0f08f2c3fafc0007ea93738 | |
| parent | 4ec4e352738fdb205ab54f61045f36b6df4d58bc (diff) | |
| download | enigma2-495f6c0ff7a37c224319af9f07a3e39fa5e804e1.tar.gz enigma2-495f6c0ff7a37c224319af9f07a3e39fa5e804e1.zip | |
move network setup into a dynamic configlist
| -rw-r--r-- | data/menu.xml | 2 | ||||
| -rw-r--r-- | data/skin.xml | 3 | ||||
| -rw-r--r-- | lib/python/Screens/Makefile.am | 2 | ||||
| -rw-r--r-- | lib/python/Screens/NetworkSetup.py | 57 |
4 files changed, 62 insertions, 2 deletions
diff --git a/data/menu.xml b/data/menu.xml index 009a20da..ca07d84e 100644 --- a/data/menu.xml +++ b/data/menu.xml @@ -45,7 +45,7 @@ <item text="Keyboard"><setup id="keyboard" /></item> <item text="OSD"><setup id="osd" /></item> <item text="LCD"><setup id="lcd" /></item> - <item text="Networksetup"><setup id="network" /></item> + <item text="Networksetup"><screen module="NetworkSetup" screen="NetworkSetup" /></item> </menu> <item text="Common Interface"></item> <item text="Parental Control"><setup id="parental" /></item> diff --git a/data/skin.xml b/data/skin.xml index 8038b336..bf77ed85 100644 --- a/data/skin.xml +++ b/data/skin.xml @@ -64,6 +64,9 @@ <screen name="ScanSetup" position="100,100" size="500,350" title="Service scan"> <widget name="config" position="20,10" size="460,220" /> </screen> + <screen name="NetworkSetup" position="140,125" size="460,280" title="Network Setup"> + <widget name="config" position="10,50" size="420,175" /> + </screen> <screen name="PluginBrowser" position="190,125" size="360,250" title="Plugins"> <widget name="title" position="10,10" size="280,35" font="Arial;23" /> <widget name="pluginlist" position="10,50" size="320,200" /> diff --git a/lib/python/Screens/Makefile.am b/lib/python/Screens/Makefile.am index 3fc7b3d6..462c7943 100644 --- a/lib/python/Screens/Makefile.am +++ b/lib/python/Screens/Makefile.am @@ -4,4 +4,4 @@ install_PYTHON = \ ChannelSelection.py ClockDisplay.py ConfigMenu.py InfoBar.py Menu.py \ MessageBox.py ScartLoopThrough.py Screen.py ServiceScan.py TimerEdit.py \ MovieSelection.py Setup.py About.py HarddiskSetup.py FixedMenu.py \ - Satconfig.py ScanSetup.py __init__.py + Satconfig.py ScanSetup.py NetworkSetup.py __init__.py diff --git a/lib/python/Screens/NetworkSetup.py b/lib/python/Screens/NetworkSetup.py new file mode 100644 index 00000000..54330581 --- /dev/null +++ b/lib/python/Screens/NetworkSetup.py @@ -0,0 +1,57 @@ +from Screen import Screen +from Components.ActionMap import ActionMap +from Components.ConfigList import ConfigList +from Components.config import config +from Components.config import getConfigListEntry + +class NetworkSetup(Screen): + def __init__(self, session): + Screen.__init__(self, session) + + self["actions"] = ActionMap(["SetupActions"], + { + "ok": self.keySave, + "cancel": self.keyCancel, + "left": self.keyLeft, + "right": self.keyRight + }, -1) + + self.list = [] + self["config"] = ConfigList(self.list) + self.createSetup() + + def createSetup(self): + self.list = [] + + self.list.append(getConfigListEntry("Use DHCP", config.network.dhcp)) + if (config.network.dhcp.value == 0): + self.list.append(getConfigListEntry("IP Address", config.network.ip)) + self.list.append(getConfigListEntry("Netmask", config.network.netmask)) + self.list.append(getConfigListEntry("Gateway", config.network.gateway)) + self.list.append(getConfigListEntry("Nameserver", config.network.dns)) + + self["config"].list = self.list + self["config"].l.setList(self.list) + + def newConfig(self): + print self["config"].getCurrent() + if self["config"].getCurrent()[0] == "Use DHCP": + self.createSetup() + + def keyLeft(self): + self["config"].handleKey(config.key["prevElement"]) + self.newConfig() + + def keyRight(self): + self["config"].handleKey(config.key["nextElement"]) + self.newConfig() + + def keySave(self): + for x in self["config"].list: + x[1].save() + self.close() + + def keyCancel(self): + for x in self["config"].list: + x[1].cancel() + self.close()
\ No newline at end of file |
