diff options
author | Dan Williams <dcbw@localhost.localdomain> | 2006-12-21 04:42:16 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@localhost.localdomain> | 2006-12-21 04:42:16 (GMT) |
commit | b960533fb4a012ae115164812e275391c9140ce7 (patch) | |
tree | a27078ef1bef3fd1fd6244fbb32495bfdfc505a2 /shell | |
parent | e586cd66c005e7ccb2af7244fe8be393befcf010 (diff) |
Convert shared activity type to an activity bundle service name for activation via DBus
Diffstat (limited to 'shell')
-rw-r--r-- | shell/view/Shell.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/shell/view/Shell.py b/shell/view/Shell.py index b2a1ab4..dad78be 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.') |