|
|
@ -98,6 +98,7 @@ class Interface(object): |
|
|
|
self._options[self.NAMESPACE]['unfavorite_char']) |
|
|
|
self._options[self.NAMESPACE]['unfavorite_char']) |
|
|
|
messages.protected_char = ( |
|
|
|
messages.protected_char = ( |
|
|
|
self._options[self.NAMESPACE]['protected_char']) |
|
|
|
self._options[self.NAMESPACE]['protected_char']) |
|
|
|
|
|
|
|
messages.connect('count-changed', self._update_message_count) |
|
|
|
|
|
|
|
|
|
|
|
# replies grid |
|
|
|
# replies grid |
|
|
|
replies = MessageGrid(self._avatars) |
|
|
|
replies = MessageGrid(self._avatars) |
|
|
@ -109,10 +110,11 @@ class Interface(object): |
|
|
|
self._options[self.NAMESPACE]['unfavorite_char']) |
|
|
|
self._options[self.NAMESPACE]['unfavorite_char']) |
|
|
|
replies.protected_char = ( |
|
|
|
replies.protected_char = ( |
|
|
|
self._options[self.NAMESPACE]['protected_char']) |
|
|
|
self._options[self.NAMESPACE]['protected_char']) |
|
|
|
|
|
|
|
replies.connect('count-changed', self._update_replies_count) |
|
|
|
|
|
|
|
|
|
|
|
self._main_tabs = gtk.Notebook() |
|
|
|
self._main_tabs = gtk.Notebook() |
|
|
|
self._main_tabs.insert_page(messages, gtk.Label('Messages')) |
|
|
|
self._main_tabs.insert_page(messages, gtk.Label('Messages (0)')) |
|
|
|
self._main_tabs.insert_page(replies, gtk.Label('Replies')) |
|
|
|
self._main_tabs.insert_page(replies, gtk.Label('Replies (0)')) |
|
|
|
|
|
|
|
|
|
|
|
update_box = gtk.VBox() |
|
|
|
update_box = gtk.VBox() |
|
|
|
update_box.set_property('border_width', 2) |
|
|
|
update_box.set_property('border_width', 2) |
|
|
@ -391,6 +393,22 @@ class Interface(object): |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# Widget callback functions |
|
|
|
# Widget callback functions |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|
|
|
|
|
def _update_message_count(self, widget, data): |
|
|
|
|
|
|
|
"""Callback from the MessageGrid for messages when the number of |
|
|
|
|
|
|
|
messages changes.""" |
|
|
|
|
|
|
|
child = self._main_tabs.get_nth_page(0) |
|
|
|
|
|
|
|
message = _('Messages (%d)') % (data) |
|
|
|
|
|
|
|
self._main_tabs.set_tab_label_text(child, message) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _update_replies_count(self, widget, data): |
|
|
|
|
|
|
|
"""Callback from the MessageGrid for replies when the number of |
|
|
|
|
|
|
|
messages changes.""" |
|
|
|
|
|
|
|
child = self._main_tabs.get_nth_page(1) |
|
|
|
|
|
|
|
message = _('Replies (%d)') % (data) |
|
|
|
|
|
|
|
self._main_tabs.set_tab_label_text(child, message) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
def _clear_posts(self, widget): |
|
|
|
def _clear_posts(self, widget): |
|
|
|
"""Clear the posts in the currently selected tab.""" |
|
|
|
"""Clear the posts in the currently selected tab.""" |
|
|
|
page = self._main_tabs.get_current_page() |
|
|
|
page = self._main_tabs.get_current_page() |
|
|
@ -714,8 +732,6 @@ class Interface(object): |
|
|
|
### replies callback |
|
|
|
### replies callback |
|
|
|
def _post_get_replies(self, widget, results): |
|
|
|
def _post_get_replies(self, widget, results): |
|
|
|
"""Called after we retrieve the replies.""" |
|
|
|
"""Called after we retrieve the replies.""" |
|
|
|
_log.debug("%d new replies", len(results)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
grid = self._main_tabs.get_nth_page(1) |
|
|
|
grid = self._main_tabs.get_nth_page(1) |
|
|
|
grid.update(results) |
|
|
|
grid.update(results) |
|
|
|
|
|
|
|
|
|
|
|