add the session timeout to one of the options on the interface preferences

This commit is contained in:
Damien Churchill 2009-08-20 00:32:32 +00:00
parent 1a635e8860
commit e676bcf576

View File

@ -94,10 +94,32 @@ Ext.deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
} }
} }
}); });
fieldset = this.add({
xtype: 'fieldset',
border: false,
title: _('Session'),
autoHeight: true,
labelWidth: 110,
defaultType: 'uxspinner',
defaults: {
width: 80,
}
});
optMan.bind('session_timeout', fieldset.add({
name: 'session_timeout',
fieldLabel: _('Session Timeout')
}));
}, },
onApply: function() { onApply: function() {
alert('apply'); var changed = this.optionsManager.getDirty();
if (!Ext.isObjectEmpty(changed)) {
Deluge.Client.web.set_config(changed, {
success: this.onSetConfig,
scope: this
});
}
}, },
onGotConfig: function(config) { onGotConfig: function(config) {
@ -149,6 +171,10 @@ Ext.deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
}); });
}, },
onSetConfig: function() {
this.getOptionsManager().commit();
},
onShow: function() { onShow: function() {
Ext.deluge.preferences.Interface.superclass.onShow.call(this); Ext.deluge.preferences.Interface.superclass.onShow.call(this);
Deluge.Client.web.get_config({ Deluge.Client.web.get_config({