<filename>kivy_garden/ebs/cefkivy/mixins/dialogs.py


class DialogMixin(object):
    def __init__(self, dialog_target=None, text_font_params=None):
        self._dialog_target = dialog_target
        self._current_dialog = None
        self._dialog_text_font_params = text_font_params or {}

    @property
    def dialog_target(self):
        return self._dialog_target

    @dialog_target.setter
    def dialog_target(self, value):
        self._dialog_target = value

    def dialog_finish(self, dialog):
        self.dialog_target.remove_widget(self._current_dialog)
        self.disabled = False
        self.opacity = 1
        self._current_dialog = None

    def dialog_show(self, dialog):

        if not self.dialog_target:
            print("WARNING: Dialog Target not Specified. Auto Accepting!")
            dialog.skip()
            return

        if self._current_dialog:
            dialog.cancel()
            return

        self._current_dialog = dialog.build(self._dialog_text_font_params)
        dialog.when_done = self.dialog_finish
        self.opacity = 0.3
        self.disabled = True
        self.dialog_target.add_widget(self._current_dialog)

<filename>kivy_garden/ebs/cefkivy/mixins/dialogs.py


class DialogMixin(object):
    def __init__(self, dialog_target=None, text_font_params=None):
        self._dialog_target = dialog_target
        self._current_dialog = None
        self._dialog_text_font_params = text_font_params or {}

    @property
    def dialog_target(self):
        return self._dialog_target

    @dialog_target.setter
    def dialog_target(self, value):
        self._dialog_target = value

    def dialog_finish(self, dialog):
        self.dialog_target.remove_widget(self._current_dialog)
        self.disabled = False
        self.opacity = 1
        self._current_dialog = None

    def dialog_show(self, dialog):

        if not self.dialog_target:
            print("WARNING: Dialog Target not Specified. Auto Accepting!")
            dialog.skip()
            return

        if self._current_dialog:
            dialog.cancel()
            return

        self._current_dialog = dialog.build(self._dialog_text_font_params)
        dialog.when_done = self.dialog_finish
        self.opacity = 0.3
        self.disabled = True
        self.dialog_target.add_widget(self._current_dialog)
