diff options
author | Christophe Seguinot <christophe.seguinot@univ-lille.fr> | 2021-02-22 08:50:05 +0100 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-03-10 09:11:19 -0500 |
commit | f45c82436c2a19fa1e5ff15177fbc4cc591017cb (patch) | |
tree | 6faeb835ca925d77852821feb0169da166f49fc2 | |
parent | a53bb7a76047414eeae611f9d1fdcca4c6e2fa53 (diff) |
grc: validate gui hints
Signed-off-by: Christophe Seguinot <christophe.seguinot@univ-lille.fr>
-rw-r--r-- | grc/core/generator/top_block.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/grc/core/generator/top_block.py b/grc/core/generator/top_block.py index 091922d963..cd4ccc1dd5 100644 --- a/grc/core/generator/top_block.py +++ b/grc/core/generator/top_block.py @@ -198,11 +198,11 @@ class TopBlockGenerator(object): blocks = expr_utils.sort_objects(blocks, operator.attrgetter('name'), _get_block_sort_text) # Ordering blocks : blocks with GUI Hint must be processed first to avoid PyQT5 superposing blocks - for block in blocks: + def without_gui_hint(block): hint = block.params.get('gui_hint') - block.without_gui_hint = not hint # (hint == None) or (not hint.get_value()) + return hint is None or not hint.get_value() - blocks = sorted(blocks, key=lambda block: block.without_gui_hint) + blocks.sort(key=without_gui_hint) blocks_make = [] for block in blocks: |