From 91a83e6f1fda6483bfd4b449a1ef7903a00af0ab Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 13 Sep 2009 02:14:27 -0700 Subject: Reworked actions api and actions objects: Created standardized Action object for all gui actions. Actions module constants are actual Action objects (not strings). Keypresses, labels, tooltips, stock icons, etc all associate in the Action constructor. Usage of the action's signaling call () eliminated the need for a reference to handle_states. --- grc/gui/StateCache.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grc/gui/StateCache.py') diff --git a/grc/gui/StateCache.py b/grc/gui/StateCache.py index 04b18b18a..60ab3a6b4 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, get_action_from_name +from Actions import FLOW_GRAPH_UNDO, FLOW_GRAPH_REDO 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. """ - get_action_from_name(FLOW_GRAPH_REDO).set_sensitive(self.num_next_states != 0) - get_action_from_name(FLOW_GRAPH_UNDO).set_sensitive(self.num_prev_states != 0) + FLOW_GRAPH_REDO.set_sensitive(self.num_next_states != 0) + FLOW_GRAPH_UNDO.set_sensitive(self.num_prev_states != 0) -- cgit From 8442dfc877a89de00e5fd0fd1b4b1890a91af630 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 13 Sep 2009 02:29:26 -0700 Subject: Simply Actions module imports, using module prefix. --- grc/gui/StateCache.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grc/gui/StateCache.py') 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) -- cgit