Browse Source

Delete now removes the message from the list after success

master
Julio Biason 15 years ago
parent
commit
94367b3fc9
  1. 10
      mitterlib/ui/ui_pygtk.py

10
mitterlib/ui/ui_pygtk.py

@ -768,6 +768,7 @@ class Interface(object):
error_dialog.destroy() error_dialog.destroy()
return return
self._delete_iter = iter
_log.debug('Deleting messing %d', message.id) _log.debug('Deleting messing %d', message.id)
self._threads.add_work(self._post_delete_message, self._threads.add_work(self._post_delete_message,
self._exception_delete_message, self._exception_delete_message,
@ -850,6 +851,9 @@ class Interface(object):
def _post_delete_message(self, widget, data): def _post_delete_message(self, widget, data):
"""Called when the message is deleted successfully.""" """Called when the message is deleted successfully."""
_log.debug('Message deleted.') _log.debug('Message deleted.')
if self._delete_iter:
self._grid.get_model().remove(self._delete_iter)
self._delete_iter = None
return return
def _exception_delete_message(self, widget, exception): def _exception_delete_message(self, widget, exception):
@ -887,6 +891,12 @@ class Interface(object):
self._default_pixmap = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, self._default_pixmap = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,
has_alpha=False, bits_per_sample=8, width=48, height=48) has_alpha=False, bits_per_sample=8, width=48, height=48)
# This is the ugly bit for speeding up things and making
# interthread communication.
self._delete_iter = None
self._reply_message = None
self._repost_message = None
return return
def __call__(self): def __call__(self):

Loading…
Cancel
Save