Author: damoxc
Revision: 5889
Log:
fix #990, showing 0 as a limit when it means unlimited in the statusbar
Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog 2009-10-28 15:55:19 UTC (rev 5888)
+++ branches/1.2_RC/ChangeLog 2009-10-28 17:38:35 UTC (rev 5889)
@@ -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 ====
Modified: branches/1.2_RC/deluge/ui/web/js/Deluge.Menus.js
===================================================================
--- branches/1.2_RC/deluge/ui/web/js/Deluge.Menus.js 2009-10-28 15:55:19 UTC
(rev 5888)
+++ branches/1.2_RC/deluge/ui/web/js/Deluge.Menus.js 2009-10-28 17:38:35 UTC
(rev 5889)
@@ -246,6 +246,7 @@
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();
Modified: branches/1.2_RC/deluge/ui/web/js/Deluge.Statusbar.js
===================================================================
--- branches/1.2_RC/deluge/ui/web/js/Deluge.Statusbar.js 2009-10-28
15:55:19 UTC (rev 5888)
+++ branches/1.2_RC/deluge/ui/web/js/Deluge.Statusbar.js 2009-10-28
17:38:35 UTC (rev 5889)
@@ -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);
Modified: trunk/deluge/ui/web/js/Deluge.Menus.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.Menus.js 2009-10-28 15:55:19 UTC (rev
5888)
+++ trunk/deluge/ui/web/js/Deluge.Menus.js 2009-10-28 17:38:35 UTC (rev
5889)
@@ -246,6 +246,7 @@
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();
Modified: trunk/deluge/ui/web/js/Deluge.Statusbar.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.Statusbar.js 2009-10-28 15:55:19 UTC (rev
5888)
+++ trunk/deluge/ui/web/js/Deluge.Statusbar.js 2009-10-28 17:38:35 UTC (rev
5889)
@@ -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);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---