code: def accept(self):
          
  
          self.save_state()
          self.dock.show_busy()
  
          # The order of the components are matter.
          components = self.prepare_components()
          error_code, message = self.impact_function.generate_report(
              components, iface=self.iface)
  
          if error_code == ImpactReport.REPORT_GENERATION_FAILED:
              self.dock.hide_busy()
              LOGGER.info(tr(
                  'The impact report could not be generated.'))
              send_error_message(self, message)
              LOGGER.info(message.to_text())
              return ANALYSIS_FAILED_BAD_CODE, message
  
          sender_name = self.sender().objectName()
  
          try:
              if sender_name == 'button_print_pdf':
                  self.create_pdf = True
                  self.open_as_pdf()
              else:
                  self.create_pdf = False
                  self.open_in_composer()
              self.dock.hide_busy()
          except Exception:
              self.dock.hide_busy()
  
          QtWidgets.QDialog.accept(self)
docs: Method invoked when OK button is clicked.