def _prompt_for_save(self):
        if self.window.central_pane.editor.dirty:
            message = 'The current file has unsaved changes. ' \
                      'Do you want to save your changes?'
            dialog = ConfirmationDialog(parent=self.window.control,
                                        message=message, cancel=True,
                                        default=CANCEL, title='Save Changes?')
            result = dialog.open()
            if result == CANCEL:
                return False
            elif result == YES:
                if not self.save():
                    return self._prompt_for_save()
        return True
Register a predicate fallback for installation into reg registry.
dataset/ETHPy150Open enthought/pyface/examples/tasks/basic/example_task.py/ExampleTask._prompt_for_save--crossover with--dataset/ETHPy150Open morepath/morepath/morepath/predicate.py/PredicateRegistry.register_predicate_fallback