Monitor service addition and update buddy list

on these.
This commit is contained in:
Marco Pesenti Gritti 2006-06-16 15:21:09 -04:00
parent 9db404afb9
commit 29a730e0a4
2 changed files with 8 additions and 1 deletions

View File

@ -9,7 +9,6 @@ from sugar.p2p import network
PRESENCE_SERVICE_TYPE = "_presence_olpc._tcp" PRESENCE_SERVICE_TYPE = "_presence_olpc._tcp"
class Buddy(gobject.GObject): class Buddy(gobject.GObject):
"""Represents another person on the network and keeps track of the """Represents another person on the network and keeps track of the
activities and resources they make available for sharing.""" activities and resources they make available for sharing."""

View File

@ -126,7 +126,15 @@ class PresenceWindow(gtk.Window):
self._MODEL_COL_BUDDY, buddy, self._MODEL_COL_BUDDY, buddy,
self._MODEL_COL_VISIBLE, self._is_buddy_visible(buddy)) self._MODEL_COL_VISIBLE, self._is_buddy_visible(buddy))
buddy.connect('icon-changed', self.__buddy_icon_changed_cb) buddy.connect('icon-changed', self.__buddy_icon_changed_cb)
buddy.connect('service-added', self.__buddy_service_added_cb)
buddy.connect('service-removed', self.__buddy_service_removed_cb)
def __buddy_service_added_cb(self, buddy, service):
self._update_buddies_visibility()
def __buddy_service_remove_cb(self, buddy, service):
self._update_buddies_visibility()
def _on_buddy_disappeared_cb(self, pservice, buddy): def _on_buddy_disappeared_cb(self, pservice, buddy):
aniter = self._get_iter_for_buddy(buddy) aniter = self._get_iter_for_buddy(buddy)
if aniter: if aniter: