/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: Jelmer Vernooij
  • Date: 2011-11-02 11:11:06 UTC
  • mfrom: (734.1.55 gtk3)
  • Revision ID: jelmer@samba.org-20111102111106-7l0vso8eg24dpf87
Merge gtk3 support from Curtis.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    """Prompt the user for a yes/no answer."""
29
29
 
30
30
    def __init__(self, prompt):
31
 
        Gtk.Dialog.__init__(self)
 
31
        super(PromptDialog, self).__init__()
32
32
 
33
33
        label = Gtk.Label(label=prompt)
34
 
        self.vbox.pack_start(label, True, True, 10)
35
 
        self.vbox.show_all()
 
34
        self.get_content_area().pack_start(label, True, True, 10)
 
35
        self.get_content_area().show_all()
36
36
 
37
37
        self.add_buttons(Gtk.STOCK_YES, Gtk.ResponseType.YES, Gtk.STOCK_NO,
38
38
                         Gtk.ResponseType.NO)
41
41
class GtkProgressBar(Gtk.ProgressBar):
42
42
 
43
43
    def __init__(self):
44
 
        Gtk.ProgressBar.__init__(self)
 
44
        super(GtkProgressBar, self).__init__()
45
45
        self.set_fraction(0.0)
46
46
        self.current = None
47
47
        self.total = None
138
138
    """ Prompt the user for a password. """
139
139
 
140
140
    def __init__(self, prompt):
141
 
        Gtk.Dialog.__init__(self)
 
141
        super(PasswordDialog, self).__init__()
142
142
 
143
143
        label = Gtk.Label(label=prompt)
144
 
        self.vbox.pack_start(label, True, True, 10)
 
144
        self.get_content_area().pack_start(label, True, True, 10)
145
145
 
146
146
        self.entry = Gtk.Entry()
147
147
        self.entry.set_visibility(False)
148
 
        self.vbox.pack_end(self.entry, padding=10)
 
148
        self.get_content_area().pack_end(self.entry, False, False, 10)
149
149
 
150
 
        self.vbox.show_all()
 
150
        self.get_content_area().show_all()
151
151
 
152
152
        self.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.OK,
153
153
                         Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)