/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 olive/dialog.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-12-01 18:02:11 UTC
  • mfrom: (66.2.6 trunk)
  • Revision ID: szilveszter.farkas@gmail.com-20061201180211-hakaxu53l6eodq2i
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
    # Set version
37
37
    dialog.set_version(olive.__version__)
38
 
    
 
38
 
 
39
    dialog.run()
39
40
    # Destroy the dialog
40
 
    if dialog.run() == gtk.RESPONSE_CANCEL:
41
 
        dialog.destroy()
 
41
    dialog.destroy()
42
42
 
43
43
def _message_dialog(type, primary, secondary):
44
44
    """ Display a given type of MessageDialog with the given message.
62
62
                                   type=gtk.MESSAGE_INFO,
63
63
                                   buttons=gtk.BUTTONS_OK)
64
64
        dialog.set_markup('<big><b>' + primary + '</b></big>')
 
65
    elif type == 'question':
 
66
        dialog = gtk.MessageDialog(flags=gtk.DIALOG_MODAL,
 
67
                                   type=gtk.MESSAGE_QUESTION,
 
68
                                   buttons=gtk.BUTTONS_YES_NO)
 
69
        dialog.set_markup('<big><b>' + primary + '</b></big>')
65
70
    else:
66
71
        return
67
 
    
 
72
 
68
73
    dialog.format_secondary_markup(secondary)
69
 
    
70
 
    if dialog.run() == gtk.RESPONSE_OK:
71
 
        dialog.destroy()
 
74
 
 
75
    response = dialog.run()
 
76
    dialog.destroy()
 
77
 
 
78
    return response
72
79
 
73
80
def error_dialog(primary, secondary):
74
81
    """ Display an error dialog with the given message. """
75
 
    _message_dialog('error', primary, secondary)
 
82
    return _message_dialog('error', primary, secondary)
76
83
 
77
84
def info_dialog(primary, secondary):
78
85
    """ Display an info dialog with the given message. """
79
 
    _message_dialog('info', primary, secondary)
 
86
    return _message_dialog('info', primary, secondary)
80
87
 
81
88
def warning_dialog(primary, secondary):
82
89
    """ Display a warning dialog with the given message. """
83
 
    _message_dialog('warning', primary, secondary)
 
90
    return _message_dialog('warning', primary, secondary)
 
91
 
 
92
def question_dialog(primary, secondary):
 
93
    """ Display a dialog with the given question. """
 
94
    return _message_dialog('question', primary, secondary)