当前位置: 首页>>代码示例>>Python>>正文


Python dialog.DialogBox类代码示例

本文整理汇总了Python中dtk.ui.dialog.DialogBox的典型用法代码示例。如果您正苦于以下问题:Python DialogBox类的具体用法?Python DialogBox怎么用?Python DialogBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DialogBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, message, default_width=300, default_height=140, is_succeed=True):
        DialogBox.__init__(self, "", default_width, default_height, self.DIALOG_MASK_SINGLE_PAGE)

        self.hbox = gtk.HBox()
        self.image_align = gtk.Alignment()
        self.image_align.set(0, 0, 0, 0)
        self.image_align.set_padding(0, 0, 20, 0)
        self.image_box = ImageBox(app_theme.get_pixbuf("bluetooth/succeed.png"))
        if not is_succeed:
            self.image_box = ImageBox(app_theme.get_pixbuf("bluetooth/failed.png"))
        self.image_align.add(self.image_box)
        self.message_align = gtk.Alignment()
        self.message_align.set(0, 0, 0, 0)
        self.message_align.set_padding(20, 0, 10, 0)
        if not is_succeed:
            self.message_align.set_padding(0, 0, 10, 0)
        self.message_label = Label(message, wrap_width = 200)
        self.message_align.add(self.message_label)
        self.hbox.pack_start(self.image_align)
        self.hbox.pack_start(self.message_align)
        self.confirm_align = gtk.Alignment()
        self.confirm_align.set(0, 0, 0, 0)
        self.confirm_align.set_padding(20, 0, 200, 0)
        self.confirm_button = Button(_("Ok"))
        self.confirm_button.set_size_request(70, WIDGET_HEIGHT)
        self.confirm_button.connect("clicked", lambda widget : self.destroy())
        self.confirm_align.add(self.confirm_button)

        self.body_box.pack_start(self.hbox, False, False)
        self.body_box.pack_start(self.confirm_align, False, False)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:30,代码来源:bluetooth_dialog.py

示例2: __init__

 def __init__(self):
     DialogBox.__init__(self, _("Search"), 460, 300, DIALOG_MASK_SINGLE_PAGE,
                        modal=False, window_hint=None, close_callback=self.hide_all)
     title_label = Label(_("Title:"))
     self.title_entry = TextEntry("")
     self.title_entry.set_size(300, 25)
     self.search_button = Button(_("Search"))
     self.search_button.connect("clicked", self.search_song)
     
     control_box = gtk.HBox(spacing=5)
     control_box.pack_start(title_label, False, False)
     control_box.pack_start(self.title_entry, False, False)
     control_box.pack_start(self.search_button, False, False)
     
     scrolled_window = ScrolledWindow(0, 0)
     scrolled_window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
     self.result_view = ListView()
     self.result_view.connect("double-click-item", self.double_click_cb)
     self.result_view.draw_mask = self.get_mask_func(self.result_view)
     self.result_view.add_titles([_("Title"), _("Artist"), _("Album"), _("Type"), _("Size")])
     scrolled_window.add_child(self.result_view)
     
     self.prompt_label = Label("")
     download_button = Button(_("Download"))
     download_button.connect("clicked", self.download_song)
     cancel_button = Button(_("Close"))
     cancel_button.connect("clicked", lambda w: self.hide_all())
     
     self.body_box.set_spacing(5)
     self.body_box.pack_start(control_box, False, False)
     self.body_box.pack_start(scrolled_window, True, True)
     self.left_button_box.set_buttons([self.prompt_label])
     self.right_button_box.set_buttons([download_button, cancel_button])
开发者ID:andy071001,项目名称:deepin-music-player,代码行数:33,代码来源:song_search.py

