/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: Aaron Bentley
  • Date: 2007-01-17 06:42:55 UTC
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: aaron.bentley@utoronto.ca-20070117064255-x4gznz5e0lyjq3gk
Remove usused span selector

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
def about():
28
28
    """ Display the AboutDialog. """
29
29
    import olive
 
30
    from guifiles import GLADEFILENAME
30
31
 
31
32
    # Load AboutDialog description
32
 
    dglade = gtk.glade.XML(olive.gladefile, 'aboutdialog')
 
33
    dglade = gtk.glade.XML(GLADEFILENAME, 'aboutdialog')
33
34
    dialog = dglade.get_widget('aboutdialog')
34
35
 
35
36
    # Set version
36
37
    dialog.set_version(olive.__version__)
37
 
    
 
38
 
 
39
    dialog.run()
38
40
    # Destroy the dialog
39
 
    if dialog.run() == gtk.RESPONSE_CANCEL:
40
 
        dialog.destroy()
 
41
    dialog.destroy()
41
42
 
42
43
def _message_dialog(type, primary, secondary):
43
44
    """ Display a given type of MessageDialog with the given message.
61
62
                                   type=gtk.MESSAGE_INFO,
62
63
                                   buttons=gtk.BUTTONS_OK)
63
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>')
64
70
    else:
65
71
        return
66
 
    
 
72
 
67
73
    dialog.format_secondary_markup(secondary)
68
 
    
69
 
    if dialog.run() == gtk.RESPONSE_OK:
70
 
        dialog.destroy()
 
74
 
 
75
    response = dialog.run()
 
76
    dialog.destroy()
 
77
 
 
78
    return response
71
79
 
72
80
def error_dialog(primary, secondary):
73
81
    """ Display an error dialog with the given message. """
74
 
    _message_dialog('error', primary, secondary)
 
82
    return _message_dialog('error', primary, secondary)
75
83
 
76
84
def info_dialog(primary, secondary):
77
85
    """ Display an info dialog with the given message. """
78
 
    _message_dialog('info', primary, secondary)
 
86
    return _message_dialog('info', primary, secondary)
79
87
 
80
88
def warning_dialog(primary, secondary):
81
89
    """ Display a warning dialog with the given message. """
82
 
    _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)