From b960533fb4a012ae115164812e275391c9140ce7 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 20 Dec 2006 23:42:16 -0500 Subject: [PATCH] Convert shared activity type to an activity bundle service name for activation via DBus --- shell/view/Shell.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/shell/view/Shell.py b/shell/view/Shell.py index b2a1ab45..dad78be8 100644 --- a/shell/view/Shell.py +++ b/shell/view/Shell.py @@ -201,8 +201,22 @@ class Shell(gobject.GObject): activity_ps = pservice.get_activity(activity_id) if activity_ps: - activity = ActivityFactory.create(bundle_id) - activity.join(activity_ps.object_path()) + # Get the service name for this activity, if + # we have a bundle on the system capable of handling + # this activity type + breg = self._model.get_bundle_registry() + bundle = breg.find_by_default_type(bundle_id) + if bundle: + serv_name = bundle.get_service_name() + try: + activity = ActivityFactory.create(serv_name) + except DBusException, e: + logging.error("Couldn't launch activity %s:\n%s" % (serv_name, e)) + else: + logging.debug("Joining activity type %s id %s" % (serv_name, activity_id)) + activity.join(activity_ps.object_path()) + else: + logging.error("Couldn't find activity for type %s" % bundle_id) else: logging.error('Cannot start activity.')