Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/services/shell/activityregistryservice.py
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-10-04 20:46:32 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-10-04 20:46:32 (GMT)
commit32ecdd8ad628edd6affa6a0d4496a121b5a67a53 (patch)
treecfd8621c09d5e4db6f6d29a70028c921ae13ac4c /services/shell/activityregistryservice.py
parent5ca3b9081a32cc9e947700107ee26ccce06ede88 (diff)
parent2bcbde6e441ee5ab5743f6b45b5f85e85bbb644f (diff)
Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
Diffstat (limited to 'services/shell/activityregistryservice.py')
-rw-r--r--services/shell/activityregistryservice.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/services/shell/activityregistryservice.py b/services/shell/activityregistryservice.py
index 44c9969..c379071 100644
--- a/services/shell/activityregistryservice.py
+++ b/services/shell/activityregistryservice.py
@@ -32,13 +32,14 @@ class ActivityRegistry(dbus.service.Object):
bundle_registry = bundleregistry.get_registry()
bundle_registry.connect('bundle-added', self._bundle_added_cb)
+ bundle_registry.connect('bundle-removed', self._bundle_removed_cb)
@dbus.service.method(_ACTIVITY_REGISTRY_IFACE,
in_signature='s', out_signature='b')
def AddBundle(self, bundle_path):
'''Register the activity bundle with the global registry
- bundle_path -- path to the activity bundle's root directory,
+ bundle_path -- path to the root directory of the activity bundle,
that is, the directory with activity/activity.info as a
child of the directory.
@@ -49,6 +50,16 @@ class ActivityRegistry(dbus.service.Object):
return registry.add_bundle(bundle_path)
@dbus.service.method(_ACTIVITY_REGISTRY_IFACE,
+ in_signature='s', out_signature='b')
+ def RemoveBundle(self, bundle_path):
+ '''Unregister the activity bundle with the global registry
+
+ bundle_path -- path to the activity bundle root directory
+ '''
+ registry = bundleregistry.get_registry()
+ return registry.remove_bundle(bundle_path)
+
+ @dbus.service.method(_ACTIVITY_REGISTRY_IFACE,
in_signature='', out_signature='aa{sv}')
def GetActivities(self):
result = []
@@ -94,6 +105,10 @@ class ActivityRegistry(dbus.service.Object):
def ActivityAdded(self, activity_info):
pass
+ @dbus.service.signal(_ACTIVITY_REGISTRY_IFACE, signature='a{sv}')
+ def ActivityRemoved(self, activity_info):
+ pass
+
def _bundle_to_dict(self, bundle):
return {'name': bundle.get_name(),
'icon': bundle.get_icon(),
@@ -104,6 +119,9 @@ class ActivityRegistry(dbus.service.Object):
def _bundle_added_cb(self, bundle_registry, bundle):
self.ActivityAdded(self._bundle_to_dict(bundle))
+ def _bundle_removed_cb(self, bundle_registry, bundle):
+ self.ActivityRemoved(self._bundle_to_dict(bundle))
+
_instance = None
def get_instance():