mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 11:35:49 +00:00
fix #990, showing 0 as a limit when it means unlimited in the statusbar
This commit is contained in:
parent
d44efe8a66
commit
145f402aa2
3 changed files with 5 additions and 3 deletions
|
@ -12,6 +12,7 @@
|
|||
* HTML escape the field values on the details tab
|
||||
* Fix #215, make infinite eta values display in the correct order
|
||||
* Fix displaying the protocol upload speed
|
||||
* Fix #990, showing 0 as a limit when it means unlimited in the statusbar
|
||||
|
||||
=== Deluge 1.2.0_rc2 (25 October 2009) ===
|
||||
==== GtkUI ====
|
||||
|
|
|
@ -246,6 +246,7 @@ Deluge.Menus.Torrent = new Ext.menu.Menu({
|
|||
Ext.deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
|
||||
|
||||
setValue: function(value) {
|
||||
value = (value == 0) ? -1 : value;
|
||||
var item = this.items.get(value);
|
||||
if (!item) item = this.items.get('other')
|
||||
item.suspendEvents();
|
||||
|
|
|
@ -78,12 +78,12 @@
|
|||
|
||||
var updateStat = function(name, config) {
|
||||
var item = this.items.get('statusbar-' + name);
|
||||
if (config.limit.value == -1) {
|
||||
var str = (config.value.formatter) ? config.value.formatter(config.value.value) : config.value.value;
|
||||
} else {
|
||||
if (config.limit.value > 0) {
|
||||
var value = (config.value.formatter) ? config.value.formatter(config.value.value) : config.value.value;
|
||||
var limit = (config.limit.formatter) ? config.limit.formatter(config.limit.value) : config.limit.value;
|
||||
var str = String.format(config.format, value, limit);
|
||||
} else {
|
||||
var str = (config.value.formatter) ? config.value.formatter(config.value.value) : config.value.value;
|
||||
}
|
||||
item.setText(str);
|
||||
}.bind(this);
|
||||
|
|
Loading…
Add table
Reference in a new issue