Browse Source

show the number of messages and replies in the title (idea by renatux)

master
Julio Biason 15 years ago
parent
commit
0071b5de4b
  1. 3
      THANKS
  2. 41
      mitterlib/ui/ui_pygtk.py

3
THANKS

@ -11,6 +11,7 @@ Many thanks to:
- Kristian Rietveld, who posted a solution to the auto-word-wrap GtkTreeView
(http://lists-archives.org/gtk/06637-tree-view-cell-size-negotiation.html)
- Wiennat for the retweet patch.
- 3knirokfier for the favourite patch (although we went to a different route)
- The guys from Paraiso Linux (http://paraisolinux.com) for the awesome new
logo.
- Renato Covarrubias, for the patch to display the number of messages and
replies in the window title

41
mitterlib/ui/ui_pygtk.py

@ -351,7 +351,8 @@ class Interface(object):
'"Wiennat"',
'Philip Reynolds',
'Greg McIntyre',
'"Alexander"'])
'"Alexander"',
'Renato Covarrubias'])
if self._images['logo']:
about_window.set_logo(self._images['logo'])
about_window.run()
@ -411,19 +412,24 @@ class Interface(object):
messages changes."""
child = self._main_tabs.get_nth_page(0)
message = _('Messages (%d)') % (data)
# do this specially for tabs since it seems really slow to update the
# text (at least, on my computer); so we update only the required tab,
# not both (even if we get both values here.)
self._main_tabs.set_tab_label_text(child, message)
if data > 0:
_log.debug('We have new messages, changing status icon')
self._statusicon.set_from_pixbuf(self._images['new-messages'])
return
replies = self._main_tabs.get_nth_page(1)
messages_title = ('%d ' +
N_('message', 'messages', data)) % (data)
replies_title = ('%d ' +
N_('reply', 'replies', replies.count)) % (replies.count)
child = self._main_tabs.get_nth_page(1)
if child.count > 0:
_log.debug('Replies have messages, not changing status icon')
title = 'Mitter (%s, %s)' % (messages_title, replies_title)
self._main_window.set_title(title)
if (data + replies.count) > 0:
self._statusicon.set_from_pixbuf(self._images['new-messages'])
return
_log.debug('No messages or replies, changing status icon')
self._statusicon.set_from_pixbuf(self._images['icon'])
return
@ -434,17 +440,18 @@ class Interface(object):
message = _('Replies (%d)') % (data)
self._main_tabs.set_tab_label_text(child, message)
if data > 0:
_log.debug('We have new replies, changing status icon')
self._statusicon.set_from_pixbuf(self._images['new-messages'])
return
messages = self._main_tabs.get_nth_page(0)
messages_title = ('%d ' +
N_('message', 'messages', messages.count)) % (messages.count)
replies_title = ('%d ' +
N_('reply', 'replies', data)) % (data)
child = self._main_tabs.get_nth_page(0)
if child.count > 0:
_log.debug('Messages have new messages, not changing status icon')
title = 'Mitter (%s, %s)' % (messages_title, replies_title)
self._main_window.set_title(title)
if (data + messages.count) > 0:
self._statusicon.set_from_pixbuf(self._images['new-messages'])
return
_log.debug('No messages or replies, changing status icon')
self._statusicon.set_from_pixbuf(self._images['icon'])
return

Loading…
Cancel
Save