Show buddies always if there is no activity

This commit is contained in:
Marco Pesenti Gritti 2006-06-16 15:42:55 -04:00
parent b31a2176ba
commit a4f9a15b5d
2 changed files with 22 additions and 14 deletions

View File

@ -15,6 +15,7 @@ class PresenceWindow(gtk.Window):
gtk.Window.__init__(self, gtk.WINDOW_POPUP)
self._activity_container = activity_container
self._activity = None
self._pservice = PresenceService.get_instance()
self._pservice.connect("buddy-appeared", self._on_buddy_appeared_cb)
@ -25,8 +26,12 @@ class PresenceWindow(gtk.Window):
self._setup_ui()
def _is_buddy_visible(self, buddy):
if self._activity:
activity_type = self._activity.get_default_type()
buddy.get_service_of_type(activity, activity_type)
service = buddy.get_service_of_type(activity, activity_type)
return service is not None
else:
return True
def _update_buddies_visibility(self):
for row in self._buddy_store:

View File

@ -74,6 +74,21 @@ class ActivityHost(dbus.service.Object):
index = notebook.append_page(self.socket, hbox)
notebook.set_current_page(index)
self._create_chat()
def _create_chat():
group_chat = GroupChat()
group_chat.set_transient_for(self.activity_container.window)
group_chat.set_decorated(False)
group_chat.set_skip_taskbar_hint(True)
wm = WindowManager(group_chat)
wm.set_width(0.5, WindowManager.SCREEN_RELATIVE)
wm.set_height(0.5, WindowManager.SCREEN_RELATIVE)
wm.set_position(WindowManager.TOP)
wm.manage()
def __close_button_clicked_reply_cb(self):
pass
@ -418,18 +433,6 @@ def main():
wm.show()
wm.manage()
group_chat = GroupChat()
group_chat.set_transient_for(activity_container.window)
group_chat.set_decorated(False)
group_chat.set_skip_taskbar_hint(True)
wm = WindowManager(group_chat)
wm.set_width(0.5, WindowManager.SCREEN_RELATIVE)
wm.set_height(0.5, WindowManager.SCREEN_RELATIVE)
wm.set_position(WindowManager.TOP)
wm.manage()
console.set_parent_window(activity_container.window)
if __name__ == "__main__":