show insensitive block menutitem if server doesn't support privacy lists. Fixes #3016

This commit is contained in:
Yann Leboulanger 2007-06-11 07:06:20 +00:00
parent 867199a89f
commit 46a9657b46
1 changed files with 9 additions and 5 deletions

View File

@ -2254,9 +2254,8 @@ class RosterWindow:
block_menuitem.connect('activate', self.on_block, iter, None)
unblock_menuitem.hide()
else:
block_menuitem.set_no_show_all(True)
unblock_menuitem.set_no_show_all(True)
block_menuitem.hide()
block_menuitem.set_sensitive(False)
unblock_menuitem.hide()
event_button = gtkgui_helpers.get_possible_button_event(event)
@ -2412,7 +2411,7 @@ class RosterWindow:
menu.append(item)
# Block
if is_blocked:
if is_blocked and gajim.connections[account].privacy_rules_supported:
unblock_menuitem = gtk.ImageMenuItem(_('_Unblock'))
icon = gtk.image_new_from_stock(gtk.STOCK_STOP, gtk.ICON_SIZE_MENU)
unblock_menuitem.set_image(icon)
@ -2425,6 +2424,9 @@ class RosterWindow:
block_menuitem.connect('activate', self.on_block, None, list_)
menu.append(block_menuitem)
if not gajim.connections[account].privacy_rules_supported:
block_menuitem.set_sensitive(False)
# Remove
remove_item = gtk.ImageMenuItem(_('_Remove from Roster'))
icon = gtk.image_new_from_stock(gtk.STOCK_REMOVE, gtk.ICON_SIZE_MENU)
@ -2607,7 +2609,7 @@ class RosterWindow:
if group in gajim.connections[account].blocked_groups:
is_blocked = True
if is_blocked:
if is_blocked and gajim.connections[account].privacy_rules_supported:
unblock_menuitem = gtk.ImageMenuItem(_('_Unblock'))
icon = gtk.image_new_from_stock(gtk.STOCK_STOP, gtk.ICON_SIZE_MENU)
unblock_menuitem.set_image(icon)
@ -2619,6 +2621,8 @@ class RosterWindow:
block_menuitem.set_image(icon)
block_menuitem.connect('activate', self.on_block, iter, list_)
menu.append(block_menuitem)
if not gajim.connections[account].privacy_rules_supported:
block_menuitem.set_sensitive(False)
# Remove group
remove_item = gtk.ImageMenuItem(_('_Remove from Roster'))