|
|
@ -396,17 +396,13 @@ class Interface(object): |
|
|
|
self._delete_action.set_property('sensitive', False) |
|
|
|
self._delete_action.set_property('sensitive', False) |
|
|
|
self._delete_action.connect('activate', self._delete_message) |
|
|
|
self._delete_action.connect('activate', self._delete_message) |
|
|
|
action_group.add_action_with_accel(self._delete_action, 'Delete') |
|
|
|
action_group.add_action_with_accel(self._delete_action, 'Delete') |
|
|
|
# TODO: Check the accelerator |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self._reply_action = gtk.Action('Reply', '_Reply', |
|
|
|
self._reply_action = gtk.Action('Reply', '_Reply', |
|
|
|
"Send a response to someone's else message", gtk.STOCK_REDO) |
|
|
|
"Send a response to someone's else message", gtk.STOCK_REDO) |
|
|
|
self._reply_action.set_property('sensitive', False) |
|
|
|
self._reply_action.set_property('sensitive', False) |
|
|
|
# TODO: Connect |
|
|
|
self._reply_action.connect('activate', self._reply_message) |
|
|
|
# TODO: Connecting function should indicate in the status bar that |
|
|
|
|
|
|
|
# a reply will be made |
|
|
|
|
|
|
|
action_group.add_action_with_accel(self._reply_action, '<Ctrl>r') |
|
|
|
action_group.add_action_with_accel(self._reply_action, '<Ctrl>r') |
|
|
|
|
|
|
|
|
|
|
|
# TODO: Find a better word (non-network related) to this |
|
|
|
|
|
|
|
self._repost_action = gtk.Action('Repost', 'Re_post', |
|
|
|
self._repost_action = gtk.Action('Repost', 'Re_post', |
|
|
|
"Put someone's else message on your timeline", |
|
|
|
"Put someone's else message on your timeline", |
|
|
|
gtk.STOCK_CONVERT) |
|
|
|
gtk.STOCK_CONVERT) |
|
|
@ -762,17 +758,6 @@ class Interface(object): |
|
|
|
(model, iter) = self._grid.get_selection().get_selected() |
|
|
|
(model, iter) = self._grid.get_selection().get_selected() |
|
|
|
message = model.get_value(iter, 0) |
|
|
|
message = model.get_value(iter, 0) |
|
|
|
|
|
|
|
|
|
|
|
if not self._connection.can_delete(message): |
|
|
|
|
|
|
|
# Since we delete only one message, we don't need to worry about |
|
|
|
|
|
|
|
# multiple networks here. |
|
|
|
|
|
|
|
error_dialog = gtk.MessageDialog(parent=self._main_window, |
|
|
|
|
|
|
|
type=gtk.MESSAGE_ERROR, |
|
|
|
|
|
|
|
message_format='Message cannot be deleted', |
|
|
|
|
|
|
|
buttons=gtk.BUTTONS_OK) |
|
|
|
|
|
|
|
error_dialog.run() |
|
|
|
|
|
|
|
error_dialog.destroy() |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self._update_statusbar('Deleting message...') |
|
|
|
self._update_statusbar('Deleting message...') |
|
|
|
self._delete_iter = iter |
|
|
|
self._delete_iter = iter |
|
|
|
_log.debug('Deleting messing %d', message.id) |
|
|
|
_log.debug('Deleting messing %d', message.id) |
|
|
@ -782,6 +767,17 @@ class Interface(object): |
|
|
|
message) |
|
|
|
message) |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _reply_message(self, widget, user_data=None): |
|
|
|
|
|
|
|
"""Reply to someone's else message.""" |
|
|
|
|
|
|
|
(model, iter) = self._grid.get_selection().get_selected() |
|
|
|
|
|
|
|
message = model.get_value(iter, 0) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self._reply_label.set_text('Replying to %s' % (message.username)) |
|
|
|
|
|
|
|
self._reply_message_id = message |
|
|
|
|
|
|
|
self._update_text.grab_focus() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# Network related functions |
|
|
|
# Network related functions |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
@ -906,8 +902,8 @@ class Interface(object): |
|
|
|
# This is the ugly bit for speeding up things and making |
|
|
|
# This is the ugly bit for speeding up things and making |
|
|
|
# interthread communication. |
|
|
|
# interthread communication. |
|
|
|
self._delete_iter = None |
|
|
|
self._delete_iter = None |
|
|
|
self._reply_message = None |
|
|
|
self._reply_message_id = None |
|
|
|
self._repost_message = None |
|
|
|
self._repost_message_id = None |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|