Some tweaks to availability and piece size display.

This commit is contained in:
Alex Dedul 2007-07-21 18:59:01 +00:00
parent 7a37c58dde
commit 4f266454ec
3 changed files with 875 additions and 908 deletions

File diff suppressed because it is too large Load Diff

View File

@ -742,7 +742,7 @@ static PyObject *torrent_get_torrent_state(PyObject *self, PyObject *args)
"state", s.state,
"num_peers", connected_peers,
"num_seeds", connected_seeds,
"distributed_copies", s.distributed_copies,
"distributed_copies", s.distributed_copies == -1.0 ? 0.0 : s.distributed_copies,
"download_rate", s.download_rate,
"upload_rate", s.upload_rate,
"total_download", s.total_download,

View File

@ -613,7 +613,6 @@ class DelugeGTK:
self.text_summary_name = self.wtree.get_widget("summary_name")
self.text_summary_total_size = self.wtree.get_widget("summary_total_size")
self.text_summary_pieces = self.wtree.get_widget("summary_pieces")
self.text_summary_piece_size = self.wtree.get_widget("summary_piece_size")
self.text_summary_availability = self.wtree.get_widget("summary_availability")
self.text_summary_total_downloaded = self.wtree.get_widget("summary_total_downloaded")
self.text_summary_total_uploaded = self.wtree.get_widget("summary_total_uploaded")
@ -998,9 +997,9 @@ class DelugeGTK:
state = self.manager.get_torrent_state(unique_id)
self.wtree.get_widget("summary_name").set_text(state['name'])
self.text_summary_total_size.set_text(common.fsize(state["total_wanted"]))
self.text_summary_pieces.set_text(str(state["num_pieces"]))
self.text_summary_piece_size.set_text(common.fsize(state["piece_length"]))
self.text_summary_availability.set_text(str(round(state["distributed_copies"], 2)))
self.text_summary_pieces.set_text('%s x %s' % \
(state["num_pieces"], common.fsize(state["piece_length"])))
self.text_summary_availability.set_text('%.3f' % state["distributed_copies"])
self.text_summary_total_downloaded.set_text(common.fsize(state["total_done"]) \
+ " (" + common.fsize(state["total_download"]) + ")")
self.text_summary_total_uploaded.set_text(common.fsize(self.manager.unique_IDs\
@ -1230,7 +1229,6 @@ class DelugeGTK:
self.wtree.get_widget("summary_name").set_text("")
self.text_summary_total_size.set_text("")
self.text_summary_pieces.set_text("")
self.text_summary_piece_size.set_text("")
self.text_summary_availability.set_text("")
self.text_summary_total_downloaded.set_text("")
self.text_summary_total_uploaded.set_text("")