From 04d937a94d94ea1183ee964531de489c749a3811 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Mon, 5 Apr 2010 12:33:22 -0300 Subject: [PATCH] Reposting also works now. --- mitterlib/ui/ui_pygtk.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 77e641f..3ad117c 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -549,9 +549,12 @@ class Interface(object): def _repost_message(self, widget, user_data=None): """Repost someone else's message on your timeline.""" - (grid, counter) = self._grids[self._main_tabs.get_current_page()] - (model, iter) = grid.get_selection().get_selected() - message = model.get_value(iter, 0) + page = self._main_tabs.get_current_page() + grid = self._main_tabs.get_nth_page(page) + message = grid.selected + if not message: + return + self._update_statusbar(_('Reposting %s message...') % (message.author.username)) self._threads.add_work(self._post_repost_message, @@ -562,11 +565,14 @@ class Interface(object): def _favorite_message(self, widget, user_data=None): """Toggle the favorite status of a message.""" - (grid, counter) = self._grids[self._main_tabs.get_current_page()] - (model, iter) = grid.get_selection().get_selected() - message = model.get_value(iter, 0) + page = self._main_tabs.get_current_page() + grid = self._main_tabs.get_nth_page(page) + message = grid.selected + if not message: + return - self._favorite_info = (grid, iter) + # TODO: I removed the iterator for the grid; we need to find a wait to + # the tell the grid a message was favorited if message.favorite: display = _('Removing message from %s from favorites...')