diff options
author | Vincent Vinet <vince.vinet@gmail.com> | 2009-03-19 03:47:04 (GMT) |
---|---|---|
committer | Vincent Vinet <vince.vinet@gmail.com> | 2009-03-19 18:23:13 (GMT) |
commit | 72e28a934bc26b5f9c9b8ac6d917aad5eb76b51d (patch) | |
tree | 121f8ec9b365f82f367e920113b6fb85f2157fe5 /src/sugar/tutorius/actions.py | |
parent | cd4b5c8d01e68f170c783b638ad24992dbba8aea (diff) |
Add the Widget Identifier and corresponding Action
Make Writus use it
Fix a dupe in the ActivityToolbar
Use the ObjectStore in tutorial.attach()
Do a rebase onto master and hope it works
Diffstat (limited to 'src/sugar/tutorius/actions.py')
-rw-r--r-- | src/sugar/tutorius/actions.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/sugar/tutorius/actions.py b/src/sugar/tutorius/actions.py index da8219e..12de298 100644 --- a/src/sugar/tutorius/actions.py +++ b/src/sugar/tutorius/actions.py @@ -16,11 +16,13 @@ """ This module defines Actions that can be done and undone on a state """ +from gettext import gettext as _ from sugar.tutorius import gtkutils from dialog import TutoriusDialog -from sugar.tutorius.services import ObjectStore import overlayer +from sugar.tutorius.editor import WidgetIdentifier +from sugar.tutorius.services import ObjectStore class Action(object): @@ -149,4 +151,23 @@ class BubbleMessage(Action): if self._bubble: self._bubble.destroy() self._bubble = None + +class WidgetIdentifyAction(Action): + def __init__(self): + self.activity = None + self._dialog = None + + def do(self): + os = ObjectStore() + if os.activity: + self.activity = os.activity + + self._dialog = WidgetIdentifier(self.activity) + self._dialog.show() + + + def undo(self): + if self._dialog: + self._dialog.destroy() + |