From 1eeb16dc2d77476ab5fdd45b041971e4daef583e Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 12 Mar 2006 18:55:59 +0000 Subject: [PATCH] [Jim++] fix TB in unconnected gc. Fixes #1687 --- src/groupchat_control.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/groupchat_control.py b/src/groupchat_control.py index acf0bf486..19755d35a 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -299,9 +299,16 @@ class GroupchatControl(ChatControlBase): childs = menu.get_children() # compact_view_menuitem childs[5].set_active(self.compact_view_current) - c = gajim.contacts.get_gc_contact(self.account, self.room_jid, self.nick) - if c.affiliation not in ('owner', 'admin'): + if gajim.gc_connected[self.account][self.room_jid]: + c = gajim.contacts.get_gc_contact(self.account, self.room_jid, + self.nick) + if c.affiliation not in ('owner', 'admin'): + childs[1].set_sensitive(False) + else: + # We are not connected to this groupchat, disable unusable menuitems childs[1].set_sensitive(False) + childs[2].set_sensitive(False) + childs[3].set_sensitive(False) menu = self.remove_possible_switch_to_menuitems(menu) return menu