/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to ui.py

  • Committer: Curtis Hovey
  • Date: 2012-02-27 19:48:38 UTC
  • mto: (776.3.1 gpush)
  • mto: This revision was merged to the branch mainline in revision 779.
  • Revision ID: sinzui.is@verizon.net-20120227194838-z857ixpc7mz53eb5
Change PromptDialog to extend GtkMessageDialog that provides icons and text handling for
free.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    return with_main_iteration
34
34
 
35
35
 
36
 
class PromptDialog(Gtk.Dialog):
 
36
class PromptDialog(Gtk.MessageDialog):
37
37
    """Prompt the user for a yes/no answer."""
38
38
 
39
 
    def __init__(self, prompt):
40
 
        super(PromptDialog, self).__init__()
41
 
 
42
 
        label = Gtk.Label(label=prompt)
43
 
        self.get_content_area().pack_start(label, True, True, 10)
44
 
        self.get_content_area().show_all()
45
 
 
46
 
        self.add_buttons(Gtk.STOCK_YES, Gtk.ResponseType.YES, Gtk.STOCK_NO,
47
 
                         Gtk.ResponseType.NO)
 
39
    def __init__(self, prompt, parent=None):
 
40
        super(PromptDialog, self).__init__(
 
41
            parent, Gtk.DialogFlags.DESTROY_WITH_PARENT,
 
42
            Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, prompt)
48
43
 
49
44
 
50
45
class GtkProgressBar(Gtk.ProgressBar):