[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 03/03: grc: add error to WX/QT GUI blocks n
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 03/03: grc: add error to WX/QT GUI blocks not matching the selected generate option |
Date: |
Thu, 12 Feb 2015 22:25:36 +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 c990e8256dd580a72b28d138c030a112a33157f7
Author: Sebastian Koslowski <address@hidden>
Date: Thu Feb 12 22:00:37 2015 +0100
grc: add error to WX/QT GUI blocks not matching the selected generate option
---
grc/python/Block.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/grc/python/Block.py b/grc/python/Block.py
index d0cbfbf..191b03b 100644
--- a/grc/python/Block.py
+++ b/grc/python/Block.py
@@ -77,6 +77,7 @@ class Block(_Block, _GUIBlock):
return clean_bus_structure
except: return ''
+
def throttle(self): return bool(self._throttle)
def validate(self):
@@ -101,6 +102,11 @@ class Block(_Block, _GUIBlock):
self.get_parent().evaluate(value)
except Exception as err:
self.add_error_message('Value "%s" cannot be evaluated:\n%s' %
(value, err))
+ # check if this is a GUI block and matches the selected generate option
+ current_generate_option =
self.get_parent().get_option('generate_options')
+ for label, option in (('WX GUI', 'wx_gui'), ('QT GUI', 'qt_gui')):
+ if self.get_name().startswith(label) and current_generate_option
!= option:
+ self.add_error_message("Can't generate this block in mode " +
repr(option))
def rewrite(self):
"""