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.py42
1 files changed, 29 insertions, 13 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index 86f06aad58..65969e0d6f 100644
--- a/grc/gui/ActionHandler.py
+++ b/grc/gui/ActionHandler.py
@@ -25,6 +25,7 @@ import pygtk
pygtk.require('2.0')
import gtk
import gobject
+import subprocess
import Preferences
from threading import Thread
import Messages
@@ -115,7 +116,8 @@ class ActionHandler:
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_REPORTS_WINDOW, Actions.TOGGLE_HIDE_DISABLED_BLOCKS,
+ Actions.TOOLS_RUN_FDESIGN,
): action.set_sensitive(True)
if ParseXML.xml_failures:
Messages.send_xml_errors_if_any(ParseXML.xml_failures)
@@ -359,12 +361,20 @@ class ActionHandler:
Dialogs.ErrorsDialog(self.get_flow_graph())
elif action == Actions.TOGGLE_REPORTS_WINDOW:
visible = action.get_active()
- self.main_window.reports_scrolled_window.set_visible(visible)
+ if visible:
+ self.main_window.reports_scrolled_window.show()
+ else:
+ self.main_window.reports_scrolled_window.hide()
Preferences.reports_window_visibility(visible)
elif action == Actions.TOGGLE_BLOCKS_WINDOW:
visible = action.get_active()
- self.main_window.btwin.set_visible(visible)
+ if visible:
+ self.main_window.btwin.show()
+ else:
+ self.main_window.btwin.hide()
Preferences.blocks_window_visibility(visible)
+ elif action == Actions.TOGGLE_HIDE_DISABLED_BLOCKS:
+ Actions.NOTHING_SELECT()
##################################################
# Param Modifications
##################################################
@@ -472,28 +482,34 @@ class ActionHandler:
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)
+ self.main_window.btwin.search_entry.grab_focus()
elif action == Actions.OPEN_HIER:
bn = [];
for b in self.get_flow_graph().get_selected_blocks():
if b._grc_source:
- self.main_window.new_page(b._grc_source, show=True);
+ self.main_window.new_page(b._grc_source, show=True)
elif action == Actions.BUSSIFY_SOURCES:
n = {'name':'bus', 'type':'bus'}
for b in self.get_flow_graph().get_selected_blocks():
- b.bussify(n, 'source');
- self.get_flow_graph()._old_selected_port = None;
- self.get_flow_graph()._new_selected_port = None;
- Actions.ELEMENT_CREATE();
+ b.bussify(n, 'source')
+ self.get_flow_graph()._old_selected_port = None
+ self.get_flow_graph()._new_selected_port = None
+ Actions.ELEMENT_CREATE()
elif action == Actions.BUSSIFY_SINKS:
n = {'name':'bus', 'type':'bus'}
for b in self.get_flow_graph().get_selected_blocks():
b.bussify(n, 'sink')
- self.get_flow_graph()._old_selected_port = None;
- self.get_flow_graph()._new_selected_port = None;
- Actions.ELEMENT_CREATE();
- else: print '!!! Action "%s" not handled !!!'%action
+ self.get_flow_graph()._old_selected_port = None
+ self.get_flow_graph()._new_selected_port = None
+ Actions.ELEMENT_CREATE()
+
+ elif action == Actions.TOOLS_RUN_FDESIGN:
+ subprocess.Popen('gr_filter_design',
+ shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+
+ else:
+ print '!!! Action "%s" not handled !!!' % action
##################################################
# Global Actions for all States
##################################################