示例3: __init__

 def __init__(self):
     DialogBox.__init__(self, _("Task Manager"), 350, 450, DIALOG_MASK_SINGLE_PAGE,
                        modal=False, close_callback=self.hide_all)
     
     self.is_changed = False
     scrolled_window = ScrolledWindow(0, 0)
     scrolled_window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
     
     scrolled_align = gtk.Alignment()
     scrolled_align.set(1, 1, 1, 1)
     scrolled_align.set_padding(10, 0, 0, 0)
     scrolled_align.add(scrolled_window)
     
     self.jobs_view = JobsView()
     self.jobs_view.draw_mask = self.get_mask_func(self.jobs_view)
     scrolled_window.add_child(self.jobs_view)
     
     pause_button = Button(_("Pause"))
     pause_button.connect("clicked", self.pause_job)
     stop_button = Button(_("Close"))
     stop_button.connect("clicked", lambda w: self.hide_all())
     
     self.body_box.add(scrolled_align)
     self.right_button_box.set_buttons([pause_button, stop_button])
     
     Dispatcher.connect("transfor-job", self.add_new_job)
开发者ID:electricface,项目名称:deepin-music-player,代码行数:26,代码来源:converter.py

示例4: __init__

    def __init__(self, confirm_callback=None):
        DialogBox.__init__(self, 
                           title=_("Close"),
                           default_width=360,
                           default_height=145,
                           mask_type=DIALOG_MASK_SINGLE_PAGE,
                           )
        
        self.confirm_callback = confirm_callback
        radio_group = gtk.HBox(spacing=50)
        self.minimize_radio = RadioButton(_("Minimize to tray"))
        self.minimize_radio.set_active(True)
        self.quit_radio = RadioButton(_("Quit"))
        
        radio_group.pack_start(self.minimize_radio, False, True)
        radio_group.pack_start(self.quit_radio, False, True)
        self.remembar_button = CheckButton(_("Don't prompt again"))
        self.remembar_button.set_active(True)
        
        radio_group_align = gtk.Alignment()
        radio_group_align.set_padding(30, 0, 10, 0)
        radio_group_align.add(radio_group)
                
        confirm_button = Button(_("OK"))
        confirm_button.connect("clicked", self.on_confirm_button_clicked)

        cancel_button = Button(_("Cancel"))
        cancel_button.connect("clicked", self.on_cancel_button_clicked)        
        
        # Connect widgets.
        self.body_box.pack_start(radio_group_align, False, True)
        self.left_button_box.set_buttons([self.remembar_button,])
        self.right_button_box.set_buttons([confirm_button, cancel_button])
开发者ID:maskegger,项目名称:deepin-music-player,代码行数:33,代码来源:ui.py

示例5: __init__

 def __init__(self):
     DialogBox.__init__(
         self, _("Lyrics search"), 460, 300, DIALOG_MASK_MULTIPLE_PAGE, close_callback=self.hide_all, 
         modal=False, window_hint=None, skip_taskbar_hint=False, window_pos=gtk.WIN_POS_CENTER)
     
     self.artist_entry = InputEntry()
     self.artist_entry.set_size(130, 23)
     self.title_entry = InputEntry()
     self.title_entry.set_size(130, 23)
     artist_label = Label(_("Artist:"))
     title_label = Label(_("Title:"))
     right_align = gtk.Alignment()
     right_align.set(0, 0, 0, 1)
     
     self.search_button = Button(_("Search"))
     self.search_button.connect("clicked", self.search_lyric_cb)
     self.process_id = 0
     
     info_box = gtk.HBox(spacing=25)
     
     control_box = gtk.HBox(spacing=5)
     title_box = gtk.HBox(spacing=5)        
     title_box.pack_start(title_label, False, False)
     title_box.pack_start(self.title_entry)
     artist_box = gtk.HBox(spacing=5)
     artist_box.pack_start(artist_label, False, False)
     artist_box.pack_start(self.artist_entry)
     control_box.pack_start(title_box, False, False)
     control_box.pack_start(artist_box, False, False)
     
     info_box.pack_start(control_box, False, False)
     info_box.pack_start(self.search_button, False, False)
     
     sort_items = [ lambda items, reverse : self.sort_by_key(items, reverse, "title"),
                    lambda items, reverse : self.sort_by_key(items, reverse, "artist")]
     self.result_view = TreeView()
     self.result_view.set_expand_column(0)
     self.result_view.connect("double-click-item", self.double_click_cb)
     self.result_view.set_column_titles([_("Title"), _("Artist")], sort_items)
     self.result_view.draw_mask = self.draw_view_mask
     
     self.prompt_label = Label("")
     download_button = Button(_("Download"))
     download_button.connect("clicked", self.download_lyric_cb)
     cancel_button = Button(_("Close"))
     cancel_button.connect("clicked", lambda w: self.hide_all())
     
     info_box_align = gtk.Alignment()
     info_box_align.set_padding(5, 0, 5, 0)
     info_box_align.add(info_box)
     
     self.body_box.set_spacing(5)
     self.body_box.pack_start(info_box_align, False, False)
     self.body_box.pack_start(self.result_view, True, True)
     self.left_button_box.set_buttons([self.prompt_label])
     self.right_button_box.set_buttons([download_button, cancel_button])
     self.lrc_manager = LrcManager()
