Merge branch 'vrt' of http://gnuradio.org/git/jblum
[debian/gnuradio] / grc / gui / Dialogs.py
index 3cf617b92c8e03b1a06fdd6d6e457dd8a450f613..af40f47c088a38d57baebc2dc20477a25fcb9b35 100644 (file)
@@ -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)
+<b>Error $i:</b>
+$encode($err_msg.replace('\t', '  '))
+
+#end for"""
+def ErrorsDialog(flowgraph): MessageDialogHelper(
+       type=gtk.MESSAGE_ERROR,
+       buttons=gtk.BUTTONS_CLOSE,
+       title='Flow Graph Errors',
+       markup=Utils.parse_template(ERRORS_MARKUP_TMPL, errors=flowgraph.get_error_messages()),
+)
+
 class AboutDialog(gtk.AboutDialog):
        """A cute little about dialog."""