Add an handle argument to the factory and to the activity constructor.

This commit is contained in:
Marco Pesenti Gritti
2007-02-22 00:07:08 +01:00
parent d4639a1764
commit 5cf2b49cc1
6 changed files with 61 additions and 20 deletions
+5 -9
View File
@@ -20,7 +20,7 @@ import gobject
import wnck
from view.home.HomeWindow import HomeWindow
from sugar.presence import PresenceService
from sugar.activity.activityhandle import ActivityHandle
from sugar.graphics.popupcontext import PopupContext
from view.ActivityHost import ActivityHost
from sugar.activity import activityfactory
@@ -60,8 +60,6 @@ class Shell(gobject.GObject):
self._frame = Frame(self)
self._frame.show_and_hide(3)
self._pservice = PresenceService.get_instance()
self.start_activity('org.laptop.JournalActivity')
def _activity_added_cb(self, home_model, home_activity):
@@ -117,11 +115,6 @@ class Shell(gobject.GObject):
activity.present()
return
activity_ps = self._pservice.get_activity(activity_id)
if not activity_ps:
logging.error("Couldn't find shared activity for %s" % activity_id)
return
# Get the service name for this activity, if
# we have a bundle on the system capable of handling
# this activity type
@@ -135,7 +128,10 @@ class Shell(gobject.GObject):
home_model = self._model.get_home()
home_model.notify_activity_launch(activity_id, act_type)
handler = activityfactory.create(act_type)
handle = ActivityHandle(activity_id)
handle.pservice_id = activity_id
handler = activityfactory.create(act_type, handle)
handler.connect('success', self._join_success_cb, activity_ps)
handler.connect('error', self._join_error_cb, home_model)