fix a bug in converting non-boolean values back to boolean in the options manager

This commit is contained in:
Damien Churchill 2009-10-12 09:53:13 +00:00
parent a3636ccdb7
commit 3d85791a03
1 changed files with 8 additions and 3 deletions

View File

@ -207,7 +207,12 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
value = Number(value);
break;
case 'boolean':
value = Boolean(value);
if (Ext.type(value) == 'string') {
value = value.toLowerCase();
value = (value == 'true' || value == '1' || value == 'on') ? true : false;
} else {
value = Boolean(value);
}
break;
}
}
@ -243,7 +248,7 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
* @private
*/
onFieldChange: function(field, event) {
this.update(field._doption, field.getValue());
this.update(field._doption, field.getValue());
},
/**
@ -268,4 +273,4 @@ Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
bind.setValue(newValue);
}, this)
}
});
});