commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 01/10: grc: add select all action


From: git
Subject: [Commit-gnuradio] [gnuradio] 01/10: grc: add select all action
Date: Thu, 14 Apr 2016 20:43:07 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit fc05698ba1c292a3185ccff26f730320d7d27de6
Author: Sebastian Koslowski <address@hidden>
Date:   Tue Feb 16 21:04:33 2016 +0100

    grc: add select all action
---
 grc/gui/ActionHandler.py | 3 +++
 grc/gui/Actions.py       | 6 ++++++
 grc/gui/Bars.py          | 1 +
 grc/gui/FlowGraph.py     | 6 +++++-
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index 0f227d0..8812704 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -143,6 +143,7 @@ class ActionHandler:
                 Actions.TOGGLE_SHOW_CODE_PREVIEW_TAB,
                 Actions.TOGGLE_SHOW_FLOWGRAPH_COMPLEXITY,
                 Actions.FLOW_GRAPH_OPEN_QSS_THEME,
+                Actions.SELECT_ALL,
             ):
                 action.set_sensitive(True)
                 if hasattr(action, 'load_from_preferences'):
@@ -162,6 +163,8 @@ class ActionHandler:
             pass #do nothing, update routines below
         elif action == Actions.NOTHING_SELECT:
             self.get_flow_graph().unselect()
+        elif action == Actions.SELECT_ALL:
+            self.get_flow_graph().select_all()
         ##################################################
         # Enable/Disable
         ##################################################
diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py
index d53375f..354e536 100644
--- a/grc/gui/Actions.py
+++ b/grc/gui/Actions.py
@@ -226,6 +226,12 @@ FLOW_GRAPH_REDO = Action(
     keypresses=(gtk.keysyms.y, gtk.gdk.CONTROL_MASK),
 )
 NOTHING_SELECT = Action()
+SELECT_ALL = Action(
+    label='Select _All',
+    tooltip='Select all blocks and connections in the flow graph',
+    stock_id=gtk.STOCK_SELECT_ALL,
+    keypresses=(gtk.keysyms.a, gtk.gdk.CONTROL_MASK),
+)
 ELEMENT_SELECT = Action()
 ELEMENT_CREATE = Action()
 ELEMENT_DELETE = Action(
diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py
index 19f041f..259aa6e 100644
--- a/grc/gui/Bars.py
+++ b/grc/gui/Bars.py
@@ -82,6 +82,7 @@ MENU_BAR_LIST = (
         Actions.BLOCK_COPY,
         Actions.BLOCK_PASTE,
         Actions.ELEMENT_DELETE,
+        Actions.SELECT_ALL,
         None,
         Actions.BLOCK_ROTATE_CCW,
         Actions.BLOCK_ROTATE_CW,
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index 63fd841..e940661 100644
--- a/grc/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -49,7 +49,7 @@ class FlowGraph(Element):
         #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
@@ -429,6 +429,10 @@ class FlowGraph(Element):
         """
         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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]