|
|
@ -407,9 +407,7 @@ class Interface(object): |
|
|
|
"Put someone's else message on your timeline", |
|
|
|
"Put someone's else message on your timeline", |
|
|
|
gtk.STOCK_CONVERT) |
|
|
|
gtk.STOCK_CONVERT) |
|
|
|
self._repost_action.set_property('sensitive', False) |
|
|
|
self._repost_action.set_property('sensitive', False) |
|
|
|
# TODO: Connect |
|
|
|
self._repost_action.connect('activate', self._repost_message) |
|
|
|
# TODO: Connecting function should indicate in the status bar that |
|
|
|
|
|
|
|
# a repost will be made. |
|
|
|
|
|
|
|
action_group.add_action_with_accel(self._repost_action, '<Ctrl>p') |
|
|
|
action_group.add_action_with_accel(self._repost_action, '<Ctrl>p') |
|
|
|
|
|
|
|
|
|
|
|
# Help actions |
|
|
|
# Help actions |
|
|
@ -558,6 +556,8 @@ class Interface(object): |
|
|
|
|
|
|
|
|
|
|
|
# unescape escaped entities that pango is not okay with |
|
|
|
# unescape escaped entities that pango is not okay with |
|
|
|
message = re.sub(r'&', r'&', message) |
|
|
|
message = re.sub(r'&', r'&', message) |
|
|
|
|
|
|
|
message = re.sub(r'<', r'<', message) |
|
|
|
|
|
|
|
message = re.sub(r'>', r'>', message) |
|
|
|
|
|
|
|
|
|
|
|
# highlight URLs |
|
|
|
# highlight URLs |
|
|
|
mask = r'<span foreground="%s">\1</span>' % ( |
|
|
|
mask = r'<span foreground="%s">\1</span>' % ( |
|
|
@ -792,7 +792,7 @@ class Interface(object): |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
def _reply_message(self, widget, user_data=None): |
|
|
|
def _reply_message(self, widget, user_data=None): |
|
|
|
"""Reply to someone's else message.""" |
|
|
|
"""Reply to someone else's message.""" |
|
|
|
(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) |
|
|
|
|
|
|
|
|
|
|
@ -802,6 +802,18 @@ class Interface(object): |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _repost_message(self, widget, user_data=None): |
|
|
|
|
|
|
|
"""Repost someone else's message on your timeline.""" |
|
|
|
|
|
|
|
(model, iter)= self._grid.get_selection().get_selected() |
|
|
|
|
|
|
|
message = model.get_value(iter, 0) |
|
|
|
|
|
|
|
self._update_statusbar('Reposting %s message...' % |
|
|
|
|
|
|
|
(message.username)) |
|
|
|
|
|
|
|
self._threads.add_work(self._post_repost_message, |
|
|
|
|
|
|
|
self._exception_repost_message, |
|
|
|
|
|
|
|
self._connection.repost, |
|
|
|
|
|
|
|
message) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# Network related functions |
|
|
|
# Network related functions |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
@ -896,6 +908,19 @@ class Interface(object): |
|
|
|
_log.debug(str(exception)) |
|
|
|
_log.debug(str(exception)) |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Results for the repost message call |
|
|
|
|
|
|
|
def _post_repost_message(self, widget, data): |
|
|
|
|
|
|
|
"""Called when the message is reposted successfully.""" |
|
|
|
|
|
|
|
_log.debug('Repost successful') |
|
|
|
|
|
|
|
self._update_statusbar('Message reposted') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _exception_repost_message(self, widget, exception): |
|
|
|
|
|
|
|
"""Called when the message cannot be reposted.""" |
|
|
|
|
|
|
|
_log.debug('Repost error.') |
|
|
|
|
|
|
|
_log.debug(str(exception)) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# Required functions for all interfaces |
|
|
|
# Required functions for all interfaces |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|