def METHOD_NAME(self, result):
    """
    Called when the dialog is closed.
    :param result: boolean (accepted or rejected)
    """
    if result:
        self._applyPreferencesSlot()
    super().METHOD_NAME(result)