|
|
@ -99,6 +99,7 @@ class Interface(object): |
|
|
|
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) |
|
|
|
messages.connect('count-changed', self._update_message_count) |
|
|
|
|
|
|
|
messages.connect('message-changed', self._message_changed) |
|
|
|
|
|
|
|
|
|
|
|
# replies grid |
|
|
|
# replies grid |
|
|
|
replies = MessageGrid(self._avatars) |
|
|
|
replies = MessageGrid(self._avatars) |
|
|
@ -111,6 +112,7 @@ class Interface(object): |
|
|
|
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) |
|
|
|
replies.connect('count-changed', self._update_replies_count) |
|
|
|
|
|
|
|
replies.connect('message-changed', self._message_changed) |
|
|
|
|
|
|
|
|
|
|
|
self._main_tabs = gtk.Notebook() |
|
|
|
self._main_tabs = gtk.Notebook() |
|
|
|
self._main_tabs.insert_page(messages, gtk.Label('Messages (0)')) |
|
|
|
self._main_tabs.insert_page(messages, gtk.Label('Messages (0)')) |
|
|
@ -393,6 +395,16 @@ class Interface(object): |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# Widget callback functions |
|
|
|
# Widget callback functions |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|
|
|
|
|
def _message_changed(self, widget, data): |
|
|
|
|
|
|
|
"""Callback from the MesageGrids when the selected message changes.""" |
|
|
|
|
|
|
|
_log.debug('Message changed to: %s', (data.message)) |
|
|
|
|
|
|
|
self._delete_action.set_property('sensitive', data.deletable) |
|
|
|
|
|
|
|
self._reply_action.set_property('sensitive', data.replyable) |
|
|
|
|
|
|
|
self._repost_action.set_property('sensitive', data.repostable) |
|
|
|
|
|
|
|
self._favorite_action.set_property('sensitive', data.favoritable) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
def _update_message_count(self, widget, data): |
|
|
|
def _update_message_count(self, widget, data): |
|
|
|
"""Callback from the MessageGrid for messages when the number of |
|
|
|
"""Callback from the MessageGrid for messages when the number of |
|
|
|
messages changes.""" |
|
|
|
messages changes.""" |
|
|
@ -464,7 +476,6 @@ class Interface(object): |
|
|
|
child = self._main_tabs.get_nth_page(page) |
|
|
|
child = self._main_tabs.get_nth_page(page) |
|
|
|
child.get_child().grab_focus() # notebook have ScrolledWindows, |
|
|
|
child.get_child().grab_focus() # notebook have ScrolledWindows, |
|
|
|
# TreeViews inside that. |
|
|
|
# TreeViews inside that. |
|
|
|
self._message_selected(child.get_child()) |
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
def _quit_app(self, widget=None, user_data=None): |
|
|
|
def _quit_app(self, widget=None, user_data=None): |
|
|
|