diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-09 22:54:54 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-09 22:54:54 (GMT) |
commit | 9b12b11534a007c46e626b2b7b17265f4bddee5d (patch) | |
tree | 85f399dd4e536cfda01fbc80ccc2331e4e0bdda8 /shell/Shell.py | |
parent | f5587ac7995feb4af14f23dd0f2dd389787758a6 (diff) |
Get one-to-one chat back to work
Diffstat (limited to 'shell/Shell.py')
-rwxr-xr-x | shell/Shell.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/shell/Shell.py b/shell/Shell.py index 7b8074a..0baea0e 100755 --- a/shell/Shell.py +++ b/shell/Shell.py @@ -45,8 +45,14 @@ class ShellDbusService(dbus.service.Object): def log(self, module_id, message): gobject.idle_add(self.__log_idle, (module_id, message)) -class Shell: +class Shell(gobject.GObject): + __gsignals__ = { + 'activity-closed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([str])) + } + def __init__(self, registry): + gobject.GObject.__init__(self) + self._screen = wnck.screen_get_default() self._registry = registry self._hosts = {} @@ -63,8 +69,8 @@ class Shell: self._owner = ShellOwner() self._owner.announce() - chat_controller = ChatController(self) - chat_controller.listen() + self._chat_controller = ChatController(self) + self._chat_controller.listen() self._home_window = HomeWindow(self) self._home_window.show() @@ -79,7 +85,11 @@ class Shell: def __window_closed_cb(self, screen, window): if window.get_window_type() == wnck.WINDOW_NORMAL: xid = window.get_xid() - self._hosts[xid] = None + + activity = self._hosts[xid] + self.emit('activity-closed', activity.get_id()) + + del self._hosts[xid] def get_activity(self, activity_id): for host in self._hosts: @@ -156,3 +166,6 @@ class Shell: def get_registry(self): return self._registry + + def get_chat_controller(self): + return self._chat_controller |