+ config.plugins.wlan.encryption.enabled = NoSave(ConfigYesNo(default = self.wsconfig['encryption'] ))
+ config.plugins.wlan.encryption.type = NoSave(ConfigSelection(self.encryptionlist, default = self.wsconfig['encryption_type'] ))
+ config.plugins.wlan.encryption.wepkeytype = NoSave(ConfigSelection(self.weplist, default = self.wsconfig['encryption_wepkeytype'] ))
+ config.plugins.wlan.encryption.psk = NoSave(ConfigPassword(default = self.wsconfig['key'], visible_width = 50, fixed_size = False))
+
+ self.activateInterfaceEntry = NoSave(ConfigYesNo(default=iNetwork.getAdapterAttribute(self.iface, "up") or False))
+ self.dhcpConfigEntry = NoSave(ConfigYesNo(default=iNetwork.getAdapterAttribute(self.iface, "dhcp") or False))
+ self.ipConfigEntry = NoSave(ConfigIP(default=iNetwork.getAdapterAttribute(self.iface, "ip")) or [0,0,0,0])
+ self.netmaskConfigEntry = NoSave(ConfigIP(default=iNetwork.getAdapterAttribute(self.iface, "netmask") or [255,0,0,0]))
+ if iNetwork.getAdapterAttribute(self.iface, "gateway"):
+ self.dhcpdefault=True
+ else:
+ self.dhcpdefault=False
+ self.hasGatewayConfigEntry = NoSave(ConfigYesNo(default=self.dhcpdefault or False))
+ self.gatewayConfigEntry = NoSave(ConfigIP(default=iNetwork.getAdapterAttribute(self.iface, "gateway") or [0,0,0,0]))
+ nameserver = (iNetwork.getNameserverList() + [[0,0,0,0]] * 2)[0:2]
+ self.primaryDNS = NoSave(ConfigIP(default=nameserver[0]))
+ self.secondaryDNS = NoSave(ConfigIP(default=nameserver[1]))
+
+ def createSetup(self):
+ self.list = []
+ self.InterfaceEntry = getConfigListEntry(_("Use Interface"), self.activateInterfaceEntry)
+
+ self.list.append(self.InterfaceEntry)
+ if self.activateInterfaceEntry.value:
+ self.dhcpEntry = getConfigListEntry(_("Use DHCP"), self.dhcpConfigEntry)
+ self.list.append(self.dhcpEntry)
+ if not self.dhcpConfigEntry.value:
+ self.list.append(getConfigListEntry(_('IP Address'), self.ipConfigEntry))
+ self.list.append(getConfigListEntry(_('Netmask'), self.netmaskConfigEntry))
+ self.gatewayEntry = getConfigListEntry(_('Use a gateway'), self.hasGatewayConfigEntry)
+ self.list.append(self.gatewayEntry)
+ if self.hasGatewayConfigEntry.value:
+ self.list.append(getConfigListEntry(_('Gateway'), self.gatewayConfigEntry))
+
+ self.extended = None
+ for p in plugins.getPlugins(PluginDescriptor.WHERE_NETWORKSETUP):
+ callFnc = p.__call__["ifaceSupported"](self.iface)
+ if callFnc is not None:
+ if p.__call__.has_key("WlanPluginEntry"): # internally used only for WLAN Plugin
+ self.extended = callFnc
+ if p.__call__.has_key("configStrings"):
+ self.configStrings = p.__call__["configStrings"]
+ else:
+ self.configStrings = None
+ if config.plugins.wlan.essid.value == 'hidden...':
+ self.wlanSSID = getConfigListEntry(_("Network SSID"), config.plugins.wlan.essid)
+ self.list.append(self.wlanSSID)
+ self.hiddenSSID = getConfigListEntry(_("Hidden network SSID"), config.plugins.wlan.hiddenessid)
+ self.list.append(self.hiddenSSID)
+ else:
+ self.wlanSSID = getConfigListEntry(_("Network SSID"), config.plugins.wlan.essid)
+ self.list.append(self.wlanSSID)
+ self.encryptionEnabled = getConfigListEntry(_("Encryption"), config.plugins.wlan.encryption.enabled)
+ self.list.append(self.encryptionEnabled)
+
+ if config.plugins.wlan.encryption.enabled.value:
+ self.encryptionType = getConfigListEntry(_("Encryption Type"), config.plugins.wlan.encryption.type)
+ self.list.append(self.encryptionType)
+ if config.plugins.wlan.encryption.type.value == 'WEP':
+ self.list.append(getConfigListEntry(_("Encryption Keytype"), config.plugins.wlan.encryption.wepkeytype))
+ self.encryptionKey = getConfigListEntry(_("Encryption Key"), config.plugins.wlan.encryption.psk)
+ self.list.append(self.encryptionKey)
+ else:
+ self.encryptionKey = getConfigListEntry(_("Encryption Key"), config.plugins.wlan.encryption.psk)
+ self.list.append(self.encryptionKey)