From 5f9b221b87005616ee59f165d97dfafd248bfb54 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sun, 20 Dec 2009 16:58:04 -0200 Subject: [PATCH] Generic grid functions, in the hope they will work for a "replies" grid. --- mitterlib/ui/ui_pygtk.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 6a21414..04458c1 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -640,11 +640,11 @@ class Interface(object): self._reply_label.set_text('') return - def _url_popup(self, path, event): + def _url_popup(self, widget, path, event): """Builds the popup with URLs in the cell pointed by *path*. Requires the *event* that the widget received.""" - iter = self._grid.get_model().get_iter(path) - message = self._grid.get_model().get_value(iter, 0) + iter = widget.get_model().get_iter(path) + message = widget.get_model().get_value(iter, 0) popup = gtk.Menu() @@ -952,22 +952,22 @@ class Interface(object): # not right click return False - path = self._grid.get_path_at_pos(event.x, event.y) + path = widget.get_path_at_pos(event.x, event.y) if not path: return False (path, _, _, _) = path - return self._url_popup(path, event) + return self._url_popup(widget, path, event) return True def _message_popup(self, widget, event, user_data=None): """Builds the popup with the URLs in the message.""" _log.debug('Popup') - (path, _) = self._grid.get_cursor() + (path, _) = widget.get_cursor() if not path: return True - return self._url_popup(path, event) + return self._url_popup(widget, path, event) def _open_url(self, widget, user_data=None): """Opens an URL (used mostly from popup menu items.)""" @@ -976,12 +976,12 @@ class Interface(object): def _mark_message_read(self, widget, user_data=None): """Mark a message as read when it's selected.""" - (path, _) = self._grid.get_cursor() + (path, _) = widget.get_cursor() if not path: return True - iter = self._grid.get_model().get_iter(path) - message = self._grid.get_model().get_value(iter, 0) + iter = widget.get_model().get_iter(path) + message = widget.get_model().get_value(iter, 0) if message.read: return True