+ self.applyConfigRef = None
+ self.finished_cb = None
+ self.oktext = _("Press OK on your remote control to continue.")
+ self.oldInterfaceState = iNetwork.getAdapterAttribute(self.iface, "up")
+
+ self.createConfig()
+
+ self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
+ {
+ "cancel": (self.keyCancel, _("exit network adapter configuration")),
+ "ok": (self.keySave, _("activate network adapter configuration")),
+ })
+
+ self["ColorActions"] = HelpableActionMap(self, "ColorActions",
+ {
+ "red": (self.keyCancel, _("exit network adapter configuration")),
+ "blue": (self.KeyBlue, _("open nameserver configuration")),
+ })
+
+ self["actions"] = NumberActionMap(["SetupActions"],
+ {
+ "ok": self.keySave,
+ }, -2)
+
+ self.list = []
+ ConfigListScreen.__init__(self, self.list,session = self.session)
+ self.createSetup()
+ self.onLayoutFinish.append(self.layoutFinished)
+ self.onClose.append(self.cleanup)
+
+ self["DNS1text"] = StaticText(_("Primary DNS"))
+ self["DNS2text"] = StaticText(_("Secondary DNS"))
+ self["DNS1"] = StaticText()
+ self["DNS2"] = StaticText()
+ self["introduction"] = StaticText(_("Current settings:"))
+
+ self["IPtext"] = StaticText(_("IP Address"))
+ self["Netmasktext"] = StaticText(_("Netmask"))
+ self["Gatewaytext"] = StaticText(_("Gateway"))
+
+ self["IP"] = StaticText()
+ self["Mask"] = StaticText()
+ self["Gateway"] = StaticText()
+
+ self["Adaptertext"] = StaticText(_("Network:"))
+ self["Adapter"] = StaticText()
+ self["introduction2"] = StaticText(_("Press OK to activate the settings."))
+ self["key_red"] = StaticText(_("Cancel"))
+ self["key_blue"] = StaticText(_("Edit DNS"))
+
+ self["VKeyIcon"] = Boolean(False)
+ self["HelpWindow"] = Pixmap()
+ self["HelpWindow"].hide()
+
+ def layoutFinished(self):
+ self["DNS1"].setText(self.primaryDNS.getText())
+ self["DNS2"].setText(self.secondaryDNS.getText())
+ if self.ipConfigEntry.getText() is not None:
+ if self.ipConfigEntry.getText() == "0.0.0.0":
+ self["IP"].setText(_("N/A"))
+ else:
+ self["IP"].setText(self.ipConfigEntry.getText())
+ else:
+ self["IP"].setText(_("N/A"))
+ if self.netmaskConfigEntry.getText() is not None:
+ if self.netmaskConfigEntry.getText() == "0.0.0.0":
+ self["Mask"].setText(_("N/A"))
+ else:
+ self["Mask"].setText(self.netmaskConfigEntry.getText())
+ else:
+ self["IP"].setText(_("N/A"))
+ if iNetwork.getAdapterAttribute(self.iface, "gateway"):
+ if self.gatewayConfigEntry.getText() == "0.0.0.0":
+ self["Gatewaytext"].setText(_("Gateway"))
+ self["Gateway"].setText(_("N/A"))
+ else:
+ self["Gatewaytext"].setText(_("Gateway"))
+ self["Gateway"].setText(self.gatewayConfigEntry.getText())
+ else:
+ self["Gateway"].setText("")
+ self["Gatewaytext"].setText("")
+ self["Adapter"].setText(iNetwork.getFriendlyAdapterName(self.iface))
+
+ def createConfig(self):
+ self.InterfaceEntry = None
+ self.dhcpEntry = None
+ self.gatewayEntry = None
+ self.hiddenSSID = None
+ self.wlanSSID = None
+ self.encryptionEnabled = None
+ self.encryptionKey = None
+ self.encryptionType = None
+ self.nwlist = None
+ self.encryptionlist = None
+ self.weplist = None
+ self.wsconfig = None
+ self.default = None