From 9274e12757a0e511cf3d3422c68df3c0c4fb2ef2 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Mon, 5 Apr 2010 17:19:14 -0300 Subject: [PATCH] Status Iconc changing properly (the amount of debug messags is annoying, though) --- mitterlib/ui/ui_pygtk.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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):