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["payload_download_rate"]) |
| 234 | upload_rate = deluge.common.fspeedtitle(status["payload_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 | | client.core.get_session_status(["download_rate", "upload_rate"]).addCallback(_on_get_session_status) |
| 237 | client.core.get_session_status(["payload_download_rate", "payload_upload_rate"]).addCallback(_on_get_session_status) |
238 | 238 | |
239 | 239 | def _on_set_show_rate_in_title(self, key, value): |
240 | 240 | if value: |
diff -ruN deluge-1.3.3/deluge/ui/web/js/deluge-all/Formatters.js deluge-1.3.3-dev/deluge/ui/web/js/deluge-all/Formatters.js
old
|
new
|
|
92 | 92 | return (!bytes && !showZero) ? '' : fsize(bytes, showZero) + '/s'; |
93 | 93 | }, |
94 | 94 | |
| 95 | speedtitle: function(bytes, showZero) { |
| 96 | if (!bytes && !showZero) return ''; |
| 97 | bytes = bytes / 1024.0; |
| 98 | |
| 99 | if (bytes < 1024) { return bytes.toFixed(1) + 'K'; } |
| 100 | else { bytes = bytes / 1024; } |
| 101 | |
| 102 | if (bytes < 1024) { return bytes.toFixed(1) + 'M'; } |
| 103 | else { bytes = bytes / 1024; } |
| 104 | |
| 105 | return bytes.toFixed(1) + 'G' |
| 106 | }, |
| 107 | |
95 | 108 | /** |
96 | 109 | * Formats a string to show time in a human readable form. |
97 | 110 | * |
… |
… |
|
150 | 163 | } |
151 | 164 | var fsize = Deluge.Formatters.size; |
152 | 165 | var fspeed = Deluge.Formatters.speed; |
| 166 | var fspeedtitle = Deluge.Formatters.speedtitle; |
153 | 167 | var ftime = Deluge.Formatters.timeRemaining; |
154 | 168 | var fdate = Deluge.Formatters.date; |
155 | 169 | var fplain = Deluge.Formatters.plain; |
diff -ruN deluge-1.3.3/deluge/ui/web/js/deluge-all/UI.js deluge-1.3.3-dev/deluge/ui/web/js/deluge-all/UI.js
old
|
new
|
|
169 | 169 | |
170 | 170 | if (deluge.config.show_session_speed) { |
171 | 171 | document.title = this.originalTitle + |
172 | | ' (Down: ' + fspeed(data['stats'].download_rate, true) + |
173 | | ' Up: ' + fspeed(data['stats'].upload_rate, true) + ')'; |
| 172 | ' (D:' + fspeedtitle(data['stats'].download_rate, true) + |
| 173 | ' U:' + fspeedtitle(data['stats'].upload_rate, true) + ')'; |
174 | 174 | } |
175 | 175 | if (Ext.areObjectsEqual(this.filters, this.oldFilters)) { |
176 | 176 | deluge.torrents.update(data['torrents']); |