Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/tutorius/actions.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sugar/tutorius/actions.py')
-rw-r--r--src/sugar/tutorius/actions.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sugar/tutorius/actions.py b/src/sugar/tutorius/actions.py
index 7681dea..2c76bd7 100644
--- a/src/sugar/tutorius/actions.py
+++ b/src/sugar/tutorius/actions.py
@@ -229,3 +229,24 @@ class ChainAction(Action):
for act in reversed(self._actions):
act.undo()
+class DisableWidgetAction(Action):
+ def __init__(self, target):
+ """Constructor
+ @param target target treeish
+ """
+ Action.__init__(self)
+ self._target = target
+ self._widget = None
+
+ def do(self):
+ """Action do"""
+ os = ObjectStore()
+ if os.activity:
+ self._widget = gtkutils.find_widget(os.activity, self._target)
+ if self._widget:
+ self._widget.set_sensitive(False)
+
+ def undo(self):
+ """Action undo"""
+ if self._widget:
+ self._widget.set_sensitive(True)