diff options
author | jblum | 2008-11-15 00:23:27 +0000 |
---|---|---|
committer | jblum | 2008-11-15 00:23:27 +0000 |
commit | 28bbeb38f65ebe5b6422e52d31b359ddfac94fc2 (patch) | |
tree | b8d7f302905a9e15f36c0cf433acd40752e00edf /grc/src/platforms/gui/FlowGraph.py | |
parent | dce791d534f242691b5899544f75b24077ff894e (diff) | |
download | gnuradio-28bbeb38f65ebe5b6422e52d31b359ddfac94fc2.tar.gz gnuradio-28bbeb38f65ebe5b6422e52d31b359ddfac94fc2.tar.bz2 gnuradio-28bbeb38f65ebe5b6422e52d31b359ddfac94fc2.zip |
only change id if not unique
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9994 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'grc/src/platforms/gui/FlowGraph.py')
-rw-r--r-- | grc/src/platforms/gui/FlowGraph.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/grc/src/platforms/gui/FlowGraph.py b/grc/src/platforms/gui/FlowGraph.py index 5b40154c4..e387ccc9b 100644 --- a/grc/src/platforms/gui/FlowGraph.py +++ b/grc/src/platforms/gui/FlowGraph.py @@ -140,7 +140,6 @@ class FlowGraph(Element): for block_n in blocks_n: block_key = block_n['key'] if block_key == 'options': continue - block_id = self._get_unique_id(block_key) block = self.get_new_block(block_key) selected.add(block) #set params @@ -151,7 +150,9 @@ class FlowGraph(Element): #setup id parameter if param_key == 'id': old_id2block[param_value] = block - param_value = block_id + #if the block id is not unique, get a new block id + if param_value in [block.get_id() for block in self.get_blocks()]: + param_value = self._get_unique_id(param_value) #set value to key block.get_param(param_key).set_value(param_value) #move block to offset coordinate |