From 14895064d7345c2223ff2b8ff3b9cbcdf69dd8c9 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 18 Sep 2009 02:10:13 -0700 Subject: added errors dialog to show all error messages in flow graph --- grc/gui/Dialogs.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'grc/gui/Dialogs.py') diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py index 3cf617b92..a8e7afb05 100644 --- a/grc/gui/Dialogs.py +++ b/grc/gui/Dialogs.py @@ -57,6 +57,20 @@ def MessageDialogHelper(type, buttons, title=None, markup=None): message_dialog.destroy() return response + +ERRORS_MARKUP_TMPL="""\ +#for $i, $err_msg in enumerate($errors) +Error $i: +$encode($err_msg.replace('\t', ' ')) + +#end for""" +def ErrorsDialog(flowgraph): MessageDialogHelper( + type=gtk.MESSAGE_ERROR, + buttons=gtk.BUTTONS_CLOSE, + title='Flowgraph Errors', + markup=Utils.parse_template(ERRORS_MARKUP_TMPL, errors=flowgraph.get_error_messages()), +) + class AboutDialog(gtk.AboutDialog): """A cute little about dialog.""" -- cgit From d28d40d33dac481296e1f836ec57f1018041d418 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 18 Sep 2009 02:22:43 -0700 Subject: put the flow graph errors button into the toolbar --- grc/gui/Dialogs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grc/gui/Dialogs.py') diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py index a8e7afb05..af40f47c0 100644 --- a/grc/gui/Dialogs.py +++ b/grc/gui/Dialogs.py @@ -67,7 +67,7 @@ $encode($err_msg.replace('\t', ' ')) def ErrorsDialog(flowgraph): MessageDialogHelper( type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_CLOSE, - title='Flowgraph Errors', + title='Flow Graph Errors', markup=Utils.parse_template(ERRORS_MARKUP_TMPL, errors=flowgraph.get_error_messages()), ) -- cgit