commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 04/07: grc: show xml parser error warning i


From: git
Subject: [Commit-gnuradio] [gnuradio] 04/07: grc: show xml parser error warning in report window
Date: Mon, 27 Jan 2014 20:10:38 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 7548e467bda2985f241e5ae0ac3939ced303ca23
Author: Sebastian Koslowski <address@hidden>
Date:   Sat Jan 4 15:25:45 2014 +0100

    grc: show xml parser error warning in report window
---
 grc/gui/ActionHandler.py | 7 +++++--
 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 0ce81a8..14a781a 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 d903e40..a6620aa 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')



reply via email to

[Prev in Thread] Current Thread [Next in Thread]