diff options
author | Vincent Vinet <vince.vinet@gmail.com> | 2009-09-20 14:02:06 (GMT) |
---|---|---|
committer | Vincent Vinet <vince.vinet@gmail.com> | 2009-10-01 15:27:42 (GMT) |
commit | 06db96e9dd4172484f9a028d0b5a1bc7c97664ee (patch) | |
tree | 6a87ff1cac650baf307719d99c7ee14a1ee3d5ec /addons/WidgetIdentifier.py | |
parent | 09b2ea3369df967309f030f9196c2f9861bc1b2c (diff) |
merge in erick's TProbe work, add a very basic unit test
Diffstat (limited to 'addons/WidgetIdentifier.py')
-rw-r--r-- | addons/WidgetIdentifier.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/addons/WidgetIdentifier.py b/addons/WidgetIdentifier.py new file mode 100644 index 0000000..3c559b5 --- /dev/null +++ b/addons/WidgetIdentifier.py @@ -0,0 +1,35 @@ +from sugar.tutorius.actions import Action +from sugar.tutorius.editor import WidgetIdentifier as WIPrimitive +from sugar.tutorius.services import ObjectStore + +class WidgetIdentifier(Action): + def __init__(self): + Action.__init__(self) + self.activity = None + self._dialog = None + + def do(self): + os = ObjectStore() + if os.activity: + self.activity = os.activity + + self._dialog = WIPrimitive(self.activity) + self._dialog.show() + + + def undo(self): + if self._dialog: + # TODO elavoie 2009-07-19 + # We should disconnect the handlers, however there seems to be an error + # saying that the size of the dictionary changed during the iteration + # We should investigate this + #self._dialog._disconnect_handlers() + self._dialog.destroy() + +__action__ = { + "name" : "WidgetIdentifier", + "display_name" : "Widget Identifier", + "icon" : "message-bubble", + "class" : WidgetIdentifier, + "mandatory_props" : [] +} |