summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2009-09-13 02:29:26 -0700
committerJosh Blum2009-09-13 02:29:26 -0700
commit8442dfc877a89de00e5fd0fd1b4b1890a91af630 (patch)
tree22259eec7d2d51634998ad489ac862fa1051f4c7
parent91a83e6f1fda6483bfd4b449a1ef7903a00af0ab (diff)
downloadgnuradio-8442dfc877a89de00e5fd0fd1b4b1890a91af630.tar.gz
gnuradio-8442dfc877a89de00e5fd0fd1b4b1890a91af630.tar.bz2
gnuradio-8442dfc877a89de00e5fd0fd1b4b1890a91af630.zip
Simply Actions module imports, using module prefix.
-rw-r--r--grc/gui/FlowGraph.py17
-rw-r--r--grc/gui/MainWindow.py15
-rw-r--r--grc/gui/NotebookPage.py4
-rw-r--r--grc/gui/StateCache.py6
4 files changed, 18 insertions, 24 deletions
diff --git a/grc/gui/FlowGraph.py b/grc/gui/FlowGraph.py
index c90071f23..8feb171f1 100644
--- a/grc/gui/FlowGraph.py
+++ b/grc/gui/FlowGraph.py
@@ -18,10 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
from Constants import SCROLL_PROXIMITY_SENSITIVITY, SCROLL_DISTANCE
-from Actions import \
- ELEMENT_CREATE, ELEMENT_SELECT, \
- BLOCK_PARAM_MODIFY, BLOCK_MOVE, \
- ELEMENT_DELETE
+import Actions
import Colors
import Utils
from Element import Element
@@ -86,7 +83,7 @@ class FlowGraph(Element):
block.set_coordinate(coor)
block.set_rotation(0)
block.get_param('id').set_value(id)
- ELEMENT_CREATE()
+ Actions.ELEMENT_CREATE()
###########################################################################
# Copy Paste
@@ -409,7 +406,7 @@ class FlowGraph(Element):
self._old_selected_port is not self._new_selected_port:
try:
self.connect(self._old_selected_port, self._new_selected_port)
- ELEMENT_CREATE()
+ Actions.ELEMENT_CREATE()
except: Messages.send_fail_connection()
self._old_selected_port = None
self._new_selected_port = None
@@ -424,7 +421,7 @@ class FlowGraph(Element):
self._selected_elements = list(
set.union(old_elements, new_elements) - set.intersection(old_elements, new_elements)
)
- ELEMENT_SELECT()
+ Actions.ELEMENT_SELECT()
##########################################################################
## Event Handlers
@@ -446,7 +443,7 @@ class FlowGraph(Element):
#double click detected, bring up params dialog if possible
if double_click and self.get_selected_block():
self.mouse_pressed = False
- BLOCK_PARAM_MODIFY()
+ Actions.BLOCK_PARAM_MODIFY()
def handle_mouse_button_release(self, left_click, coordinate):
"""
@@ -457,7 +454,7 @@ class FlowGraph(Element):
self.time = 0
self.mouse_pressed = False
if self.element_moved:
- BLOCK_MOVE()
+ Actions.BLOCK_MOVE()
self.element_moved = False
self.update_selected_elements()
@@ -487,7 +484,7 @@ class FlowGraph(Element):
adj.emit('changed')
#remove the connection if selected in drag event
if len(self.get_selected_elements()) == 1 and self.get_selected_element().is_connection():
- ELEMENT_DELETE()
+ Actions.ELEMENT_DELETE()
#move the selected elements and record the new coordinate
X, Y = self.get_coordinate()
if not self.get_ctrl_mask(): self.move_selected((int(x - X), int(y - Y)))
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py
index 39cd84da9..9fcbe2a6c 100644
--- a/grc/gui/MainWindow.py
+++ b/grc/gui/MainWindow.py
@@ -19,10 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
from Constants import \
NEW_FLOGRAPH_TITLE, DEFAULT_REPORTS_WINDOW_WIDTH
-from Actions import \
- APPLICATION_QUIT, FLOW_GRAPH_KILL, \
- FLOW_GRAPH_SAVE, PAGE_CHANGE, \
- get_accel_group
+import Actions
import pygtk
pygtk.require('2.0')
import gtk
@@ -80,7 +77,7 @@ class MainWindow(gtk.Window):
self.hpaned = gtk.HPaned()
self.add(vbox)
#create the menu bar and toolbar
- self.add_accel_group(get_accel_group())
+ self.add_accel_group(Actions.get_accel_group())
vbox.pack_start(Bars.MenuBar(), False)
vbox.pack_start(Bars.Toolbar(), False)
vbox.pack_start(self.hpaned)
@@ -123,7 +120,7 @@ class MainWindow(gtk.Window):
This method in turns calls the state handler to quit.
@return true
"""
- APPLICATION_QUIT()
+ Actions.APPLICATION_QUIT()
return True
def _handle_page_change(self, notebook, page, page_num):
@@ -137,7 +134,7 @@ class MainWindow(gtk.Window):
"""
self.current_page = self.notebook.get_nth_page(page_num)
Messages.send_page_switch(self.current_page.get_file_path())
- PAGE_CHANGE()
+ Actions.PAGE_CHANGE()
############################################################
# Report Window
@@ -223,12 +220,12 @@ class MainWindow(gtk.Window):
self._set_page(self.page_to_be_closed)
#unsaved? ask the user
if not self.page_to_be_closed.get_saved() and self._save_changes():
- FLOW_GRAPH_SAVE() #try to save
+ Actions.FLOW_GRAPH_SAVE() #try to save
if not self.page_to_be_closed.get_saved(): #still unsaved?
self.page_to_be_closed = None #set the page to be closed back to None
return
#stop the flow graph if executing
- if self.page_to_be_closed.get_pid(): FLOW_GRAPH_KILL()
+ if self.page_to_be_closed.get_pid(): Actions.FLOW_GRAPH_KILL()
#remove the page
self.notebook.remove_page(self.notebook.page_num(self.page_to_be_closed))
if ensure and self.notebook.get_n_pages() == 0: self.new_page() #no pages, make a new one
diff --git a/grc/gui/NotebookPage.py b/grc/gui/NotebookPage.py
index 645af3f7f..fddfeaf5f 100644
--- a/grc/gui/NotebookPage.py
+++ b/grc/gui/NotebookPage.py
@@ -17,10 +17,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from Actions import FLOW_GRAPH_CLOSE
import pygtk
pygtk.require('2.0')
import gtk
+import Actions
from StateCache import StateCache
from Constants import MIN_WINDOW_WIDTH, MIN_WINDOW_HEIGHT
from DrawingArea import DrawingArea
@@ -103,7 +103,7 @@ class NotebookPage(gtk.HBox):
@param the button
"""
self.main_window.page_to_be_closed = self
- FLOW_GRAPH_CLOSE()
+ Actions.FLOW_GRAPH_CLOSE()
def set_markup(self, markup):
"""
diff --git a/grc/gui/StateCache.py b/grc/gui/StateCache.py
index 60ab3a6b4..3f6b79224 100644
--- a/grc/gui/StateCache.py
+++ b/grc/gui/StateCache.py
@@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
-from Actions import FLOW_GRAPH_UNDO, FLOW_GRAPH_REDO
+import Actions
from Constants import STATE_CACHE_SIZE
class StateCache(object):
@@ -88,5 +88,5 @@ class StateCache(object):
"""
Update the undo and redo actions based on the number of next and prev states.
"""
- FLOW_GRAPH_REDO.set_sensitive(self.num_next_states != 0)
- FLOW_GRAPH_UNDO.set_sensitive(self.num_prev_states != 0)
+ Actions.FLOW_GRAPH_REDO.set_sensitive(self.num_next_states != 0)
+ Actions.FLOW_GRAPH_UNDO.set_sensitive(self.num_prev_states != 0)