Logo Search packages:      
Sourcecode: wicd version File versions

def wicd::gui::appGui::save_settings (   self,
  nettype,
  networkid,
  networkentry 
)

Verifies and saves the settings for the network entry. 

Definition at line 1785 of file gui.py.

01785                                                              :
        """ Verifies and saves the settings for the network entry. """
        entry = networkentry.advanced_dialog
        entlist = []
        
        # First make sure all the Addresses entered are valid.
        if entry.chkbox_static_ip.get_active():
            entlist = [ent for ent in [entry.txt_ip, entry.txt_netmask,
                                     entry.txt_gateway]]
                
        if entry.chkbox_static_dns.get_active() and \
           not entry.chkbox_global_dns.get_active():
            entlist.append(entry.txt_dns_1)
            # Only append additional dns entries if they're entered.
            for ent in [entry.txt_dns_2, entry.txt_dns_3]:
                if ent.get_text() != "":
                    entlist.append(ent)
                    
        for lblent in entlist:
            if not misc.IsValidIP(lblent.get_text()):
                error(self.window, language['invalid_address'].
                                    replace('$A', lblent.label.get_label()))
                return False

        # Now save the settings.
        if nettype == "wireless":
            if not self.save_wireless_settings(networkid, entry, networkentry):
                return False

        elif nettype == "wired":
            if not self.save_wired_settings(entry):
                return False
            
        return True
    
    def save_wired_settings(self, entry):


Generated by  Doxygen 1.6.0   Back to index