Commit fe28d00e13bc6e67f1495065458d2fe4ebf4d518
- Diff rendering mode:
- inline
- side by side
src/__init__.py
(2 / 2)
|   | |||
| 121 | 121 | self.plugin_manager.emit_signal('no_new_messages', empty_queue = self.empty_msg_queue) | |
| 122 | 122 | # Check again later | |
| 123 | 123 | if self.empty_msg_queue: | |
| 124 | self.status_icon.set_from_file(self.status_icon.inactive_icon) | ||
| 124 | self.status_icon.no_new_message() | ||
| 125 | 125 | return True | |
| 126 | self.status_icon.set_from_file(self.status_icon.active_icon) | ||
| 127 | 126 | count = self.connection.getUnreadMsgCount() | |
| 127 | self.status_icon.new_message(count) | ||
| 128 | 128 | logging.info("[Main] %s New messages found", count) | |
| 129 | 129 | self.plugin_manager.emit_signal('new_messages', | |
| 130 | 130 | messages=self.connection.getMsgList()) |
src/ui.py
(18 / 0)
|   | |||
| 99 | 99 | if path != self.current_icon_path: | |
| 100 | 100 | self.current_icon_path = path | |
| 101 | 101 | 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
Please log in to comment

