diff options
author | Dan Williams <dcbw@redhat.com> | 2006-06-18 05:31:55 (GMT) |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2006-06-18 05:31:55 (GMT) |
commit | 4e6cbab48e4e7eadf2cd443d1eaaf58dd48b03a9 (patch) | |
tree | 9454dd82565f76b80a9d87a54e6052e40381294e /sugar/browser | |
parent | 9f1c77a55abfaafdac7912df1ddff07fe7ea3a01 (diff) |
Pass a serialized Service object through when joining an activity
Diffstat (limited to 'sugar/browser')
-rw-r--r-- | sugar/browser/BrowserActivity.py | 7 | ||||
-rw-r--r-- | sugar/browser/BrowserShell.py | 20 |
2 files changed, 15 insertions, 12 deletions
diff --git a/sugar/browser/BrowserActivity.py b/sugar/browser/BrowserActivity.py index 905b4eb..8b71967 100644 --- a/sugar/browser/BrowserActivity.py +++ b/sugar/browser/BrowserActivity.py @@ -111,9 +111,10 @@ class BrowserActivity(activity.Activity): vbox.show() - # FIXME remove, when we join the activity this will happen automatically - self._pservice.track_activity(self.get_id()) - + # Join the shared activity if we were started from one + if self._initial_service: + self._pservice.join_shared_activity(self._initial_service) + def get_embed(self): return self.embed diff --git a/sugar/browser/BrowserShell.py b/sugar/browser/BrowserShell.py index 42f2ccd..bf7c873 100644 --- a/sugar/browser/BrowserShell.py +++ b/sugar/browser/BrowserShell.py @@ -8,6 +8,7 @@ import gobject import sugar.env from sugar.browser.BrowserActivity import BrowserActivity +from sugar.presence import Service class BrowserShell(dbus.service.Object): def __init__(self, bus_name, object_path = '/com/redhat/Sugar/Browser'): @@ -30,20 +31,21 @@ class BrowserShell(dbus.service.Object): links.append(link) return links - def _start_browser_cb(self, browser, activity_id): - if activity_id: - browser.connect_to_shell(activity_id) - else: - browser.connect_to_shell() + def _start_browser_cb(self, browser, service): + browser.connect_to_shell(service) @dbus.service.method('com.redhat.Sugar.BrowserShell') - def open_browser(self, uri): + def open_browser(self, uri, serialized_service=None): + service = None + if serialized_service is not None: + serivce = Service.deserialize(serialized_service) browser = BrowserActivity(uri) self.__browsers.append(browser) - gobject.idle_add(self._start_browser_cb, browser, None) + gobject.idle_add(self._start_browser_cb, browser, service) @dbus.service.method('com.redhat.Sugar.BrowserShell') - def open_browser_with_id(self, uri, activity_id): + def open_browser_from_service_foobar(self, uri, serialized_service): + serivce = Service.deserialize(serialized_service) browser = BrowserActivity(uri) self.__browsers.append(browser) - gobject.idle_add(self._start_browser_cb, browser, activity_id) + gobject.idle_add(self._start_browser_cb, browser, service) |