diff options
Diffstat (limited to 'grc/gui/Dialogs.py')
-rw-r--r-- | grc/gui/Dialogs.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py index cf0ca02969..e1fc680bde 100644 --- a/grc/gui/Dialogs.py +++ b/grc/gui/Dialogs.py @@ -116,7 +116,7 @@ class TextDisplay(gtk.TextView): menu.show_all() return False -def MessageDialogHelper(type, buttons, title=None, markup=None, extra_buttons=None): +def MessageDialogHelper(type, buttons, title=None, markup=None, default_response=None, extra_buttons=None): """ Create a modal message dialog and run it. @@ -128,6 +128,7 @@ def MessageDialogHelper(type, buttons, title=None, markup=None, extra_buttons=No Args: title: the title of the window (string) markup: the message text with pango markup + default_response: if set, determines which button is highlighted by default extra_buttons: a tuple containing pairs of values; each value is the button's text and the button's return value Returns: @@ -137,6 +138,7 @@ def MessageDialogHelper(type, buttons, title=None, markup=None, extra_buttons=No if title: message_dialog.set_title(title) if markup: message_dialog.set_markup(markup) if extra_buttons: message_dialog.add_buttons(*extra_buttons) + if default_response: message_dialog.set_default_response(default_response) response = message_dialog.run() message_dialog.destroy() return response |