Skip to content
Browse files

Made the tray icon actually update instead of getting the karma in vain.

  • Loading branch information...
1 parent 753f7c6 commit d77cc8d0e056a45e4fccd8ee1437421029082182 @skorokithakis committed
Showing with 7 additions and 4 deletions.
  1. +2 −1 reddit_monitor
  2. +5 −3 redditmonitor/ui.py
View
3 reddit_monitor
@@ -318,7 +318,7 @@ class Application(object):
if self.messages:
self.tray_icon.set_icon(self.resources['new_mail_icon'])
- if len(self.messages) > messages_len:
+ if len(self.messages) != messages_len:
self.show_notification()
self.play_sound()
else:
@@ -330,6 +330,7 @@ class Application(object):
self.tray_icon.menu.ui_manager.get_widget('/TrayMenu/Reset').set_sensitive(False)
self.tray_icon.menu.ui_manager.get_widget('/TrayMenu/Refresh').set_sensitive(True)
+ self.tray_icon.refresh()
self.checking = False
View
8 redditmonitor/ui.py
@@ -30,6 +30,10 @@ def __init__(self, parent):
self.connect('popup-menu', self.menu.popup)
+ self.refresh()
+ self.set_visible(True)
+
+ def refresh(self):
if self.app.messages:
self.set_from_pixbuf(gtk.gdk.pixbuf_new_from_file(self.app.resources['new_mail_icon']))
self.menu.ui_manager.get_widget('/TrayMenu/Reset').set_sensitive(True)
@@ -42,9 +46,7 @@ def __init__(self, parent):
tooltip_string = '%s\nKarma: %s\nComment karma: %s\n%s' % (self.app.username, locale.format('%d', self.app.karma, True), locale.format('%d', self.app.comment_karma, True), messages_string)
self.set_tooltip(tooltip_string)
-
- self.set_visible(True)
-
+
def set_icon(self, path):
self.set_from_pixbuf(gtk.gdk.pixbuf_new_from_file(path))

0 comments on commit d77cc8d

Please sign in to comment.
Something went wrong with that request. Please try again.