Changeset 6268

Show
Ignore:
Timestamp:
05/02/06 19:55:52 (3 years ago)
Author:
jim++
Message:

Nicer systray tooltip when awaiting events of differents types (don't print gajim twice). Fixes #1053

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/tooltips.py

    r6255 r6268  
    315315 
    316316                if unread_chat or unread_single_chat or unread_gc or unread_pm: 
    317                         text = '' 
     317                        text = 'Gajim ' 
     318                        awaiting_events = unread_chat + unread_single_chat + unread_gc + unread_pm 
     319                        if awaiting_events == unread_chat or awaiting_events == unread_single_chat \ 
     320                                or awaiting_events == unread_gc or awaiting_events == unread_pm: 
     321                                # This condition is like previous if but with xor...  
     322                                # Print in one line 
     323                                text += '-' 
     324                        else: 
     325                                # Print in multiple lines 
     326                                text += '\n   ' 
    318327                        if unread_chat: 
    319328                                text += i18n.ngettext( 
    320                                         'Gajim - %d unread message', 
    321                                         'Gajim - %d unread messages', 
     329                                        ' %d unread message', 
     330                                        ' %d unread messages', 
    322331                                        unread_chat, unread_chat, unread_chat) 
    323                                 text += '\n' 
     332                                text += '\n   ' 
    324333                        if unread_single_chat: 
    325334                                text += i18n.ngettext( 
    326                                         'Gajim - %d unread single message', 
    327                                         'Gajim - %d unread single messages', 
     335                                        ' %d unread single message', 
     336                                        ' %d unread single messages', 
    328337                                        unread_single_chat, unread_single_chat, unread_single_chat) 
    329                                 text += '\n' 
     338                                text += '\n   ' 
    330339                        if unread_gc: 
    331340                                text += i18n.ngettext( 
    332                                         'Gajim - %d unread group chat message', 
    333                                         'Gajim - %d unread group chat messages', 
     341                                        ' %d unread group chat message', 
     342                                        ' %d unread group chat messages', 
    334343                                        unread_gc, unread_gc, unread_gc) 
    335                                 text += '\n' 
     344                                text += '\n   ' 
    336345                        if unread_pm: 
    337346                                text += i18n.ngettext( 
    338                                         'Gajim - %d unread private message', 
    339                                         'Gajim - %d unread private messages', 
     347                                        ' %d unread private message', 
     348                                        ' %d unread private messages', 
    340349                                        unread_pm, unread_pm, unread_pm) 
    341                                 text += '\n' 
    342                         text = text[:-1] # remove latest \n 
     350                                text += '\n   ' 
     351                        text = text[:-4] # remove latest '\n   ' 
    343352                elif len(accounts) > 1: 
    344353                        text = _('Gajim')