From 72e28a934bc26b5f9c9b8ac6d917aad5eb76b51d Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Thu, 19 Mar 2009 03:47:04 +0000 Subject: 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 --- (limited to 'src/sugar/tutorius/actions.py') 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() + -- cgit v0.9.1