def _on_finished(self, result):
        accept = bool(result)

        if accept:
            self._apply_context(self.ui.context, self.ui._context)
        else:
            self._apply_context(self.ui._revert, self.ui._context)

        self.close(accept)
Handles the user finishing with the dialog.
dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/ui_modal.py/_ModalDialog._on_finished