diff options
author | mike <michael.jmontcalm@gmail.com> | 2009-11-06 03:06:06 (GMT) |
---|---|---|
committer | mike <michael.jmontcalm@gmail.com> | 2009-11-06 03:06:06 (GMT) |
commit | c7c7f94fc5d7e9f7e4f175c06dd52628aa357e3d (patch) | |
tree | 25008422c07d68028c0c64d8f41c0fbef54e9ade /addons/WidgetIdentifier.py | |
parent | fe07a6fa0fa0d67d2ada6be1f3da2cb128f9038b (diff) | |
parent | 74dcbcb643cfd66df071020320ba6c0004e92c17 (diff) |
Merge branch 'lp448319' of ../mainline
Conflicts:
addons/readfile.py
tests/probetests.py
tests/run-tests.py
tutorius/TProbe.py
tutorius/constraints.py
tutorius/core.py
tutorius/engine.py
tutorius/properties.py
tutorius/service.py
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" : [] +} |