From 9a7ed9488ad6dd4eecac7816bbb7c5a5730e318a Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 4 Sep 2006 18:58:58 +0000 Subject: [PATCH] take into account the case when no systray is available. Fixes #2384 and #2389 --- src/common/events.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common/events.py b/src/common/events.py index bc190f6c4..4a7ba9e87 100644 --- a/src/common/events.py +++ b/src/common/events.py @@ -77,7 +77,7 @@ class Events: self._events[account][jid] = [event] else: self._events[account][jid].append(event) - if event.show_in_systray: + if event.show_in_systray and gajim.interface.systray_capabilities: gajim.interface.systray.set_img() def remove_events(self, account, jid, event = None, types = []): @@ -94,7 +94,8 @@ class Events: del self._events[account][jid] else: self._events[account][jid].remove(event) - gajim.interface.systray.set_img() + if event.show_in_systray and gajim.interface.systray_capabilities: + gajim.interface.systray.set_img() return else: return True @@ -109,11 +110,13 @@ class Events: self._events[account][jid] = new_list else: del self._events[account][jid] - gajim.interface.systray.set_img() + if gajim.interface.systray_capabilities: + gajim.interface.systray.set_img() return # no event nor type given, remove them all del self._events[account][jid] - gajim.interface.systray.set_img() + if gajim.interface.systray_capabilities: + gajim.interface.systray.set_img() def get_nb_events(self, types = []): return self._get_nb_events(types = types)