/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 20:14:34 UTC
  • mto: (776.3.1 gpush)
  • mto: This revision was merged to the branch mainline in revision 779.
  • Revision ID: sinzui.is@verizon.net-20120227201434-l6xney9ewy54ewtl
Added InfoDialog and implemented show_message().

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
            Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, prompt)
43
43
 
44
44
 
 
45
class InfoDialog(Gtk.MessageDialog):
 
46
    """Show the user an informational message."""
 
47
 
 
48
    def __init__(self, prompt, parent=None):
 
49
        super(InfoDialog, self).__init__(
 
50
            parent, Gtk.DialogFlags.DESTROY_WITH_PARENT,
 
51
            Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, prompt)
 
52
 
 
53
 
45
54
class GtkProgressBar(Gtk.ProgressBar):
46
55
 
47
56
    def __init__(self):
170
179
        dialog.destroy()
171
180
        return (response == Gtk.ResponseType.YES)
172
181
 
 
182
    def show_message(self, msg):
 
183
        """See UIFactory.show_message."""
 
184
        dialog = InfoDialog(msg)
 
185
        dialog.run()
 
186
        dialog.destroy()
 
187
 
173
188
    def get_password(self, prompt='', **kwargs):
174
189
        """Prompt the user for a password.
175
190