summaryrefslogtreecommitdiff
path: root/grc/core/blocks/block.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/core/blocks/block.py')
-rw-r--r--grc/core/blocks/block.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/grc/core/blocks/block.py b/grc/core/blocks/block.py
index 4df3ec9663..19b16b53d6 100644
--- a/grc/core/blocks/block.py
+++ b/grc/core/blocks/block.py
@@ -169,9 +169,14 @@ class Block(Element):
"""check if this block supports the selected output language"""
current_output_language = self.parent.get_option('output_language')
- if current_output_language == 'cpp' and 'has_cpp' not in self.flags:
+ if current_output_language == 'cpp':
+ if 'cpp' not in self.flags:
self.add_error_message("This block does not support C++ output.")
+ if self.key == 'parameter':
+ if not self.params['type'].value:
+ self.add_error_message("C++ output requires you to choose a parameter type.")
+
def _validate_var_value(self):
"""or variables check the value (only if var_value is used)"""
if self.is_variable and self.value != 'value':
@@ -266,6 +271,8 @@ class Block(Element):
a list of strings
"""
def make_callback(callback):
+ if self.is_variable:
+ return callback
if 'this->' in callback:
return callback
return 'this->{}->{}'.format(self.name, callback)