Don't block on dbus for open_with_id either

This commit is contained in:
Dan Williams 2006-06-16 22:50:00 -04:00
parent d60a85e83a
commit 8746552ff7

View File

@ -30,17 +30,20 @@ class BrowserShell(dbus.service.Object):
links.append(link) links.append(link)
return links return links
def _start_browser_cb(self, browser): def _start_browser_cb(self, browser, activity_id):
browser.connect_to_shell() if activity_id:
browser.connect_to_shell(activity_id)
else:
browser.connect_to_shell()
@dbus.service.method('com.redhat.Sugar.BrowserShell') @dbus.service.method('com.redhat.Sugar.BrowserShell')
def open_browser(self, uri): def open_browser(self, uri):
browser = BrowserActivity(uri) browser = BrowserActivity(uri)
self.__browsers.append(browser) self.__browsers.append(browser)
gobject.idle_add(self._start_browser_cb, browser) gobject.idle_add(self._start_browser_cb, browser, None)
@dbus.service.method('com.redhat.Sugar.BrowserShell') @dbus.service.method('com.redhat.Sugar.BrowserShell')
def open_browser_with_id(self, uri, activity_id): def open_browser_with_id(self, uri, activity_id):
browser = BrowserActivity(uri) browser = BrowserActivity(uri)
self.__browsers.append(browser) self.__browsers.append(browser)
browser.connect_to_shell(activity_id) gobject.idle_add(self._start_browser_cb, browser, activity_id)