Exemplo n.º 1
0
    def input_popup(self, input_instance):
        def on_select(result_value):
            if result_value == '':
                return
            input_instance.value = result_value

        dialog = KDialog(answer_callback=on_select,
                         title=input_instance.title,
                         separator_color=SEPARATOR_COLOR).show(
                             text=TEXT_INPUT,
                             text_button_ok='OK',
                             param='text')
        dialog.input_dialog.text = input_instance.value
Exemplo n.º 2
0
    def exit_program(self, *args):
        def dismiss(*args):
            self.open_dialog = False

        def answer_callback(answer):
            if answer == core.string_lang_yes:
                sys.exit(0)
            dismiss()

        if not self.open_dialog:
            KDialog(answer_callback=answer_callback, on_dismiss=dismiss,
                    separator_color=core.separator_color,
                    title_color=get_color_from_hex(core.theme_text_black_color),
                    title=self.name_program).show(
                text=core.string_lang_exit.format(core.theme_text_black_color),
                text_button_ok=core.string_lang_yes,
                text_button_no=core.string_lang_no, param='query',
                auto_dismiss=True
            )
            self.open_dialog = True
Exemplo n.º 3
0
def events_screen(button):
    KDialog(title='Plugin').show(
        text='[color=#ffffff]Привет, [color=#2fa7d4ff]{}!'.format(
            app.started_plugins['TestPlugin']['plugin-name']))