diff --git a/deluge/ui/web/js/Deluge.Preferences.Interface.js b/deluge/ui/web/js/Deluge.Preferences.Interface.js index 3d7b02dca..98dc262c3 100644 --- a/deluge/ui/web/js/Deluge.Preferences.Interface.js +++ b/deluge/ui/web/js/Deluge.Preferences.Interface.js @@ -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() { - 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) { @@ -149,6 +171,10 @@ Ext.deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, { }); }, + onSetConfig: function() { + this.getOptionsManager().commit(); + }, + onShow: function() { Ext.deluge.preferences.Interface.superclass.onShow.call(this); Deluge.Client.web.get_config({