hide progressbar in profile window when not used. fixes #2852

This commit is contained in:
Yann Leboulanger 2007-01-02 17:01:33 +00:00
parent 77f8e66ff4
commit 4a58db0fca

View file

@ -239,9 +239,8 @@ class ProfileWindow:
self.remove_statusbar_timeout_id = gobject.timeout_add(3000, self.remove_statusbar_timeout_id = gobject.timeout_add(3000,
self.remove_statusbar, self.message_id) self.remove_statusbar, self.message_id)
gobject.source_remove(self.update_progressbar_timeout_id) gobject.source_remove(self.update_progressbar_timeout_id)
# redraw progressbar after avatar is set so that windows is already self.progressbar.hide()
# resized. Else progressbar is not correctly redrawn self.progressbar.set_fraction(0)
gobject.idle_add(self.progressbar.set_fraction, 0)
self.update_progressbar_timeout_id = None self.update_progressbar_timeout_id = None
def add_to_vcard(self, vcard, entry, txt): def add_to_vcard(self, vcard, entry, txt):
@ -318,13 +317,13 @@ class ProfileWindow:
gajim.connections[self.account].send_vcard(vcard) gajim.connections[self.account].send_vcard(vcard)
self.message_id = self.statusbar.push(self.context_id, self.message_id = self.statusbar.push(self.context_id,
_('Sending profile...')) _('Sending profile...'))
self.progressbar.show()
self.update_progressbar_timeout_id = gobject.timeout_add(100, self.update_progressbar_timeout_id = gobject.timeout_add(100,
self.update_progressbar) self.update_progressbar)
def vcard_published(self): def vcard_published(self):
if self.update_progressbar_timeout_id is not None: if self.update_progressbar_timeout_id is not None:
gobject.source_remove(self.update_progressbar_timeout_id) gobject.source_remove(self.update_progressbar_timeout_id)
self.progressbar.set_fraction(0)
self.update_progressbar_timeout_id = None self.update_progressbar_timeout_id = None
self.window.destroy() self.window.destroy()