summaryrefslogtreecommitdiff
path: root/grc/gui/FlowGraph.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui/FlowGraph.py')
-rw-r--r--grc/gui/FlowGraph.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index c7c64c6e7d..15488cc59b 100644
--- a/grc/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -53,7 +53,7 @@ class FlowGraph(Element, _Flowgraph):
#important vars dealing with mouse event tracking
self.element_moved = False
self.mouse_pressed = False
- self.unselect()
+ self._selected_elements = []
self.press_coor = (0, 0)
#selected ports
self._old_selected_port = None
@@ -203,11 +203,15 @@ class FlowGraph(Element, _Flowgraph):
v_adj = self.get_scroll_pane().get_vadjustment()
x_off = h_adj.get_value() - x_min + h_adj.page_size/4
y_off = v_adj.get_value() - y_min + v_adj.page_size/4
+ if len(self.get_elements()) <= 1:
+ x_off, y_off = 0, 0
#create blocks
for block_n in blocks_n:
block_key = block_n.find('key')
if block_key == 'options': continue
block = self.new_block(block_key)
+ if not block:
+ continue # unknown block was pasted (e.g. dummy block)
selected.add(block)
#set params
params_n = block_n.findall('param')
@@ -444,6 +448,10 @@ class FlowGraph(Element, _Flowgraph):
"""
self._selected_elements = []
+ def select_all(self):
+ """Select all blocks in the flow graph"""
+ self._selected_elements = list(self.get_elements())
+
def what_is_selected(self, coor, coor_m=None):
"""
What is selected?