开发者ID:electricface,项目名称:deepin-music-player,代码行数:57,代码来源:lyrics_search.py

示例6: __init__

 def __init__(self):
     DialogBox.__init__(
         self, _("Lyrics search"), 460, 300, DIALOG_MASK_MULTIPLE_PAGE, close_callback=self.hide_all, 
         modal=False, window_hint=None, skip_taskbar_hint=False)
     self.artist_entry = InputEntry()
     self.artist_entry.set_size(130, 23)
     self.title_entry = InputEntry()
     self.title_entry.set_size(130, 23)
     artist_label = Label(_("Artist:"))
     title_label = Label(_("Title:"))
     right_align = gtk.Alignment()
     right_align.set(0, 0, 0, 1)
     
     search_button = Button(_("Search"))
     search_button.connect("clicked", self.search_lyric_cb)
     
     info_box = gtk.HBox(spacing=25)
     
     control_box = gtk.HBox(spacing=5)
     title_box = gtk.HBox(spacing=5)        
     title_box.pack_start(title_label, False, False)
     title_box.pack_start(self.title_entry)
     artist_box = gtk.HBox(spacing=5)
     artist_box.pack_start(artist_label, False, False)
     artist_box.pack_start(self.artist_entry)
     control_box.pack_start(title_box, False, False)
     control_box.pack_start(artist_box, False, False)
     
     info_box.pack_start(control_box, False, False)
     info_box.pack_start(search_button, False, False)
     
     scrolled_window = ScrolledWindow(0, 0)
     scrolled_window.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
     sort_items = [(lambda item: item.title, cmp), (lambda item: item.artist, cmp)]
     self.result_view = ListView(sort_items)
     self.result_view.connect("double-click-item", self.double_click_cb)
     self.result_view.add_titles([_("Title"), _("Artist")])
     self.result_view.draw_mask = self.get_mask_func(self.result_view)
     scrolled_window.add_child(self.result_view)
     
     self.prompt_label = Label("")
     download_button = Button(_("Download"))
     download_button.connect("clicked", self.download_lyric_cb)
     cancel_button = Button(_("Close"))
     cancel_button.connect("clicked", lambda w: self.hide_all())
     
     info_box_align = gtk.Alignment()
     info_box_align.set_padding(5, 0, 5, 0)
     info_box_align.add(info_box)
     
     self.body_box.set_spacing(5)
     self.body_box.pack_start(info_box_align, False, False)
     self.body_box.pack_start(scrolled_window, True, True)
     self.left_button_box.set_buttons([self.prompt_label])
     self.right_button_box.set_buttons([download_button, cancel_button])
     self.lrc_manager = LrcManager()
