def show_license(progress, on_language): text_license = open("LICENSE/GNU_LICENSE_{}.rst".format( core.dict_language[on_language])).read() message = KDialog(underline_color="a6b4bcff", base_font_size=self.window_text_size, background_image=core.theme_decorator_window) message.show(title="GNU_LICENSE:", text=text_license, rst=True, size_rst=(.9, .7)) progress.body.dismiss()
def create_window(self, text, title=core.string_lang_title, button_ok=None, button_no=None, button_cancel=None, background=core.theme_decorator_window, param="info", callback=p, dismiss=False, size_x=CONST_SCREEN, font_size=window_text_size, password=False): window = KDialog(answer_callback=callback, base_font_size=font_size, background_image=background, size_hint_x=size_x) window.show(title=title, image="Data/Images/loading.gif", text=text, param=param, auto_dismiss=dismiss, text_button_ok=button_ok, text_button_no=button_no, text_button_cancel=button_cancel, password=password) return window
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
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
def events_screen(button): KDialog(title='Plugin').show( text='[color=#ffffff]Привет, [color=#2fa7d4ff]{}!'.format( app.started_plugins['TestPlugin']['plugin-name']))