From 589fb940ed055b2d1a9333a7cc0ae09cbb68add0 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sun, 28 Mar 2010 12:15:30 -0300 Subject: [PATCH] replies receive a NetworkUser object, so it may be easier to change in in the future --- mitterlib/ui/helpers/gtk_updatebox.py | 4 +--- mitterlib/ui/ui_pygtk.py | 15 ++++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/mitterlib/ui/helpers/gtk_updatebox.py b/mitterlib/ui/helpers/gtk_updatebox.py index 2608ff6..7d322c8 100644 --- a/mitterlib/ui/helpers/gtk_updatebox.py +++ b/mitterlib/ui/helpers/gtk_updatebox.py @@ -42,8 +42,6 @@ class UpdateBox(gtk.VBox): def __init__(self, avatar, spell_check=True): super(UpdateBox, self).__init__(False, 0) - self._reply_to = None - self._text = gtk.TextView() self._text.set_property('wrap-mode', gtk.WRAP_WORD) @@ -97,7 +95,7 @@ class UpdateBox(gtk.VBox): self.show_all() if reply_to: - info = _('(replying to %s)') % (self._reply_to) + info = _('(replying to %s)') % (reply_to.username) self._update_info.set_text(info) else: self._update_info.set_text('') diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 9383b68..cfcb33b 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -595,16 +595,15 @@ class Interface(object): store.sort_column_changed() return - def _show_update_box(self): - """Enables the update box.""" - self._update_field.show() - return - # ------------------------------------------------------------ # Widget callback functions # ------------------------------------------------------------ def _update_status(self, widget): """Update your status.""" + if not self._update_field.get_property('visible'): + self._update_field.show() + return + status = self._update_field.text.strip() if not status: self._update_field.hide() @@ -784,11 +783,9 @@ class Interface(object): (grid, _) = self._grids[self._main_tabs.get_current_page()] (model, iter) = grid.get_selection().get_selected() message = model.get_value(iter, 0) - self._update_text.get_buffer().set_text( - self._connection.reply_prefix(message)) + self._update_field.text = self._connection.reply_prefix(message) self._reply_message_id = message - self._show_update_box() - + self._update_field.show(message.author) return def _repost_message(self, widget, user_data=None):