Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-10-19 12:51:13 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-10-19 12:51:13 (GMT)
commitcf13a7ff5bcf4987d23d56669e6c984142033338 (patch)
tree733b0023be87681cb757e24f579a2e7c8be1c0ba
parent21aa37cc24edf3b4f4e69e263f049c7298bf7bf0 (diff)
Unregister the chat service on destroy.
-rw-r--r--shell/model/BuddyModel.py5
-rw-r--r--shell/view/ActivityHost.py2
-rw-r--r--sugar/chat/ActivityChat.py5
3 files changed, 7 insertions, 5 deletions
diff --git a/shell/model/BuddyModel.py b/shell/model/BuddyModel.py
index 3205425..651e911 100644
--- a/shell/model/BuddyModel.py
+++ b/shell/model/BuddyModel.py
@@ -139,7 +139,4 @@ class BuddyModel(gobject.GObject):
def __buddy_current_activity_changed_cb(self, buddy, activity=None):
if not self._buddy:
return
- if activity:
- self.emit('current-activity-changed', activity)
- else:
- self.emit('current-activity-changed')
+ self.emit('current-activity-changed', activity)
diff --git a/shell/view/ActivityHost.py b/shell/view/ActivityHost.py
index 4074de2..eacb30f 100644
--- a/shell/view/ActivityHost.py
+++ b/shell/view/ActivityHost.py
@@ -150,6 +150,6 @@ class ActivityHost:
def _activity_closed_cb(self, shell, activity):
if activity == self:
- self.chat_hide()
+ self._chat_window.destroy()
self._frame_was_visible = False
diff --git a/sugar/chat/ActivityChat.py b/sugar/chat/ActivityChat.py
index 971b87d..a426abc 100644
--- a/sugar/chat/ActivityChat.py
+++ b/sugar/chat/ActivityChat.py
@@ -26,6 +26,8 @@ class ActivityChat(GroupChat):
GroupChat.__init__(self)
self._chat_service = None
+ self.connect('destroy', self._destroy_cb)
+
self._activity = activity
self._pservice.register_service_type(ActivityChat.SERVICE_TYPE)
self._pservice.connect('service-appeared', self._service_appeared_cb)
@@ -59,3 +61,6 @@ class ActivityChat(GroupChat):
self._chat_service = self._pservice.share_activity(self._activity,
stype=ActivityChat.SERVICE_TYPE)
self._setup_stream(self._chat_service)
+
+ def _destroy_cb(self, widget):
+ self._pservice.unregister_service(self._chat_service)