开发者ID:andy071001,项目名称:deepin-music-player,代码行数:56,代码来源:lyrics_search.py

示例7: __init__

 def __init__(self):
     DialogBox.__init__(self, "MV", 980, 600, DIALOG_MASK_MULTIPLE_PAGE, 
                        close_callback=self.hide_all, modal=False,
                        window_hint=None, skip_taskbar_hint=False,
                        window_pos=gtk.WIN_POS_CENTER)
     
     self.url = "http://musicmini.baidu.com/app/mv/playMV.html"
     self.webview = BaseWebView("", enable_plugins=False)
     webview_align = gtk.Alignment()
     webview_align.set(1, 1, 1, 1)
     webview_align.set_padding(0, 0, 0, 2)
     webview_align.add(self.webview)
     self.body_box.pack_start(webview_align, False, True)
开发者ID:binyuj,项目名称:dmusic-plugin-baidumusic,代码行数:13,代码来源:music_browser.py

示例8: __init__

 def __init__(self):
     DialogBox.__init__(self, 
                        _("Task Manager for format conversion"), 
                        FORM_WIDTH, FORM_HEIGHT, 
                        mask_type=DIALOG_MASK_SINGLE_PAGE, #DIALOG_MASK_MULTIPLE_PAGE,
                        close_callback=self.hide_all,
                        modal=True,
                        window_hint=gtk.gdk.WINDOW_TYPE_HINT_DIALOG,
                        window_pos=gtk.WIN_POS_CENTER,
                        resizable=False,
                        )
     self.init_widgets()
     # add widgets.
     self.body_box.pack_start(self.scrolled_window, False, False)
开发者ID:Bruners,项目名称:deepin-media-player,代码行数:14,代码来源:conv_task_gui.py

示例9: __init__

    def __init__(self):
        DialogBox.__init__(self, "登录", 700, 700, DIALOG_MASK_MULTIPLE_PAGE,
                close_callback=self.hide_all, modal=False,
                window_hint=None, skip_taskbar_hint=False,
                window_pos=gtk.WIN_POS_CENTER)

        #self.set_keep_above(True)
        #self.is_reload_flag = False
        self.webview = BaseWebView("")
        webview_align = gtk.Alignment()
        webview_align.set(1, 1, 1, 1)
        webview_align.set_padding(0, 0, 0, 2)
        webview_align.add(self.webview)
        self.body_box.pack_start(webview_align, False, True)
开发者ID:Holdlen2DH,项目名称:dmusic-plugin-NeteaseCloudMusic,代码行数:14,代码来源:netease_music_browser.py

示例10: __init__

 def __init__(self):
     DialogBox.__init__(self, 
                        _("Convert"), 
                        FORM_WIDTH, FORM_HEIGHT, 
                        mask_type=DIALOG_MASK_SINGLE_PAGE,
                        close_callback=self.hide_all,
                        modal=True,                           
                        window_hint=gtk.gdk.WINDOW_TYPE_HINT_DIALOG,
                        window_pos=gtk.WIN_POS_CENTER,
                        # skip_taskbar_hint=False,
                        resizable=False,
                        )                        
     # Init value.
     self.init_value()
     # Init all widgets.
     self.InitializeComponent()
开发者ID:hailongqiu,项目名称:new-deepin-media-player,代码行数:16,代码来源:gui.py

示例11: __init__

    def __init__(self, url=None):
        DialogBox.__init__(self, "登录", 600, 385, DIALOG_MASK_MULTIPLE_PAGE,
                close_callback=self.hide_all, modal=False,
                window_hint=None, skip_taskbar_hint=False,
                window_pos=gtk.WIN_POS_CENTER)

        #self.set_keep_above(True)
        #self.is_reload_flag = False
        self.webview = BaseWebView(url)
        self.webview.connect("notify::load-status",
                self.handle_login_dialog_status)
        webview_align = gtk.Alignment()
        webview_align.set(1, 1, 1, 1)
        webview_align.set_padding(0, 0, 0, 2)
        webview_align.add(self.webview)
        self.body_box.pack_start(webview_align, False, True)
开发者ID:legendtang,项目名称:dmusic-plugin-NeteaseCloudMusic,代码行数:16,代码来源:netease_music_browser.py

示例12: __init__

 def __init__(self, 
              title, 
              message, 
              default_width=330,
              default_height=145,
              confirm_callback=None, 
              cancel_callback=None, 
              cancel_first=True, 
              message_text_size=11,
              window_type=gtk.WINDOW_TOPLEVEL,
              close_callback=None,
              text_wrap_width=330,
              text_x_align=ALIGN_START,
              ):
     DialogBox.__init__(
         self, title, default_width, default_height, DIALOG_MASK_SINGLE_PAGE,
         window_type=window_type,
         close_callback=close_callback,
         )
     self.confirm_callback = confirm_callback
     self.cancel_callback = cancel_callback
     
     self.label_align = gtk.Alignment()
     self.label_align.set(0.5, 0.5, 0, 0)
     self.label_align.set_padding(0, 0, 8, 8)
     self.label = Label(
         message, 
         text_x_align=text_x_align, 
         text_size=message_text_size,
         wrap_width=text_wrap_width,
         )
     
     self.confirm_button = Button(_("OK"))
     
     self.confirm_button.connect("clicked", lambda w: self.click_confirm_button())
     
     # Connect widgets.
     self.label_align.add(self.label)
     self.body_box.pack_start(self.label_align, True, True)
     
     self.right_button_box.set_buttons([self.confirm_button,])
         
     self.keymap = {
         "Return" : self.click_confirm_button,
         "Escape" : self.close,
         }    
开发者ID:electricface,项目名称:deepin-game-center,代码行数:46,代码来源:widgets.py

示例13: __init__

 def __init__(self,
              default_width=350,
              default_height=160,
              confirm_callback=None, 
              cancel_callback=None):
     '''
     Initialize InputDialog class.
     
     @param title: Input dialog title.
     @param init_text: Initialize input text.
     @param default_width: Width of dialog, default is 330 pixel.
     @param default_height: Height of dialog, default is 330 pixel.
     @param confirm_callback: Callback when user click confirm button, this callback accept one argument that return by user input text.
     @param cancel_callback: Callback when user click cancel button, this callback not need argument.
     '''
     # Init.
     DialogBox.__init__(self, _("Autostart app"), default_width, default_height, DIALOG_MASK_SINGLE_PAGE)
     self.confirm_callback = confirm_callback
     self.cancel_callback = cancel_callback
     self.on_click = None
     
     self.confirm_button = Button(_("OK"))
     self.cancel_button = Button(_("Cancel"))
     
     self.confirm_button.connect("clicked", lambda w: self.click_confirm_button())
     self.cancel_button.connect("clicked", lambda w: self.click_cancel_button())
     self.connect("destroy", self._close_callback) #self.close_callback is None at this moment, so we use _close_callback
     # get system pixbuf
     icon_theme = gtk.IconTheme()
     icon_theme.set_custom_theme("Deepin")
     icon_info = None
     if icon_theme:
         icon_info = icon_theme.lookup_icon("folder-open", 16, gtk.ICON_LOOKUP_NO_SVG)
     
     
     self.icon_pixbuf = None
     if icon_info:
         self.icon_pixbuf = DynamicPixbuf(icon_info.get_filename())
     else:
         self.icon_pixbuf = app_theme.get_pixbuf("navigate/none-small.png")
     
     table = self.add_new_box() 
     self.pack(self.body_box, [table])
     self.right_button_box.set_buttons([self.cancel_button, self.confirm_button])
     
     self.connect("show", self.focus_input)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:46,代码来源:widget.py

