示例#1
0
 def tno_confirm_delete ( self, node = None ):
     """ Confirms that a specified object can be deleted or not.
     """
     return (confirm( self.handler.parent,
            "Delete '%s' from the file space?\n\nNote: No files will be "
            "deleted." % self.root.name,
            'Delete File Space Root' ) == YES)
示例#2
0
 def tno_confirm_delete ( self, node = None ):
     """ Confirms that a specified object can be deleted or not:
         Result = True:  Delete object with no further prompting
                = False: Do not delete object
                = other: Take default action (may prompt user to confirm
                         delete).
     """
     return (confirm( self.handler.parent, "Delete '%s'" % self.name,
                      'Delete File' ) == YES)
示例#3
0
    def _key_set ( self, key ):
        """ Handles a keyboard event.
        """
        binding     = self.object
        key_name    = key.key_code
        cur_binding = binding.owner.key_binding_for( binding, key_name )
        if cur_binding is not None:
            if confirm( None,
                        "'%s' has already been assigned to '%s'.\n"
                        "Do you wish to continue?" % (
                        key_name, cur_binding.description ),
                        'Duplicate Key Definition' ) == NO:
                return

        self.value = key_name