/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:26:07 UTC
  • mto: (776.3.1 gpush)
  • mto: This revision was merged to the branch mainline in revision 779.
  • Revision ID: sinzui.is@verizon.net-20120227202607-lwkssrnbkwbp6gc9
Added WarningDialog and implementd show_warning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
class InfoDialog(Gtk.MessageDialog):
46
46
    """Show the user an informational message."""
47
47
 
 
48
    MESSAGE_TYPE = Gtk.MessageType.INFO
 
49
 
48
50
    def __init__(self, prompt, parent=None):
49
51
        super(InfoDialog, self).__init__(
50
52
            parent, Gtk.DialogFlags.DESTROY_WITH_PARENT,
51
 
            Gtk.MessageType.INFO, Gtk.ButtonsType.CLOSE, prompt)
 
53
            self.MESSAGE_TYPE, Gtk.ButtonsType.CLOSE, prompt)
 
54
 
 
55
 
 
56
class WarningDialog(InfoDialog):
 
57
    """Show the user a warning message."""
 
58
 
 
59
    MESSAGE_TYPE = Gtk.MessageType.WARNING
52
60
 
53
61
 
54
62
class GtkProgressBar(Gtk.ProgressBar):
185
193
        dialog.run()
186
194
        dialog.destroy()
187
195
 
 
196
    def show_warning(self, msg):
 
197
        """See UIFactory.show_message."""
 
198
        dialog = WarningDialog(msg)
 
199
        dialog.run()
 
200
        dialog.destroy()
 
201
 
188
202
    def get_password(self, prompt='', **kwargs):
189
203
        """Prompt the user for a password.
190
204