- 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 __init__(self, session):
+ Screen.__init__(self, session)
+
+ self["actions"] = NumberActionMap(["SetupActions"],
+ {
+ "ok": self.keySave,
+ "cancel": self.keyCancel,
+ "left": self.keyLeft,
+ "right": self.keyRight,
+ "1": self.keyNumberGlobal,
+ "2": self.keyNumberGlobal,
+ "3": self.keyNumberGlobal,
+ "4": self.keyNumberGlobal,
+ "5": self.keyNumberGlobal,
+ "6": self.keyNumberGlobal,
+ "7": self.keyNumberGlobal,
+ "8": self.keyNumberGlobal,
+ "9": self.keyNumberGlobal,
+ "0": self.keyNumberGlobal
+ }, -1)