mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 15:08:40 +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
|
* HTML escape the field values on the details tab
|
||||||
* Fix #215, make infinite eta values display in the correct order
|
* Fix #215, make infinite eta values display in the correct order
|
||||||
* Fix displaying the protocol upload speed
|
* 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) ===
|
=== Deluge 1.2.0_rc2 (25 October 2009) ===
|
||||||
==== GtkUI ====
|
==== GtkUI ====
|
||||||
|
|
|
@ -246,6 +246,7 @@ Deluge.Menus.Torrent = new Ext.menu.Menu({
|
||||||
Ext.deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
|
Ext.deluge.StatusbarMenu = Ext.extend(Ext.menu.Menu, {
|
||||||
|
|
||||||
setValue: function(value) {
|
setValue: function(value) {
|
||||||
|
value = (value == 0) ? -1 : value;
|
||||||
var item = this.items.get(value);
|
var item = this.items.get(value);
|
||||||
if (!item) item = this.items.get('other')
|
if (!item) item = this.items.get('other')
|
||||||
item.suspendEvents();
|
item.suspendEvents();
|
||||||
|
|
|
@ -78,12 +78,12 @@
|
||||||
|
|
||||||
var updateStat = function(name, config) {
|
var updateStat = function(name, config) {
|
||||||
var item = this.items.get('statusbar-' + name);
|
var item = this.items.get('statusbar-' + name);
|
||||||
if (config.limit.value == -1) {
|
if (config.limit.value > 0) {
|
||||||
var str = (config.value.formatter) ? config.value.formatter(config.value.value) : config.value.value;
|
|
||||||
} else {
|
|
||||||
var value = (config.value.formatter) ? config.value.formatter(config.value.value) : config.value.value;
|
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 limit = (config.limit.formatter) ? config.limit.formatter(config.limit.value) : config.limit.value;
|
||||||
var str = String.format(config.format, value, limit);
|
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);
|
item.setText(str);
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue