diff options
author | Sebastian Koslowski <koslowski@kit.edu> | 2013-11-22 21:34:47 +0100 |
---|---|---|
committer | Sebastian Koslowski <koslowski@kit.edu> | 2013-11-22 21:41:37 +0100 |
commit | a00b94ec4a9949125ddb1711abf49d4d575d290d (patch) | |
tree | 1be987455cea8bc2fa78c02576d28d051813fc60 /grc | |
parent | b942affe9f36be114ac01bf3dd50e4ad663a2845 (diff) |
grc: toggle visibility of report and block tree widgets
Diffstat (limited to 'grc')
-rw-r--r-- | grc/gui/ActionHandler.py | 10 | ||||
-rw-r--r-- | grc/gui/Actions.py | 10 | ||||
-rw-r--r-- | grc/gui/Bars.py | 3 | ||||
-rw-r--r-- | grc/gui/BlockTreeWindow.py | 4 |
4 files changed, 26 insertions, 1 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 87576ccae1..acb546b691 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -113,7 +113,8 @@ class ActionHandler: Actions.FLOW_GRAPH_OPEN, Actions.FLOW_GRAPH_SAVE_AS, Actions.FLOW_GRAPH_CLOSE, Actions.ABOUT_WINDOW_DISPLAY, Actions.FLOW_GRAPH_SCREEN_CAPTURE, Actions.HELP_WINDOW_DISPLAY, - Actions.TYPES_WINDOW_DISPLAY, + Actions.TYPES_WINDOW_DISPLAY, Actions.TOGGLE_BLOCKTREE_WIDGET, + Actions.TOGGLE_REPORT_WIDGET, ): action.set_sensitive(True) if not self.init_file_paths: self.init_file_paths = Preferences.files_open() @@ -349,6 +350,12 @@ class ActionHandler: Dialogs.TypesDialog(self.get_flow_graph().get_parent()) elif action == Actions.ERRORS_WINDOW_DISPLAY: Dialogs.ErrorsDialog(self.get_flow_graph()) + elif action == Actions.TOGGLE_REPORT_WIDGET: + widget = self.main_window.reports_scrolled_window + widget.set_visible(not widget.get_visible()) + elif action == Actions.TOGGLE_BLOCKTREE_WIDGET: + widget = self.main_window.btwin + widget.set_visible(not widget.get_visible()) ################################################## # Param Modifications ################################################## @@ -447,6 +454,7 @@ class ActionHandler: self.main_window.btwin.clear(); self.platform.load_block_tree(self.main_window.btwin); elif action == Actions.FIND_BLOCKS: + self.main_window.btwin.show() self.main_window.btwin.search_entry.show() self.main_window.set_focus(self.main_window.btwin.search_entry) elif action == Actions.OPEN_HIER: diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py index df6f7b2bc9..90e23d7fb7 100644 --- a/grc/gui/Actions.py +++ b/grc/gui/Actions.py @@ -233,6 +233,16 @@ ERRORS_WINDOW_DISPLAY = Action( tooltip='View flow graph errors', stock_id=gtk.STOCK_DIALOG_ERROR, ) +TOGGLE_REPORT_WIDGET = Action( + label='_Reports', + tooltip='Toggle visibility of the Report widget', + keypresses=(gtk.keysyms.r, gtk.gdk.CONTROL_MASK), +) +TOGGLE_BLOCKTREE_WIDGET = Action( + label='_Block Tree', + tooltip='Toggle visibility of the block tree widget', + keypresses=(gtk.keysyms.b, gtk.gdk.CONTROL_MASK), +) ABOUT_WINDOW_DISPLAY = Action( label='_About', tooltip='About this program', diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py index 92d87c8809..6c72b04eca 100644 --- a/grc/gui/Bars.py +++ b/grc/gui/Bars.py @@ -88,7 +88,10 @@ MENU_BAR_LIST = ( Actions.BLOCK_PARAM_MODIFY, ]), (gtk.Action('View', '_View', None, None), [ + Actions.TOGGLE_BLOCKTREE_WIDGET, + Actions.TOGGLE_REPORT_WIDGET, Actions.ERRORS_WINDOW_DISPLAY, + None, Actions.FIND_BLOCKS, ]), (gtk.Action('Build', '_Build', None, None), [ diff --git a/grc/gui/BlockTreeWindow.py b/grc/gui/BlockTreeWindow.py index 9ea37c55e0..f4b35a5dca 100644 --- a/grc/gui/BlockTreeWindow.py +++ b/grc/gui/BlockTreeWindow.py @@ -226,6 +226,10 @@ class BlockTreeWindow(gtk.VBox): # manually trigger action... Actions.FIND_BLOCKS.activate() + elif event.state & gtk.gdk.CONTROL_MASK and event.keyval == gtk.keysyms.b: + # ugly... + Actions.TOGGLE_BLOCKTREE_WIDGET.activate() + else: return False # propagate event |