summaryrefslogtreecommitdiff
path: root/grc/gui/ActionHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'grc/gui/ActionHandler.py')
-rw-r--r--grc/gui/ActionHandler.py43
1 files changed, 22 insertions, 21 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index 19c6edc914..e6ffe9c5e7 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -113,21 +113,6 @@ class ActionHandler:
# Initialize/Quit
##################################################
if action == Actions.APPLICATION_INITIALIZE:
- for action in Actions.get_all_actions(): action.set_sensitive(False) #set all actions disabled
- #enable a select few actions
- for action in (
- Actions.APPLICATION_QUIT, Actions.FLOW_GRAPH_NEW,
- 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.TOGGLE_BLOCKS_WINDOW,
- Actions.TOGGLE_REPORTS_WINDOW, Actions.TOGGLE_HIDE_DISABLED_BLOCKS,
- Actions.TOOLS_RUN_FDESIGN, Actions.TOGGLE_SCROLL_LOCK,
- Actions.CLEAR_REPORTS, Actions.SAVE_REPORTS,
- Actions.TOGGLE_AUTO_HIDE_PORT_LABELS, Actions.TOGGLE_SNAP_TO_GRID,
- Actions.TOGGLE_SHOW_BLOCK_COMMENTS,
- Actions.TOGGLE_SHOW_CODE_PREVIEW_TAB,
- ): action.set_sensitive(True)
if ParseXML.xml_failures:
Messages.send_xml_errors_if_any(ParseXML.xml_failures)
Actions.XML_PARSER_ERRORS_DISPLAY.set_sensitive(True)
@@ -142,15 +127,27 @@ class ActionHandler:
if not self.get_page(): self.main_window.new_page() #ensure that at least a blank page exists
self.main_window.btwin.search_entry.hide()
+
+ # Disable all actions, then re-enable a few
+ for action in Actions.get_all_actions(): action.set_sensitive(False) #set all actions disabled
for action in (
- Actions.TOGGLE_REPORTS_WINDOW,
- Actions.TOGGLE_BLOCKS_WINDOW,
- Actions.TOGGLE_AUTO_HIDE_PORT_LABELS,
- Actions.TOGGLE_SCROLL_LOCK,
- Actions.TOGGLE_SNAP_TO_GRID,
+ Actions.APPLICATION_QUIT, Actions.FLOW_GRAPH_NEW,
+ 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.TOGGLE_BLOCKS_WINDOW,
+ Actions.TOGGLE_REPORTS_WINDOW, Actions.TOGGLE_HIDE_DISABLED_BLOCKS,
+ Actions.TOOLS_RUN_FDESIGN, Actions.TOGGLE_SCROLL_LOCK,
+ Actions.CLEAR_REPORTS, Actions.SAVE_REPORTS,
+ Actions.TOGGLE_AUTO_HIDE_PORT_LABELS, Actions.TOGGLE_SNAP_TO_GRID,
Actions.TOGGLE_SHOW_BLOCK_COMMENTS,
Actions.TOGGLE_SHOW_CODE_PREVIEW_TAB,
- ): action.load_from_preferences()
+ Actions.TOGGLE_SHOW_FLOWGRAPH_COMPLEXITY,
+ ):
+ action.set_sensitive(True)
+ if hasattr(action, 'load_from_preferences'):
+ action.load_from_preferences()
+
elif action == Actions.APPLICATION_QUIT:
if self.main_window.close_pages():
gtk.main_quit()
@@ -416,6 +413,10 @@ class ActionHandler:
action.save_to_preferences()
elif action == Actions.TOGGLE_SHOW_CODE_PREVIEW_TAB:
action.save_to_preferences()
+ elif action == Actions.TOGGLE_SHOW_FLOWGRAPH_COMPLEXITY:
+ action.save_to_preferences()
+ for page in self.main_window.get_pages():
+ page.get_flow_graph().update()
##################################################
# Param Modifications
##################################################