diff -ruN deluge-1.3.3/deluge/common.py deluge-1.3.3-dev/deluge/common.py
old
|
new
|
|
319 | 319 | fspeed_gb = fspeed_mb / 1024.0 |
320 | 320 | return "%.1f %s" % (fspeed_gb, _("GiB/s")) |
321 | 321 | |
| 322 | def fspeedtitle(bps): |
| 323 | fspeed_kb = bps / 1024.0 |
| 324 | if fspeed_kb < 1024: |
| 325 | return "%.1f%s" % (fspeed_kb, _("K")) |
| 326 | fspeed_mb = fspeed_kb / 1024.0 |
| 327 | if fspeed_mb < 1024: |
| 328 | return "%.1f%s" % (fspeed_mb, _("M")) |
| 329 | fspeed_gb = fspeed_mb / 1024.0 |
| 330 | return "%.1f%s" % (fspeed_gb, _("G")) |
| 331 | |
322 | 332 | def fpeer(num_peers, total_peers): |
323 | 333 | """ |
324 | 334 | Formats a string to show 'num_peers' ('total_peers') |
diff -ruN deluge-1.3.3/deluge/ui/gtkui/mainwindow.py deluge-1.3.3-dev/deluge/ui/gtkui/mainwindow.py
old
|
new
|
|
230 | 230 | def update(self): |
231 | 231 | # Update the window title |
232 | 232 | def _on_get_session_status(status): |
233 | | download_rate = deluge.common.fspeed(status["download_rate"]) |
234 | | upload_rate = deluge.common.fspeed(status["upload_rate"]) |
235 | | self.window.set_title("Deluge - %s %s %s %s" % (_("Down:"), download_rate, _("Up:"), upload_rate)) |
| 233 | download_rate = deluge.common.fspeedtitle(status["download_rate"]) |
| 234 | upload_rate = deluge.common.fspeedtitle(status["upload_rate"]) |
| 235 | self.window.set_title("%s%s %s%s - Deluge" % (_("D:"), download_rate, _("U:"), upload_rate)) |
236 | 236 | if self.config["show_rate_in_title"]: |
237 | 237 | client.core.get_session_status(["download_rate", "upload_rate"]).addCallback(_on_get_session_status) |
238 | 238 | |