From 2177eb11c109c503779e94f7558b63eb577ac7a1 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 1 Sep 2013 21:22:10 +0200 Subject: [PATCH] insensitive more menuitems when we're offline. Fixes #7082 --- src/roster_window.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/roster_window.py b/src/roster_window.py index 17a428668..87e4d694e 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -5810,6 +5810,11 @@ class RosterWindow: send_custom_status_menuitem.set_sensitive(False) send_group_message_item.set_sensitive(False) + if gajim.connections[account].connected < 2: + send_group_message_item.set_sensitive(False) + invite_menuitem.set_sensitive(False) + send_custom_status_menuitem.set_sensitive(False) + if not group in helpers.special_groups: item = Gtk.SeparatorMenuItem.new() # separator menu.append(item) @@ -6011,8 +6016,10 @@ class RosterWindow: icon = Gtk.Image.new_from_stock(Gtk.STOCK_NEW, Gtk.IconSize.MENU) item.set_image(icon) item.connect('activate', - self.on_send_single_message_menuitem_activate, account, contact) + self.on_send_single_message_menuitem_activate, account, contact) menu.append(item) + if gajim.account_is_disconnected(account): + item.set_sensitive(False) blocked = False if helpers.jid_is_blocked(account, jid): @@ -6049,6 +6056,8 @@ class RosterWindow: status_menuitem.set_image(icon) status_menuitems.append(status_menuitem) menu.append(send_custom_status_menuitem) + if gajim.account_is_disconnected(account): + send_custom_status_menuitem.set_sensitive(False) item = Gtk.SeparatorMenuItem.new() # separator menu.append(item) @@ -6127,6 +6136,8 @@ class RosterWindow: information_menuitem.set_image(icon) menu.append(information_menuitem) information_menuitem.connect('activate', self.on_info, contact, account) + if gajim.account_is_disconnected(account): + information_menuitem.set_sensitive(False) event_button = gtkgui_helpers.get_possible_button_event(event)