diff options
Diffstat (limited to 'tutorius/engine.py')
-rw-r--r-- | tutorius/engine.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tutorius/engine.py b/tutorius/engine.py index 39cfeeb..2c10c80 100644 --- a/tutorius/engine.py +++ b/tutorius/engine.py @@ -38,6 +38,10 @@ RUNNER_STATE_AWAITING_NOTIFICATIONS = "awaiting_notification" RUNNER_STATE_UNINSTALLING_ACTIONS = "uninstalling_actions" RUNNER_STATE_UNSUBSCRIBING_EVENTS = "unsubscribing_events" +SUGAR_HOME = "org.sugar.desktop.home" +SUGAR_MESH = "org.sugar.desktop.mesh" +SUGAR_GROUP = "org.sugar.desktop.group" + LOGGER = logging.getLogger("sugar.tutorius.engine") class TutorialRunner(object): @@ -317,10 +321,21 @@ class Engine: #Get the active activity from the shell activity = self._shell.get_active_activity() - #TProbes automatically use the bundle id, available from the ActivityBundle - bundle = ActivityBundle(activity.get_bundle_path()) - - self._tutorial._activity_id = bundle.get_bundle_id() #HACK until we have activity id's in action/events + if activity and activity.get_bundle_path(): + #TProbes automatically use the bundle id, available from the ActivityBundle + bundle = ActivityBundle(activity.get_bundle_path()) + + self._tutorial._activity_id = bundle.get_bundle_id() #HACK until we have activity id's in action/events + else: + zoom_level = self._shell.zoom_level + if zoom_level == self._shell.ZOOM_MESH: + self._tutorial._activity_id = SUGAR_MESH + elif zoom_level == self._shell.ZOOM_GROUP: + self._tutorial._activity_id = SUGAR_GROUP + elif zoom_level == self._shell.ZOOM_HOME: + self._tutorial._activity_id = SUGAR_HOME + else: + self._tutorial._activity_id = "org.laptop.JournalActivity" self._tutorial.start() |