Twas brillig at 12:29:16 10.03.2007 UTC+01 when yann did gyre and gimble: y> Thanks for the patch. It's a good solution to handle events better y> in our code. I've modified your code a bit (integrate y> SystrayEventsListener class in Systray one) and commited it in rev y> 8008
Oops, I forgot to mail updated patch, last one had two bugs: - 'fire_event_deleted' instead of 'fire_event_removed' once. - 'fire_event_removed' may be called both with 'event' argument and without one, depending on the context, so let it accept and pass further optional 'event' argument. See the fix in attach. ps: I'm subscribed to gajim-devel, no need to copy answer to my address. pps: Probably it worth to factor out publisher/subsriber snippet to the separate class and use it in everywhere. I'd do it if you agree that's a good idea. -- JID: [EMAIL PROTECTED]
Index: src/systray.py =================================================================== --- src/systray.py (revision 8008) +++ src/systray.py (working copy) @@ -74,7 +74,7 @@ if event.show_in_systray: self.set_img() - def on_event_removed(self): + def on_event_removed(self, event): '''Called when one or more events are removed from the event list''' self.set_img() Index: src/common/events.py =================================================================== --- src/common/events.py (revision 8008) +++ src/common/events.py (working copy) @@ -74,9 +74,9 @@ for listener in self._event_added_listeners: listener(event) - def fire_event_removed(self): + def fire_event_removed(self, event = None): for listener in self._event_removed_listeners: - listener() + listener(event) def change_account_name(self, old_name, new_name): if self._events.has_key(old_name): @@ -122,7 +122,7 @@ del self._events[account][jid] else: self._events[account][jid].remove(event) - self.fire_event_deleted(event) + self.fire_event_removed(event) return else: return True
_______________________________________________ Gajim-devel mailing list Gajim-devel@gajim.org https://lists.gajim.org/cgi-bin/listinfo/gajim-devel