[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/04: grc: new tools menu to execute gr_fi
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/04: grc: new tools menu to execute gr_filter_design |
Date: |
Fri, 18 Apr 2014 18:06:00 +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 586d5494ab8914df9d6f2b1bfac04573c705a217
Author: Sebastian Koslowski <address@hidden>
Date: Sat Mar 15 17:07:09 2014 +0100
grc: new tools menu to execute gr_filter_design
---
grc/gui/ActionHandler.py | 26 +++++++++++++++++---------
grc/gui/Actions.py | 5 +++++
grc/gui/Bars.py | 3 +++
3 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py
index aa692f5..65969e0 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
@@ -116,6 +117,7 @@ class ActionHandler:
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,
): action.set_sensitive(True)
if ParseXML.xml_failures:
Messages.send_xml_errors_if_any(ParseXML.xml_failures)
@@ -485,23 +487,29 @@ class ActionHandler:
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
##################################################
diff --git a/grc/gui/Actions.py b/grc/gui/Actions.py
index afbeb97..97681ec 100644
--- a/grc/gui/Actions.py
+++ b/grc/gui/Actions.py
@@ -365,3 +365,8 @@ XML_PARSER_ERRORS_DISPLAY = Action(
tooltip='View errors that occured while parsing XML files',
stock_id=gtk.STOCK_DIALOG_ERROR,
)
+TOOLS_RUN_FDESIGN = Action(
+ label='Filter design tool',
+ tooltip='Execute gr_filter_design',
+ stock_id=gtk.STOCK_EXECUTE,
+)
diff --git a/grc/gui/Bars.py b/grc/gui/Bars.py
index ef8feb0..ce72ede 100644
--- a/grc/gui/Bars.py
+++ b/grc/gui/Bars.py
@@ -101,6 +101,9 @@ MENU_BAR_LIST = (
Actions.FLOW_GRAPH_EXEC,
Actions.FLOW_GRAPH_KILL,
]),
+ (gtk.Action('Tools', '_Tools', None, None), [
+ Actions.TOOLS_RUN_FDESIGN,
+ ]),
(gtk.Action('Help', '_Help', None, None), [
Actions.HELP_WINDOW_DISPLAY,
Actions.TYPES_WINDOW_DISPLAY,