Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib/sugar/activity
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sugar/activity')
-rw-r--r--lib/sugar/activity/activity.py10
-rw-r--r--lib/sugar/activity/activityfactory.py2
-rw-r--r--lib/sugar/activity/registry.py10
3 files changed, 18 insertions, 4 deletions
diff --git a/lib/sugar/activity/activity.py b/lib/sugar/activity/activity.py
index 7c44981..96e757a 100644
--- a/lib/sugar/activity/activity.py
+++ b/lib/sugar/activity/activity.py
@@ -76,6 +76,10 @@ SCOPE_PRIVATE = "private"
SCOPE_INVITE_ONLY = "invite" # shouldn't be shown in UI, it's implicit when you invite somebody
SCOPE_NEIGHBORHOOD = "public"
+J_DBUS_SERVICE = 'org.laptop.Journal'
+J_DBUS_PATH = '/org/laptop/Journal'
+J_DBUS_INTERFACE = 'org.laptop.Journal'
+
class ActivityToolbar(gtk.Toolbar):
"""The Activity toolbar with the Journal entry title, sharing, Keep and Stop buttons
@@ -905,3 +909,9 @@ def get_activity_root():
return os.environ['SUGAR_ACTIVITY_ROOT']
else:
raise RuntimeError("No SUGAR_ACTIVITY_ROOT set.")
+
+def show_object_in_journal(object_id):
+ bus = dbus.SessionBus()
+ obj = bus.get_object(J_DBUS_SERVICE, J_DBUS_PATH)
+ journal = dbus.Interface(obj, J_DBUS_INTERFACE)
+ journal.ShowObject(object_id)
diff --git a/lib/sugar/activity/activityfactory.py b/lib/sugar/activity/activityfactory.py
index 119dcea..835ec13 100644
--- a/lib/sugar/activity/activityfactory.py
+++ b/lib/sugar/activity/activityfactory.py
@@ -270,7 +270,7 @@ class ActivityCreationHandler(gobject.GObject):
def _activate_error_handler(self, err):
logging.error("Activity activation request failed %s" % err)
- def _create_reply_handler(self, xid):
+ def _create_reply_handler(self):
logging.debug("Activity created %s (%s)." %
(self._handle.activity_id, self._service_name))
diff --git a/lib/sugar/activity/registry.py b/lib/sugar/activity/registry.py
index c21d4a5..ac672d5 100644
--- a/lib/sugar/activity/registry.py
+++ b/lib/sugar/activity/registry.py
@@ -29,15 +29,17 @@ def _activity_info_from_dict(info_dict):
if not info_dict:
return None
return ActivityInfo(info_dict['name'], info_dict['icon'],
- info_dict['bundle_id'], info_dict['path'],
- info_dict['show_launcher'], info_dict['command'])
+ info_dict['bundle_id'], info_dict['version'],
+ info_dict['path'], info_dict['show_launcher'],
+ info_dict['command'])
class ActivityInfo(object):
- def __init__(self, name, icon, bundle_id,
+ def __init__(self, name, icon, bundle_id, version,
path, show_launcher, command):
self.name = name
self.icon = icon
self.bundle_id = bundle_id
+ self.version = version
self.path = path
self.command = command
self.show_launcher = show_launcher
@@ -146,6 +148,8 @@ class ActivityRegistry(gobject.GObject):
self._mime_type_to_activities.clear()
def remove_bundle(self, bundle_path):
+ self._service_name_to_activity_info.clear()
+ self._mime_type_to_activities.clear()
return self._registry.RemoveBundle(bundle_path)
def _activity_removed_cb(self, info_dict):