code: def closeEvent(self, event):
          
          logger.debug("closeEvent")
          self.argosApplication.saveSettingsIfNeeded()
          self.finalize()
          self.argosApplication.removeMainWindow(self)
          event.accept()
          logger.debug("closeEvent accepted")
docs: Called when closing this window.