示例14: __init__

 def __init__(self, 
              title, 
              message, 
              default_width=330,
              default_height=145,
              confirm_callback=None, 
              cancel_callback=None, 
              cancel_first=True, 
              message_text_size=9,
              ):
     '''
     Initialize ConfirmDialog class.
     
     @param title: Title for confirm dialog.
     @param message: Confirm message.
     @param default_width: Dialog width, default is 330 pixel.
     @param default_height: Dialog height, default is 145 pixel.
     @param confirm_callback: Callback when user click confirm button.
     @param cancel_callback: Callback when user click cancel button.
     @param cancel_first: Set as True if to make cancel button before confirm button, default is True.
     @param message_text_size: Text size of message, default is 11.
     '''
     # Init.
     DialogBox.__init__(self, title, default_width, default_height, DIALOG_MASK_SINGLE_PAGE, close_callback=self.hide)
     self.confirm_callback = confirm_callback
     self.cancel_callback = cancel_callback
     
     self.label_align = gtk.Alignment()
     self.label_align.set(0.5, 0.5, 0, 0)
     self.label_align.set_padding(0, 0, 8, 8)
     self.label = Label(message, text_x_align=ALIGN_MIDDLE, text_size=message_text_size)
     
     self.confirm_button = Button(_("OK"))
     self.cancel_button = Button(_("Cancel"))
     
     self.confirm_button.connect("clicked", lambda w: self.click_confirm_button())
     self.cancel_button.connect("clicked", lambda w: self.click_cancel_button())
     
     # Connect widgets.
     self.body_box.pack_start(self.label_align, True, True)
     self.label_align.add(self.label)
     
     if cancel_first:
         self.right_button_box.set_buttons([self.cancel_button, self.confirm_button])
     else:
         self.right_button_box.set_buttons([self.confirm_button, self.cancel_button])
开发者ID:PeterDaveHello,项目名称:deepin-software-center,代码行数:46,代码来源:widgets.py

示例15: __init__

    def __init__(self, hide_callback=None):
        self.hide_callback = hide_callback
        self.dialog_width = 330
        DialogBox.__init__(
                self,
                title="",
                default_width=self.dialog_width,
                default_height=145,
                mask_type=0,
                close_callback=self.close_action,
                modal=True,
                window_hint=gtk.gdk.WINDOW_TYPE_HINT_DIALOG,
                window_pos=None,
                skip_taskbar_hint=True,
                resizable=False,
                window_type=gtk.WINDOW_TOPLEVEL,
                )

        self.waiting_animation = gtk.VBox()
        self.waiting_animation.set_size_request(36, 36)
        self.waiting_bg_pixbuf = utils.get_common_image_pixbuf("waiting/waiting_bg.png")
        self.waiting_fg_pixbuf = utils.get_common_image_pixbuf("waiting/waiting_fg.png")
        self.waiting_animation.connect("expose-event", self.expose_waiting)
        self.counter = 1
        self.factor = math.pi/10
        gtk.timeout_add(50, self.on_timer)

        self.label = Label(
            _("Speed testing will finish only after one minute, please wait."),
            text_size=10,
            wrap_width=self.dialog_width- 36 - 60,
            )

        self.waiting_hbox = gtk.HBox()
        self.waiting_hbox.pack_start(self.waiting_animation, False, False)
        self.waiting_hbox.pack_start(self.label, False, False)

        self.center_align = gtk.Alignment()
        self.center_align.set(0.5, 0.5, 0, 0)
        self.center_align.set_padding(0, 0, 8, 8)
        self.body_box.add(self.center_align)

        global_event.register_event("mirror-test-finished", self.show_result)
开发者ID:martyr-deepin,项目名称:deepin-store,代码行数:43,代码来源:dialog_widgets.py


注:本文中的dtk.ui.dialog.DialogBox类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。