Logo Search packages:      
Sourcecode: samba-gtk version File versions  Download package

def sambagtk::main::SambaUtilities::run_connect_all_dialog (   self )
Runs the connection dialog and saves connection arguments to self.connection_args

returns True if arguments were uptained successfully

Definition at line 232 of file main.py.

                                    :
        """Runs the connection dialog and saves connection arguments to self.connection_args
        
        returns True if arguments were uptained successfully"""
        #TODO in this function: handle domain selection
        args = {}
        #args and their default values
        important_args = {"server":"", "username":"", "transport_type":0, }
        for item in important_args.keys():
                args.update(self.connection_args.has_key(item) and {item:self.connection_args[item]} or {item:important_args[item]})
        
        dialog = SAMConnectDialog(**args)
        dialog.show_all()
        
        # loop to handle the failures
        while True:
            response_id = dialog.run()
            
            if (response_id != gtk.RESPONSE_OK):
                dialog.hide()
                return False
            else:
                server = dialog.get_server_address()
                username = dialog.get_username()
                if server != "" and username != "":
                    self.connection_args.update({"server":server})
                    self.connection_args.update({"username":username})
                    self.connection_args.update({"transport_type":dialog.get_transport_type()})
                    self.connection_args.update({"password":dialog.get_password()})
                    self.connection_args.update({"connect_now":True})
                    self.additional_connection_args.update({"domain_index":0}) #TODO: get domain index
                    break
                else:
                    self.run_message_dialog(gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, "You must enter a server address and username.")
                    
        
        dialog.hide()
        return True
        

Generated by  Doxygen 1.6.0   Back to index