37
37
dialog.set_version(olive.__version__)
39
40
# Destroy the dialog
40
if dialog.run() == gtk.RESPONSE_CANCEL:
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>')
68
73
dialog.format_secondary_markup(secondary)
70
if dialog.run() == gtk.RESPONSE_OK:
75
response = dialog.run()
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)
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)
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)
92
def question_dialog(primary, secondary):
93
""" Display a dialog with the given question. """
94
return _message_dialog('question', primary, secondary)