diff options
-rw-r--r-- | grc/gui/ActionHandler.py | 7 | ||||
-rw-r--r-- | grc/gui/Messages.py | 6 |
2 files changed, 11 insertions, 2 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 0ce81a8ac5..14a781a09b 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -117,8 +117,10 @@ class ActionHandler: Actions.TYPES_WINDOW_DISPLAY, Actions.TOGGLE_BLOCKS_WINDOW, Actions.TOGGLE_REPORTS_WINDOW, ): action.set_sensitive(True) - Actions.PARSER_ERRORS.set_sensitive(bool(ParseXML.xml_failures)) - + if ParseXML.xml_failures: + Messages.send_xml_errors_if_any(ParseXML.xml_failures) + Actions.PARSER_ERRORS.set_sensitive(True) + if not self.init_file_paths: self.init_file_paths = Preferences.files_open() if not self.init_file_paths: self.init_file_paths = [''] @@ -466,6 +468,7 @@ class ActionHandler: self.main_window.btwin.clear() self.platform.load_block_tree(self.main_window.btwin) Actions.PARSER_ERRORS.set_sensitive(bool(ParseXML.xml_failures)) + Messages.send_xml_errors_if_any(ParseXML.xml_failures) elif action == Actions.FIND_BLOCKS: self.main_window.btwin.show() self.main_window.btwin.search_entry.show() diff --git a/grc/gui/Messages.py b/grc/gui/Messages.py index d903e40a45..a6620aa72f 100644 --- a/grc/gui/Messages.py +++ b/grc/gui/Messages.py @@ -53,6 +53,12 @@ def send_init(platform): def send_page_switch(file_path): send('\nShowing: "%s"\n'%file_path) +################# functions for loading blocks ######################################## +def send_xml_errors_if_any(xml_failures): + if xml_failures: + send('\nXML parser: Found {} erroneous XML file{} while loading the block tree ' + '(see "Help/Parser errors" for details)\n'.format(len(xml_failures), 's' if len(xml_failures) > 1 else '')) + ################# functions for loading flow graphs ######################################## def send_start_load(file_path): send('\nLoading: "%s"'%file_path + '\n') |