From bd86aee0d4ab8a989ae19a7959e65d563228709a Mon Sep 17 00:00:00 2001 From: Bert Freudenberg Date: Wed, 20 Jun 2007 09:52:29 +0000 Subject: use activity_id in service name - construct service name from activity id instead of X window id - cleanup unused declarations in activityfactory.py - remove obsolete _dbus_name_owner_changed_cb() - see http://dev.laptop.org/ticket/1767 - cleared by marcopg --- (limited to 'sugar/activity') diff --git a/sugar/activity/activityfactory.py b/sugar/activity/activityfactory.py index 809a74d..2cdf9a1 100644 --- a/sugar/activity/activityfactory.py +++ b/sugar/activity/activityfactory.py @@ -26,10 +26,6 @@ from sugar.presence import presenceservice from sugar.activity.activityhandle import ActivityHandle from sugar import util -_ACTIVITY_SERVICE_NAME = "org.laptop.Activity" -_ACTIVITY_SERVICE_PATH = "/org/laptop/Activity" -_ACTIVITY_INTERFACE = "org.laptop.Activity" - _ACTIVITY_FACTORY_INTERFACE = "org.laptop.ActivityFactory" def create_activity_id(): diff --git a/sugar/activity/activityservice.py b/sugar/activity/activityservice.py index f456581..3251177 100644 --- a/sugar/activity/activityservice.py +++ b/sugar/activity/activityservice.py @@ -33,24 +33,21 @@ class ActivityService(dbus.service.Object): def __init__(self, activity): """Initialise the service for the given activity - activity -- sugar.activity.activity.Activity instance, - must have already bound it's window (i.e. it must - have already initialised to the point of having - the X window available). + activity -- sugar.activity.activity.Activity instance - Creates dbus services that use the xid of the activity's - root window as discriminants among all active services + Creates dbus services that use the instance's activity_id + as discriminants among all active services of this type. That is, the services are all available - as names/paths derived from the xid for the window. + as names/paths derived from the instance's activity_id. The various methods exposed on dbus are just forwarded to the client Activity object's equally-named methods. """ activity.realize() - xid = activity.window.xid - service_name = _ACTIVITY_SERVICE_NAME + '%d' % xid - object_path = _ACTIVITY_SERVICE_PATH + "/%s" % xid + activity_id = activity.get_id() + service_name = _ACTIVITY_SERVICE_NAME + activity_id + object_path = _ACTIVITY_SERVICE_PATH + "/" + activity_id bus = dbus.SessionBus() bus_name = dbus.service.BusName(service_name, bus=bus) -- cgit v0.9.1