Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-08-15 10:19:29 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-08-15 10:19:29 (GMT)
commitc54fb84b28cca54c7d0cb0355b7a21f3cbabfc4d (patch)
tree6511f37709c0feb2bcd2206a76e51bf66cdc436f /sugar
parent43fb1627a7ce9a5e05230699cda7448c44f5c689 (diff)
#2543: Offer multiple activities for opening clipboard objects.
Diffstat (limited to 'sugar')
-rw-r--r--sugar/clipboard/clipboardservice.py10
-rw-r--r--sugar/datastore/datastore.py3
2 files changed, 8 insertions, 5 deletions
diff --git a/sugar/clipboard/clipboardservice.py b/sugar/clipboard/clipboardservice.py
index dbdf41d..0e357fe 100644
--- a/sugar/clipboard/clipboardservice.py
+++ b/sugar/clipboard/clipboardservice.py
@@ -23,7 +23,7 @@ NAME_KEY = 'NAME'
PERCENT_KEY = 'PERCENT'
ICON_KEY = 'ICON'
PREVIEW_KEY = 'PREVIEW'
-ACTIVITY_KEY = 'ACTIVITY'
+ACTIVITIES_KEY = 'ACTIVITIES'
FORMATS_KEY = 'FORMATS'
TYPE_KEY = 'TYPE'
@@ -51,7 +51,7 @@ class ClipboardService(gobject.GObject):
'object-deleted': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
([str])),
'object-state-changed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
- ([str, str, int, str, str, str])),
+ ([str, str, int, str, str, object])),
}
def __init__(self):
@@ -118,13 +118,13 @@ class ClipboardService(gobject.GObject):
percent
icon
preview
- activity
+ activities
From the ClipboardObject instance which is being described.
"""
self.emit('object-state-changed', str(object_id), values[NAME_KEY],
values[PERCENT_KEY], values[ICON_KEY], values[PREVIEW_KEY],
- values[ACTIVITY_KEY])
+ values[ACTIVITIES_KEY])
def add_object(self, name):
"""Add a new object to the path
@@ -193,7 +193,7 @@ class ClipboardService(gobject.GObject):
PERCENT_KEY: number,
ICON_KEY: str,
PREVIEW_KEY: XXX what is it?,
- ACTIVITY_KEY: source activity id,
+ ACTIVITIES_KEY: activities that can open this object,
FORMATS_KEY: list of XXX what is it?
"""
return self._dbus_service.get_object(dbus.ObjectPath(object_id),)
diff --git a/sugar/datastore/datastore.py b/sugar/datastore/datastore.py
index 5ba994d..0dbe35b 100644
--- a/sugar/datastore/datastore.py
+++ b/sugar/datastore/datastore.py
@@ -120,6 +120,9 @@ class DSObject(object):
def resume(self, service_name=None):
if self.is_bundle():
+ if service_name is not None:
+ raise ValueError('Object is a bundle, cannot be resumed as an activity.')
+
bundle = Bundle(self.file_path)
if not bundle.is_installed():
bundle.install()