Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Vinet <vince.vinet@gmail.com>2009-03-25 18:37:34 (GMT)
committer Vincent Vinet <vince.vinet@gmail.com>2009-03-31 14:02:59 (GMT)
commit2c329ce95146f2a27e154f407bb649cc2b557b66 (patch)
tree9af3e067fd40adbd1f808c0e97240b032771a1c3
parent474d482f53ca7fc89183993d9a0992b71cfcfc02 (diff)
Add the disable widget action
-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 60ccd8b..a2e8aeb 100644
--- a/src/sugar/tutorius/actions.py
+++ b/src/sugar/tutorius/actions.py
@@ -214,3 +214,24 @@ class WidgetIdentifyAction(Action):
self._dialog.destroy()
+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)