Commit fe28d00e13bc6e67f1495065458d2fe4ebf4d518

Improved status icon with blinking and better decoupling from main class.
src/__init__.py
(2 / 2)
  
121121 self.plugin_manager.emit_signal('no_new_messages', empty_queue = self.empty_msg_queue)
122122 # Check again later
123123 if self.empty_msg_queue:
124 self.status_icon.set_from_file(self.status_icon.inactive_icon)
124 self.status_icon.no_new_message()
125125 return True
126 self.status_icon.set_from_file(self.status_icon.active_icon)
127126 count = self.connection.getUnreadMsgCount()
127 self.status_icon.new_message(count)
128128 logging.info("[Main] %s New messages found", count)
129129 self.plugin_manager.emit_signal('new_messages',
130130 messages=self.connection.getMsgList())
src/ui.py
(18 / 0)
  
9999 if path != self.current_icon_path:
100100 self.current_icon_path = path
101101 gtk.StatusIcon.set_from_file(self, path)
102
103 def new_message(self, count):
104 """Sets the icon to active, and modifies the tooltip to
105 reflect the new message arrival, plus some blinking
106
107 Arguments:
108 - `count`: How many new message were find?
109 """
110 self.set_from_file(self.active_icon)
111 self.set_blinking(True)
112
113 def no_new_message(self):
114 """Sets the icon to inactive."""
115 self.set_from_file(self.inactive_icon)
116 self.set_blinking(False)
117
118
119

Comments

Add a new comment:

Login or create an account to post a comment

Add your comment