From 375e0612ce95dde643de70d159ed861860c9f46e Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 14 Oct 2007 16:55:03 +0000 Subject: [PATCH] change global status when we set it through systray menu, even if one account already has this status. see #3489 --- src/systray.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/systray.py b/src/systray.py index f96361a33..fb3dd408b 100644 --- a/src/systray.py +++ b/src/systray.py @@ -327,7 +327,24 @@ class Systray: l = ['online', 'chat', 'away', 'xa', 'dnd', 'invisible', 'SEPARATOR', 'CHANGE_STATUS_MSG_MENUITEM', 'SEPARATOR', 'offline'] index = l.index(show) - gajim.interface.roster.status_combobox.set_active(index) + current = gajim.interface.roster.status_combobox.get_active() + if index != current: + gajim.interface.roster.status_combobox.set_active(index) + else: + # We maybe need to emit the changed signal if all globaly sync'ed + # account don't have the global status + need_to_change = False + accounts = gajim.connections.keys() + for acct in accounts: + if not gajim.config.get_per('accounts', acct, + 'sync_with_global_status'): + continue + acct_show = gajim.SHOW_LIST[gajim.connections[acct].connected] + if acct_show != show: + need_to_change = True + break + if need_to_change: + gajim.interface.roster.status_combobox.emit('changed') def on_change_status_message_activate(self, widget): model = gajim.interface.roster.status_combobox.get_model()