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 - Kristian Rietveld, who posted a solution to the auto-word-wrap GtkTreeView
(http://lists-archives.org/gtk/06637-tree-view-cell-size-negotiation.html) (http://lists-archives.org/gtk/06637-tree-view-cell-size-negotiation.html)
- Wiennat for the retweet patch. - 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 - The guys from Paraiso Linux (http://paraisolinux.com) for the awesome new
logo. 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"', '"Wiennat"',
'Philip Reynolds', 'Philip Reynolds',
'Greg McIntyre', 'Greg McIntyre',
'"Alexander"']) '"Alexander"',
'Renato Covarrubias'])
if self._images['logo']: if self._images['logo']:
about_window.set_logo(self._images['logo']) about_window.set_logo(self._images['logo'])
about_window.run() about_window.run()
@ -411,19 +412,24 @@ class Interface(object):
messages changes.""" messages changes."""
child = self._main_tabs.get_nth_page(0) child = self._main_tabs.get_nth_page(0)
message = _('Messages (%d)') % (data) 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) self._main_tabs.set_tab_label_text(child, message)
if data > 0: replies = self._main_tabs.get_nth_page(1)
_log.debug('We have new messages, changing status icon') messages_title = ('%d ' +
self._statusicon.set_from_pixbuf(self._images['new-messages']) N_('message', 'messages', data)) % (data)
return replies_title = ('%d ' +
N_('reply', 'replies', replies.count)) % (replies.count)
child = self._main_tabs.get_nth_page(1) title = 'Mitter (%s, %s)' % (messages_title, replies_title)
if child.count > 0: self._main_window.set_title(title)
_log.debug('Replies have messages, not changing status icon')
if (data + replies.count) > 0:
self._statusicon.set_from_pixbuf(self._images['new-messages'])
return return
_log.debug('No messages or replies, changing status icon')
self._statusicon.set_from_pixbuf(self._images['icon']) self._statusicon.set_from_pixbuf(self._images['icon'])
return return
@ -434,17 +440,18 @@ class Interface(object):
message = _('Replies (%d)') % (data) message = _('Replies (%d)') % (data)
self._main_tabs.set_tab_label_text(child, message) self._main_tabs.set_tab_label_text(child, message)
if data > 0: messages = self._main_tabs.get_nth_page(0)
_log.debug('We have new replies, changing status icon') messages_title = ('%d ' +
self._statusicon.set_from_pixbuf(self._images['new-messages']) N_('message', 'messages', messages.count)) % (messages.count)
return replies_title = ('%d ' +
N_('reply', 'replies', data)) % (data)
child = self._main_tabs.get_nth_page(0) title = 'Mitter (%s, %s)' % (messages_title, replies_title)
if child.count > 0: self._main_window.set_title(title)
_log.debug('Messages have new messages, not changing status icon') if (data + messages.count) > 0:
self._statusicon.set_from_pixbuf(self._images['new-messages'])
return return
_log.debug('No messages or replies, changing status icon')
self._statusicon.set_from_pixbuf(self._images['icon']) self._statusicon.set_from_pixbuf(self._images['icon'])
return return

Loading…
Cancel
Save