redraw ft progressbar only every 500ms instead of on every packet. see #2631

This commit is contained in:
Yann Leboulanger 2006-11-18 14:45:25 +00:00
parent ab18937048
commit 8d1eaf0e4e
1 changed files with 8 additions and 2 deletions

View File

@ -1251,8 +1251,11 @@ class Interface:
path_to_image = path, title = event_type, text = txt) path_to_image = path, title = event_type, text = txt)
def handle_event_file_progress(self, account, file_props): def handle_event_file_progress(self, account, file_props):
self.instances['file_transfers'].set_progress(file_props['type'], if time.time() - self.last_ftwindow_update > 0.5:
file_props['sid'], file_props['received-len']) # update ft window every 500ms
self.last_ftwindow_update = time.time()
self.instances['file_transfers'].set_progress(file_props['type'],
file_props['sid'], file_props['received-len'])
def handle_event_file_rcv_completed(self, account, file_props): def handle_event_file_rcv_completed(self, account, file_props):
ft = self.instances['file_transfers'] ft = self.instances['file_transfers']
@ -2012,6 +2015,9 @@ class Interface:
'choose another language by setting the speller_language option.' 'choose another language by setting the speller_language option.'
) % lang) ) % lang)
gajim.config.set('use_speller', False) gajim.config.set('use_speller', False)
self.last_ftwindow_update = 0
gobject.timeout_add(100, self.autoconnect) gobject.timeout_add(100, self.autoconnect)
gobject.timeout_add(200, self.process_connections) gobject.timeout_add(200, self.process_connections)
gobject.timeout_add(500, self.read_sleepy) gobject.timeout_add(500, self.read_sleepy)