|
|
@ -166,7 +166,7 @@ class Interface(object): |
|
|
|
<toolitem action="Delete" /> |
|
|
|
<toolitem action="Delete" /> |
|
|
|
<toolitem action="Reply" /> |
|
|
|
<toolitem action="Reply" /> |
|
|
|
<toolitem action="Repost" /> |
|
|
|
<toolitem action="Repost" /> |
|
|
|
<toolitem action="Favourite" /> |
|
|
|
<toolitem action="Favorite" /> |
|
|
|
<separator /> |
|
|
|
<separator /> |
|
|
|
<toolitem action="Settings" /> |
|
|
|
<toolitem action="Settings" /> |
|
|
|
<toolitem action="Quit" /> |
|
|
|
<toolitem action="Quit" /> |
|
|
@ -194,7 +194,7 @@ class Interface(object): |
|
|
|
<menuitem action="Delete" /> |
|
|
|
<menuitem action="Delete" /> |
|
|
|
<menuitem action="Reply" /> |
|
|
|
<menuitem action="Reply" /> |
|
|
|
<menuitem action="Repost" /> |
|
|
|
<menuitem action="Repost" /> |
|
|
|
<menuitem action="Favourite" /> |
|
|
|
<menuitem action="Favorite" /> |
|
|
|
</menu> |
|
|
|
</menu> |
|
|
|
<menu action="Help"> |
|
|
|
<menu action="Help"> |
|
|
|
<menuitem action="About" /> |
|
|
|
<menuitem action="About" /> |
|
|
@ -247,17 +247,15 @@ class Interface(object): |
|
|
|
all_read_action.connect('activate', self._mark_all_read) |
|
|
|
all_read_action.connect('activate', self._mark_all_read) |
|
|
|
self._action_group.add_action(all_read_action) |
|
|
|
self._action_group.add_action(all_read_action) |
|
|
|
|
|
|
|
|
|
|
|
self._update_action = gtk.Action('Update', _('_Update'), |
|
|
|
update_action = gtk.Action('Update', _('_Update'), |
|
|
|
_('Update your status'), gtk.STOCK_ADD) |
|
|
|
_('Update your status'), gtk.STOCK_ADD) |
|
|
|
self._update_action.connect('activate', self._update_status) |
|
|
|
update_action.connect('activate', self._update_status) |
|
|
|
self._action_group.add_action_with_accel(self._update_action, |
|
|
|
self._action_group.add_action_with_accel(update_action, 'Return') |
|
|
|
'Return') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self._cancel_action = gtk.Action('Cancel', _('_Cancel'), |
|
|
|
cancel_action = gtk.Action('Cancel', _('_Cancel'), |
|
|
|
_('Cancel the update'), gtk.STOCK_CANCEL) |
|
|
|
_('Cancel the update'), gtk.STOCK_CANCEL) |
|
|
|
self._cancel_action.connect('activate', self._clear_text) |
|
|
|
cancel_action.connect('activate', self._clear_text) |
|
|
|
self._action_group.add_action_with_accel(self._cancel_action, |
|
|
|
self._action_group.add_action_with_accel(cancel_action, 'Escape') |
|
|
|
'Escape') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
settings_action = gtk.Action('Settings', _('_Settings'), |
|
|
|
settings_action = gtk.Action('Settings', _('_Settings'), |
|
|
|
_('Settings'), gtk.STOCK_PREFERENCES) |
|
|
|
_('Settings'), gtk.STOCK_PREFERENCES) |
|
|
@ -270,32 +268,32 @@ class Interface(object): |
|
|
|
new_action.connect('activate', self._new_message) |
|
|
|
new_action.connect('activate', self._new_message) |
|
|
|
self._action_group.add_action_with_accel(new_action, '<Ctrl>n') |
|
|
|
self._action_group.add_action_with_accel(new_action, '<Ctrl>n') |
|
|
|
|
|
|
|
|
|
|
|
self._delete_action = gtk.Action('Delete', _('_Delete'), |
|
|
|
delete_action = gtk.Action('Delete', _('_Delete'), |
|
|
|
_('Delete a post'), gtk.STOCK_DELETE) |
|
|
|
_('Delete a post'), gtk.STOCK_DELETE) |
|
|
|
self._delete_action.set_property('sensitive', False) |
|
|
|
delete_action.set_property('sensitive', False) |
|
|
|
self._delete_action.connect('activate', self._delete_message) |
|
|
|
delete_action.connect('activate', self._delete_message) |
|
|
|
self._action_group.add_action_with_accel(self._delete_action, 'Delete') |
|
|
|
self._action_group.add_action_with_accel(delete_action, 'Delete') |
|
|
|
|
|
|
|
|
|
|
|
self._reply_action = gtk.Action('Reply', _('_Reply'), |
|
|
|
reply_action = gtk.Action('Reply', _('_Reply'), |
|
|
|
_("Send a response to someone's else message"), |
|
|
|
_("Send a response to someone's else message"), |
|
|
|
gtk.STOCK_REDO) |
|
|
|
gtk.STOCK_REDO) |
|
|
|
self._reply_action.set_property('sensitive', False) |
|
|
|
reply_action.set_property('sensitive', False) |
|
|
|
self._reply_action.connect('activate', self._reply_message) |
|
|
|
reply_action.connect('activate', self._reply_message) |
|
|
|
self._action_group.add_action_with_accel(self._reply_action, '<Ctrl>r') |
|
|
|
self._action_group.add_action_with_accel(reply_action, '<Ctrl>r') |
|
|
|
|
|
|
|
|
|
|
|
self._repost_action = gtk.Action('Repost', _('Re_post'), |
|
|
|
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) |
|
|
|
self._repost_action.set_property('sensitive', False) |
|
|
|
repost_action.set_property('sensitive', False) |
|
|
|
self._repost_action.connect('activate', self._repost_message) |
|
|
|
repost_action.connect('activate', self._repost_message) |
|
|
|
self._action_group.add_action_with_accel(self._repost_action, '<Ctrl>p') |
|
|
|
self._action_group.add_action_with_accel(repost_action, '<Ctrl>p') |
|
|
|
|
|
|
|
|
|
|
|
self._favorite_action = gtk.Action('Favourite', _('_Favorite'), |
|
|
|
favorite_action = gtk.Action('Favorite', _('_Favorite'), |
|
|
|
_('Toggle the favorite status of a message'), |
|
|
|
_('Toggle the favorite status of a message'), |
|
|
|
gtk.STOCK_ABOUT) |
|
|
|
gtk.STOCK_ABOUT) |
|
|
|
self._favorite_action.set_property('sensitive', False) |
|
|
|
favorite_action.set_property('sensitive', False) |
|
|
|
self._favorite_action.connect('activate', self._favorite_message) |
|
|
|
favorite_action.connect('activate', self._favorite_message) |
|
|
|
self._action_group.add_action_with_accel(self._favorite_action, '<Ctrl>f') |
|
|
|
self._action_group.add_action_with_accel(favorite_action, '<Ctrl>f') |
|
|
|
|
|
|
|
|
|
|
|
# view actions |
|
|
|
# view actions |
|
|
|
view_messages_action = gtk.Action('Messages', _('_Messages'), |
|
|
|
view_messages_action = gtk.Action('Messages', _('_Messages'), |
|
|
@ -397,10 +395,14 @@ class Interface(object): |
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|
def _message_changed(self, widget, data): |
|
|
|
def _message_changed(self, widget, data): |
|
|
|
"""Callback from the MesageGrids when the selected message changes.""" |
|
|
|
"""Callback from the MesageGrids when the selected message changes.""" |
|
|
|
self._delete_action.set_property('sensitive', data.deletable) |
|
|
|
self._action_group.get_action('Delete').set_property('sensitive', |
|
|
|
self._reply_action.set_property('sensitive', data.replyable) |
|
|
|
data.deletable) |
|
|
|
self._repost_action.set_property('sensitive', data.repostable) |
|
|
|
self._action_group.get_action('Reply').set_property('sensitive', |
|
|
|
self._favorite_action.set_property('sensitive', data.favoritable) |
|
|
|
data.replyable) |
|
|
|
|
|
|
|
self._action_group.get_action('Repost').set_property('sensitive', |
|
|
|
|
|
|
|
data.repostable) |
|
|
|
|
|
|
|
self._action_group.get_action('Favorite').set_property('sensitive', |
|
|
|
|
|
|
|
data.favoritable) |
|
|
|
|
|
|
|
|
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
@ -456,7 +458,7 @@ class Interface(object): |
|
|
|
_log.debug('Status: %s', status) |
|
|
|
_log.debug('Status: %s', status) |
|
|
|
|
|
|
|
|
|
|
|
self._update_statusbar(_('Sending update...')) |
|
|
|
self._update_statusbar(_('Sending update...')) |
|
|
|
self._update_action.set_sensitive(False) |
|
|
|
self._action_group.get_action('Update').set_sensitive(False) |
|
|
|
self._threads.add_work(self._post_update_status, |
|
|
|
self._threads.add_work(self._post_update_status, |
|
|
|
self._exception_update_status, |
|
|
|
self._exception_update_status, |
|
|
|
self._connection.update, |
|
|
|
self._connection.update, |
|
|
@ -701,10 +703,14 @@ class Interface(object): |
|
|
|
# disable the message actions (they will be activated properly when |
|
|
|
# disable the message actions (they will be activated properly when |
|
|
|
# the user leaves the textarea.) |
|
|
|
# the user leaves the textarea.) |
|
|
|
_log.debug('Disabling message actions due focus on textarea') |
|
|
|
_log.debug('Disabling message actions due focus on textarea') |
|
|
|
self._delete_action.set_property('sensitive', False) |
|
|
|
self._action_group.get_action('Delete').set_property('sensitive', |
|
|
|
self._reply_action.set_property('sensitive', False) |
|
|
|
False) |
|
|
|
self._repost_action.set_property('sensitive', False) |
|
|
|
self._action_group.get_action('Reply').set_property('sensitive', |
|
|
|
self._favorite_action.set_property('sensitive', False) |
|
|
|
False) |
|
|
|
|
|
|
|
self._action_group.get_action('Repost').set_property('sensitive', |
|
|
|
|
|
|
|
False) |
|
|
|
|
|
|
|
self._iaction_group.get_action('Favorite').set_property('sensitive', |
|
|
|
|
|
|
|
False) |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
def _new_message(self, widget, user_data=None): |
|
|
|
def _new_message(self, widget, user_data=None): |
|
|
@ -806,7 +812,7 @@ class Interface(object): |
|
|
|
def _post_update_status(self, widget, data): |
|
|
|
def _post_update_status(self, widget, data): |
|
|
|
"""Called when the status is updated correctly.""" |
|
|
|
"""Called when the status is updated correctly.""" |
|
|
|
self._update_statusbar(_('Your status was updated.')) |
|
|
|
self._update_statusbar(_('Your status was updated.')) |
|
|
|
self._update_action.set_sensitive(True) |
|
|
|
self._action_group.get_action('Update').set_sensitive(True) |
|
|
|
self._clear_text(None) |
|
|
|
self._clear_text(None) |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
@ -865,7 +871,7 @@ class Interface(object): |
|
|
|
### Results from the favorite call |
|
|
|
### Results from the favorite call |
|
|
|
def _post_favorite_message(self, widget, data): |
|
|
|
def _post_favorite_message(self, widget, data): |
|
|
|
"""Called when the message was favorited successfully.""" |
|
|
|
"""Called when the message was favorited successfully.""" |
|
|
|
_log.debug('Favourite status changed.') |
|
|
|
_log.debug('Favorite status changed.') |
|
|
|
(grid, iter) = self._favorite_info |
|
|
|
(grid, iter) = self._favorite_info |
|
|
|
message = grid.get_model().get_value(iter, 0) |
|
|
|
message = grid.get_model().get_value(iter, 0) |
|
|
|
if message.favorite: |
|
|
|
if message.favorite: |
|
|
@ -879,7 +885,7 @@ class Interface(object): |
|
|
|
|
|
|
|
|
|
|
|
def _exception_favorite_message(self, widget, exception): |
|
|
|
def _exception_favorite_message(self, widget, exception): |
|
|
|
"""Called when the message couldn't be favorited.""" |
|
|
|
"""Called when the message couldn't be favorited.""" |
|
|
|
_log.debug('Favourite error.') |
|
|
|
_log.debug('Favorite error.') |
|
|
|
_log.debug(str(exception)) |
|
|
|
_log.debug(str(exception)) |
|
|
|
|
|
|
|
|
|
|
|
error_win = gtk.MessageDialog(parent=self._main_window, |
|
|
|
error_win = gtk.MessageDialog(parent=self._main_window, |
|
|
|