diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2015-02-12 22:00:37 +0100 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2015-02-12 23:07:16 +0100 |
commit | c990e8256dd580a72b28d138c030a112a33157f7 (patch) | |
tree | a81dd047696a50d1d93436f68a84b853a9fd98d6 /grc/python | |
parent | 40f5e6cdae82d279b95d7e02b8ef19d79dcd8163 (diff) |
grc: add error to WX/QT GUI blocks not matching the selected generate option
Diffstat (limited to 'grc/python')
-rw-r--r-- | grc/python/Block.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/grc/python/Block.py b/grc/python/Block.py index d0cbfbfa86..191b03b452 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): """ |