[Jim++] fix TB in unconnected gc. Fixes #1687

This commit is contained in:
Yann Leboulanger 2006-03-12 18:55:59 +00:00
parent f19dc78297
commit 1eeb16dc2d
1 changed files with 9 additions and 2 deletions

View File

@ -299,9 +299,16 @@ class GroupchatControl(ChatControlBase):
childs = menu.get_children() childs = menu.get_children()
# compact_view_menuitem # compact_view_menuitem
childs[5].set_active(self.compact_view_current) childs[5].set_active(self.compact_view_current)
c = gajim.contacts.get_gc_contact(self.account, self.room_jid, self.nick) 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'): if c.affiliation not in ('owner', 'admin'):
childs[1].set_sensitive(False) 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) menu = self.remove_possible_switch_to_menuitems(menu)
return menu return menu