diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 0fd8f3d..ba89d52 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -412,6 +412,19 @@ class Interface(object): child = self._main_tabs.get_nth_page(0) message = _('Messages (%d)') % (data) 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 + + child = self._main_tabs.get_nth_page(1) + if child.count > 0: + _log.debug('Replies have messages, not changing status icon') + return + + _log.debug('No messages or replies, changing status icon') + self._statusicon.set_from_pixbuf(self._images['icon']) return def _update_replies_count(self, widget, data): @@ -420,6 +433,19 @@ class Interface(object): child = self._main_tabs.get_nth_page(1) 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 + + child = self._main_tabs.get_nth_page(0) + if child.count > 0: + _log.debug('Messages have new messages, not changing status icon') + return + + _log.debug('No messages or replies, changing status icon') + self._statusicon.set_from_pixbuf(self._images['icon']) return def _clear_posts(self, widget):