Author: jim++ Date: 2006-05-02 19:55:52 +0200 (Tue, 02 May 2006) New Revision: 6268
Modified: trunk/src/tooltips.py Log: Nicer systray tooltip when awaiting events of differents types (don't print gajim twice). Fixes #1053
Modified: trunk/src/tooltips.py =================================================================== --- trunk/src/tooltips.py 2006-05-02 16:25:59 UTC (rev 6267) +++ trunk/src/tooltips.py 2006-05-02 17:55:52 UTC (rev 6268) @@ -314,32 +314,41 @@ unread_pm += pm_msgs
if unread_chat or unread_single_chat or unread_gc or unread_pm: - text = '' + text = 'Gajim ' + awaiting_events = unread_chat + unread_single_chat + unread_gc + unread_pm + if awaiting_events == unread_chat or awaiting_events == unread_single_chat \ + or awaiting_events == unread_gc or awaiting_events == unread_pm: + # This condition is like previous if but with xor... + # Print in one line + text += '-' + else: + # Print in multiple lines + text += '\n ' if unread_chat: text += i18n.ngettext( - 'Gajim - %d unread message', - 'Gajim - %d unread messages', + ' %d unread message', + ' %d unread messages', unread_chat, unread_chat, unread_chat) - text += '\n' + text += '\n ' if unread_single_chat: text += i18n.ngettext( - 'Gajim - %d unread single message', - 'Gajim - %d unread single messages', + ' %d unread single message', + ' %d unread single messages', unread_single_chat, unread_single_chat, unread_single_chat) - text += '\n' + text += '\n ' if unread_gc: text += i18n.ngettext( - 'Gajim - %d unread group chat message', - 'Gajim - %d unread group chat messages', + ' %d unread group chat message', + ' %d unread group chat messages', unread_gc, unread_gc, unread_gc) - text += '\n' + text += '\n ' if unread_pm: text += i18n.ngettext( - 'Gajim - %d unread private message', - 'Gajim - %d unread private messages', + ' %d unread private message', + ' %d unread private messages', unread_pm, unread_pm, unread_pm) - text += '\n' - text = text[:-1] # remove latest \n + text += '\n ' + text = text[:-4] # remove latest '\n ' elif len(accounts) > 1: text = _('Gajim') self.current_current_row = 1