From 79d611032ad611f3597d5f38e7a274aa228f09d2 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sat, 5 Nov 2005 18:09:57 +0000 Subject: [PATCH] always update self.previous_status_combobox_active, even when we don't manually change the combobox --- src/gtkgui.glade | 2 ++ src/roster_window.py | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/gtkgui.glade b/src/gtkgui.glade index bdf9ec01d..2f5f7a3fa 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -391,6 +391,7 @@ True False True + 0 @@ -13894,6 +13895,7 @@ to the Jabber network. 0.5 0 0 + username_entry PANGO_ELLIPSIZE_NONE -1 False diff --git a/src/roster_window.py b/src/roster_window.py index 4248344e5..3af3cb7b4 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1405,6 +1405,9 @@ _('If "%s" accepts this request you will know his status.') %jid) active = self.status_combobox.get_active() if active == -1: # no active item return + if not self.combobox_callback_active: + self.previous_status_combobox_active = active + return accounts = gajim.connections.keys() if len(accounts) == 0: dialogs.ErrorDialog(_('No account available'), @@ -1426,9 +1429,9 @@ _('If "%s" accepts this request you will know his status.') %jid) continue current_show = gajim.SHOW_LIST[gajim.connections[acct].connected] self.send_status(acct, current_show, message) - self.status_combobox.handler_block(self.id_signal_cb) + self.combobox_callback_active = False self.status_combobox.set_active(self.previous_status_combobox_active) - self.status_combobox.handler_unblock(self.id_signal_cb) + self.combobox_callback_active = True return # we are about to change show, so save this new show so in case # after user chooses "Change status message" menuitem @@ -1472,9 +1475,9 @@ _('If "%s" accepts this request you will know his status.') %jid) maxi = gajim.connections[account].connected # temporarily block signal in order not to send status that we show # in the combobox - self.status_combobox.handler_block(self.id_signal_cb) + self.combobox_callback_active = False self.status_combobox.set_active(table[maxi]) - self.status_combobox.handler_unblock(self.id_signal_cb) + self.combobox_callback_active = True statuss = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd', 'invisible'] if gajim.interface.systray_enabled: @@ -2475,8 +2478,7 @@ _('If "%s" accepts this request you will know his status.') %jid) self.tree.connect('drag_data_get', self.drag_data_get_data) self.tree.connect('drag_data_received', self.drag_data_received_data) self.xml.signal_autoconnect(self) - self.id_signal_cb = self.status_combobox.connect('changed', - self.on_status_combobox_changed) + self.combobox_callback_active = True self.collapsed_rows = gajim.config.get('collapsed_rows').split('\t') self.tooltip = tooltips.RosterTooltip()