Improve performance of files tab by only updating when values change

This commit is contained in:
Andrew Resch 2008-09-29 23:52:53 +00:00
commit cd2084b421
2 changed files with 12 additions and 3 deletions

View file

@ -4,6 +4,9 @@ Deluge 1.0.1 (In Development)
will automatically open more slots to meet the upload speed limit. will automatically open more slots to meet the upload speed limit.
* Fix display of tracker error messages * Fix display of tracker error messages
GtkUI:
* Improve performance of files tab by only updating when values change
Misc: Misc:
* Fix #187 set a 5 second timer to save the config file after a config value * Fix #187 set a 5 second timer to save the config file after a config value
has been changed. has been changed.

View file

@ -382,9 +382,15 @@ class FilesTab(Tab):
self.get_files_from_tree(self.treestore, files_list, 0) self.get_files_from_tree(self.treestore, files_list, 0)
files_list.sort() files_list.sort()
for index, row in files_list: for index, row in files_list:
row[2] = "%.2f%%" % (status["file_progress"][index] * 100) progress_string = "%.2f%%" % (status["file_progress"][index] * 100)
row[3] = status["file_progress"][index] * 100 if row[2] != progress_string:
row[4] = status["file_priorities"][index] row[2] = progress_string
progress_value = status["file_progress"][index] * 100
if row[3] != progress_value:
row[3] = progress_value
file_priority = status["file_priorities"][index]
if row[4] != file_priority:
row[4] = file_priority
def _on_button_press_event(self, widget, event): def _on_button_press_event(self, widget, event):
"""This is a callback for showing the right-click context menu.""" """This is a callback for showing the right-click context menu."""