Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2006-06-16 21:01:25 (GMT)
committer Dan Williams <dcbw@redhat.com>2006-06-16 21:01:25 (GMT)
commita6c33403ffe9d61ea93fcc1546535c7362c01095 (patch)
treebfed874235403a0e41d41dfb70f74a2ed3af4c87 /sugar
parenteb47a36701560fe5a6e712f8196701f8ac7bc346 (diff)
Listen to local activity lifecycle signals
Diffstat (limited to 'sugar')
-rw-r--r--sugar/shell/StartPage.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/sugar/shell/StartPage.py b/sugar/shell/StartPage.py
index 18fc2b4..6d71871 100644
--- a/sugar/shell/StartPage.py
+++ b/sugar/shell/StartPage.py
@@ -70,9 +70,15 @@ class ActivitiesView(gtk.TreeView):
browser_shell.open_browser_with_id(address, activity_id)
class StartPage(gtk.HBox):
- def __init__(self):
+ def __init__(self, ac_signal_object):
gtk.HBox.__init__(self)
+ self._ac_signal_object = ac_signal_object
+ self._ac_signal_object.connect("local-activity-started",
+ self._on_local_activity_started_cb)
+ self._ac_signal_object.connect("local-activity-ended",
+ self._on_local_activity_ended_cb)
+
self._pservice = PresenceService.get_instance()
self._pservice.connect("activity-announced", self._on_activity_announced_cb)
self._pservice.start()
@@ -114,6 +120,13 @@ class StartPage(gtk.HBox):
self.pack_start(sw)
sw.show()
+ def _on_local_activity_started_cb(self, helper, activity_container, activity_id):
+ self._pservice.track_activity(activity_id)
+ print "new local activity %s" % activity_id
+
+ def _on_local_activity_ended_cb(self, helper, activity_container, activity_id):
+ self._pservice.untrack_activity(activity_id)
+
def _on_activity_announced_cb(self, pservice, service, buddy):
self._activities.get_model().add_activity(buddy, service)