diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-08-08 16:08:07 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-08-08 16:08:07 (GMT) |
commit | fa8bcd2ba58fca8605bc2fea72478a23f9bd9998 (patch) | |
tree | 5a1f5702a5847b8f7cb80684d0c2dd9f92e9f13d /shell/shellservice.py | |
parent | bfcab6b0b64d1b10d4010c34596e748f54335ba9 (diff) |
Move the activity register to the clipboard service.
Diffstat (limited to 'shell/shellservice.py')
-rw-r--r-- | shell/shellservice.py | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/shell/shellservice.py b/shell/shellservice.py index 5728e44..d577a44 100644 --- a/shell/shellservice.py +++ b/shell/shellservice.py @@ -17,10 +17,7 @@ """D-bus service providing access to the shell's functionality""" import dbus -from model import bundleregistry - _DBUS_SERVICE = "org.laptop.Shell" -_DBUS_ACTIVITY_REGISTRY_IFACE = "org.laptop.Shell.ActivityRegistry" _DBUS_SHELL_IFACE = "org.laptop.Shell" _DBUS_OWNER_IFACE = "org.laptop.Shell.Owner" _DBUS_PATH = "/org/laptop/Shell" @@ -56,9 +53,6 @@ class ShellService(dbus.service.Object): self._home_model.connect('active-activity-changed', self._cur_activity_changed_cb) - bundle_registry = bundleregistry.get_registry() - bundle_registry.connect('bundle-added', self._bundle_added_cb) - bus = dbus.SessionBus() bus_name = dbus.service.BusName(_DBUS_SERVICE, bus=bus) dbus.service.Object.__init__(self, bus_name, _DBUS_PATH) @@ -83,60 +77,6 @@ class ShellService(dbus.service.Object): def NotifyLaunchFailure(self, activity_id): self._shell.notify_launch_failure(activity_id) - @dbus.service.method(_DBUS_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, - that is, the directory with activity/activity.info as a - child of the directory. - - The bundleregistry.BundleRegistry is responsible for setting - up a set of d-bus service mappings for each available activity. - """ - registry = bundleregistry.get_registry() - return registry.add_bundle(bundle_path) - - @dbus.service.method(_DBUS_ACTIVITY_REGISTRY_IFACE, - in_signature="s", out_signature="a{sv}") - def GetActivity(self, service_name): - registry = bundleregistry.get_registry() - bundle = registry.get_bundle(service_name) - if not bundle: - return {} - - return self._bundle_to_dict(bundle) - - @dbus.service.method(_DBUS_ACTIVITY_REGISTRY_IFACE, - in_signature="s", out_signature="aa{sv}") - def FindActivity(self, name): - result = [] - key = name.lower() - - for bundle in bundleregistry.get_registry(): - name = bundle.get_name().lower() - service_name = bundle.get_service_name().lower() - if name.find(key) != -1 or service_name.find(key) != -1: - result.append(self._bundle_to_dict(bundle)) - - return result - - @dbus.service.method(_DBUS_ACTIVITY_REGISTRY_IFACE, - in_signature="s", out_signature="aa{sv}") - def GetActivitiesForType(self, mime_type): - result = [] - - for bundle in bundleregistry.get_registry(): - if bundle.get_mime_types() and mime_type in bundle.get_mime_types(): - result.append(self._bundle_to_dict(bundle)) - - return result - - @dbus.service.signal(_DBUS_ACTIVITY_REGISTRY_IFACE, signature="a{sv}") - def ActivityAdded(self, activity_info): - pass - @dbus.service.signal(_DBUS_OWNER_IFACE, signature="s") def ColorChanged(self, color): pass @@ -169,12 +109,3 @@ class ShellService(dbus.service.Object): if new_id: self.CurrentActivityChanged(new_id) - def _bundle_to_dict(self, bundle): - return {'name': bundle.get_name(), - 'icon': bundle.get_icon(), - 'service_name': bundle.get_service_name(), - 'path': bundle.get_path()} - - def _bundle_added_cb(self, bundle_registry, bundle): - self.ActivityAdded(self._bundle_to_dict(bundle)) - |