code: def accept(self):
          
          try:
              self.save_metadata()
          except InvalidValidationException as e:
              display_warning_message_box(
                  self, tr('Invalid Field Mapping'), str(e))
              return
          super(FieldMappingDialog, self).accept()
docs: Method invoked when OK button is clicked.