def show_dialog(self, show_pixbuf_name, info_text, ok_text=OK_TEXT, cancel_text=CANCEL_TEXT, ): self.show_pixbuf = vtk_theme.get_pixbuf(show_pixbuf_name, 50) self.info_text = info_text self.ok_button = BottomButton(ok_text, self.btn_text_size) self.ok_button.connect("clicked", self.ok_btn_clicked) self.ok_button.set_check(True) self.cancel_button = BottomButton(cancel_text, self.btn_text_size) self.cancel_button.connect("clicked", self.quit_dialog_window) container_remove_all(self.bottom_hbox) self.bottom_hbox.pack_end(self.ok_button, False, False) self.bottom_hbox.pack_end(self.cancel_button, False, False) self.second = 60 self.argv = None self.run_exec = None self.set_pango_list() if self.show_pixbuf: self.show_image.set_from_pixbuf(self.show_pixbuf) self.tick_label.set_text(self.info_text % 60) self.timer.Enabled = True self.show_all() self.ok_button.grab_focus()
def show_dialog( self, show_pixbuf_name, info_text, ok_text=OK_TEXT, cancel_text=CANCEL_TEXT, ): self.show_pixbuf = vtk_theme.get_pixbuf(show_pixbuf_name, 50) self.info_text = info_text self.ok_button = BottomButton(ok_text, self.btn_text_size) self.ok_button.connect("clicked", self.ok_btn_clicked) self.ok_button.set_check(True) self.cancel_button = BottomButton(cancel_text, self.btn_text_size) self.cancel_button.connect("clicked", self.quit_dialog_window) container_remove_all(self.bottom_hbox) self.bottom_hbox.pack_end(self.ok_button, False, False) self.bottom_hbox.pack_end(self.cancel_button, False, False) self.second = 60 self.argv = None self.run_exec = None self.set_pango_list() if self.show_pixbuf: self.show_image.set_from_pixbuf(self.show_pixbuf) self.tick_label.set_text(self.info_text % 60) self.timer.Enabled = True self.show_all() self.ok_button.grab_focus()
def __init_settings(self): self.set_bg_pixbuf(vtk_theme.get_pixbuf("deepin_on_off_bg", 372)) self.set_size_request(APP_WIDTH, APP_HEIGHT) self.set_position(gtk.WIN_POS_CENTER) self.set_skip_pager_hint(True) self.set_skip_taskbar_hint(True) self.set_keep_above(True) self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) self.connect("show", self.show_dialog_window) self.connect("focus-out-event", self.focus_out_window) self.connect("realize", self.__dialog_realize_event) self.connect("key-release-event", self.__dialog_key_release_event)
def __init__(self): Window.__init__(self) self.show_pixbuf = vtk_theme.get_pixbuf("deepin_shutdown", 50) self.cancel_text = CANCEL_TEXT self.btn_text_size = 11 self.btn_text_color = "#b9b9b9" self.draw_rectangle_bool = False self.timer = Timer(1000) self.second = 60 self.timer.Enabled = False self.timer.connect("Tick", self.timer_tick_evnet) self.run_exec = None self.argv = None self.set_pango_list() self.ok_key_check = False self.cancel_key_check = False self.__init_widgets() self.__init_settings()
def show_warning( self, info_text, ok_text=OK_TEXT, cancel_text=CANCEL_TEXT, ok_button_first=False, ): self.show_pixbuf = vtk_theme.get_pixbuf("deepin_warning", 50) self.info_text = info_text container_remove_all(self.bottom_hbox) self.ok_button = BottomButton(ok_text, self.btn_text_size) self.ok_button.connect("clicked", self.ok_btn_clicked) self.cancel_button = BottomButton(cancel_text, self.btn_text_size) self.cancel_button.connect("clicked", self.quit_dialog_window) self.cancel_button.set_check(True) if ok_button_first: self.bottom_hbox.pack_end(self.ok_button, False, False) self.bottom_hbox.pack_end(self.cancel_button, False, False) else: self.bottom_hbox.pack_end(self.cancel_button, False, False) self.bottom_hbox.pack_end(self.ok_button, False, False) self.argv = None self.run_exec = None self.set_pango_list() if self.show_pixbuf: self.show_image.set_from_pixbuf(self.show_pixbuf) self.tick_label.set_text(info_text) self.timer.Enabled = False self.show_all() self.cancel_button.grab_focus()
def show_warning(self, info_text, ok_text=OK_TEXT, cancel_text=CANCEL_TEXT, ok_button_first=False, ): self.show_pixbuf = vtk_theme.get_pixbuf("deepin_warning", 50) self.info_text = info_text container_remove_all(self.bottom_hbox) self.ok_button = BottomButton(ok_text, self.btn_text_size) self.ok_button.connect("clicked", self.ok_btn_clicked) self.cancel_button = BottomButton(cancel_text, self.btn_text_size) self.cancel_button.connect("clicked", self.quit_dialog_window) self.cancel_button.set_check(True) if ok_button_first: self.bottom_hbox.pack_end(self.ok_button, False, False) self.bottom_hbox.pack_end(self.cancel_button, False, False) else: self.bottom_hbox.pack_end(self.cancel_button, False, False) self.bottom_hbox.pack_end(self.ok_button, False, False) self.argv = None self.run_exec = None self.set_pango_list() if self.show_pixbuf: self.show_image.set_from_pixbuf(self.show_pixbuf) self.tick_label.set_text(info_text) self.timer.Enabled = False self.show_all() self.cancel_button.grab_focus()