mirror of
https://github.com/gnuradio/gnuradio-companion.git
synced 2025-12-10 15:57:35 -06:00
grc: add select all action
This commit is contained in:
parent
250a514641
commit
73b489e183
@ -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
|
||||
##################################################
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user