update the proxyfield comboboxes and switch some simplestores to arraystores

This commit is contained in:
Damien Churchill 2010-04-28 08:21:30 +01:00
commit 9f185da446
2 changed files with 120 additions and 121 deletions

View file

@ -57,7 +57,7 @@ Deluge.preferences.Encryption = Ext.extend(Ext.form.FormPanel, {
fieldLabel: _('Inbound'),
mode: 'local',
width: 150,
store: new Ext.data.SimpleStore({
store: new Ext.data.ArrayStore({
fields: ['id', 'text'],
data: [
[0, _('Forced')],

View file

@ -48,13 +48,13 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
initComponent: function() {
Deluge.preferences.ProxyField.superclass.initComponent.call(this);
this.type = this.add({
this.proxyType = this.add({
xtype: 'combo',
fieldLabel: _('Type'),
name: 'type',
name: 'proxytype',
mode: 'local',
width: 150,
store: new Ext.data.SimpleStore({
store: new Ext.data.ArrayStore({
fields: ['id', 'text'],
data: [
[0, _('None')],
@ -65,11 +65,11 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
[5, _('HTTP with Auth')]
]
}),
value: 0,
editable: false,
triggerAction: 'all',
valueField: 'id',
displayField: 'text'
})
});
this.hostname = this.add({
xtype: 'textfield',
name: 'hostname',
@ -105,8 +105,8 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
width: 220
});
this.type.on('change', this.onFieldChange, this);
this.type.on('select', this.onTypeSelect, this);
this.proxyType.on('change', this.onFieldChange, this);
this.proxyType.on('select', this.onTypeSelect, this);
this.setting = false;
},
@ -116,7 +116,7 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
getValue: function() {
return {
'type': this.type.getValue(),
'type': this.proxyType.getValue(),
'hostname': this.hostname.getValue(),
'port': Number(this.port.getValue()),
'username': this.username.getValue(),
@ -127,9 +127,9 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
// Set the values of the proxies
setValue: function(value) {
this.setting = true;
this.type.setValue(value['type']);
var index = this.type.getStore().find('id', value['type']);
var record = this.type.getStore().getAt(index);
this.proxyType.setValue(value['type']);
var index = this.proxyType.getStore().find('id', value['type']);
var record = this.proxyType.getStore().getAt(index);
this.hostname.setValue(value['hostname']);
this.port.setValue(value['port']);
@ -167,4 +167,3 @@ Deluge.preferences.ProxyField = Ext.extend(Ext.form.FieldSet, {
}
}
});