- iNetwork.setAdapterAttribute(self.iface, "up", self.activateInterfaceEntry.value)
- iNetwork.setAdapterAttribute(self.iface, "dhcp", self.dhcpConfigEntry.value)
- iNetwork.setAdapterAttribute(self.iface, "ip", self.ipConfigEntry.value)
- iNetwork.setAdapterAttribute(self.iface, "netmask", self.netmaskConfigEntry.value)
- if self.hasGatewayConfigEntry.value:
- iNetwork.setAdapterAttribute(self.iface, "gateway", self.gatewayConfigEntry.value)
+ current = self["config"].getCurrent()
+ if current == self.hiddenSSID and config.plugins.wlan.essid.value == 'hidden...':
+ if current[1].help_window.instance is not None:
+ current[1].help_window.instance.hide()
+ elif current == self.encryptionKey and config.plugins.wlan.encryption.enabled.value:
+ if current[1].help_window.instance is not None:
+ current[1].help_window.instance.hide()
+ self.session.openWithCallback(self.applyConfig, MessageBox, (_("Are you sure you want to activate this network configuration?\n\n") + self.oktext ) )
+
+ def applyConfig(self, ret = False):
+ if (ret == True):
+ iNetwork.setAdapterAttribute(self.iface, "up", self.activateInterfaceEntry.value)
+ iNetwork.setAdapterAttribute(self.iface, "dhcp", self.dhcpConfigEntry.value)
+ iNetwork.setAdapterAttribute(self.iface, "ip", self.ipConfigEntry.value)
+ iNetwork.setAdapterAttribute(self.iface, "netmask", self.netmaskConfigEntry.value)
+ if self.hasGatewayConfigEntry.value:
+ iNetwork.setAdapterAttribute(self.iface, "gateway", self.gatewayConfigEntry.value)
+ else:
+ iNetwork.removeAdapterAttribute(self.iface, "gateway")
+ if self.extended is not None and self.configStrings is not None:
+ iNetwork.setAdapterAttribute(self.iface, "configStrings", self.configStrings(self.iface))
+ self.ws.writeConfig()
+ if self.activateInterfaceEntry.value is False:
+ iNetwork.deactivateInterface(self.iface)
+ iNetwork.writeNetworkConfig()
+ iNetwork.restartNetwork(self.applyConfigDataAvail)
+ self.applyConfigRef = self.session.openWithCallback(self.applyConfigfinishedCB, MessageBox, _("Please wait while activating your network configuration..."), type = MessageBox.TYPE_INFO, enable_input = False)