mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-20 19:44:52 +00:00
convert the daemon preferences page into a class
This commit is contained in:
parent
525ffee93e
commit
c76e67b109
1 changed files with 53 additions and 36 deletions
|
@ -1,44 +1,61 @@
|
|||
Deluge.Preferences.addPage({
|
||||
border: false,
|
||||
title: _('Daemon'),
|
||||
xtype: 'form',
|
||||
layout: 'form',
|
||||
items: [{
|
||||
xtype: 'fieldset',
|
||||
border: false,
|
||||
title: _('Port'),
|
||||
autoHeight: true,
|
||||
defaultType: 'uxspinner',
|
||||
items: [{
|
||||
Ext.namespace('Ext.deluge.preferences');
|
||||
Ext.deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
|
||||
constructor: function(config) {
|
||||
config = Ext.apply({
|
||||
border: false,
|
||||
title: _('Daemon'),
|
||||
layout: 'form'
|
||||
}, config);
|
||||
Ext.deluge.preferences.Daemon.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
Ext.deluge.preferences.Daemon.superclass.initComponent.call(this);
|
||||
|
||||
var optMan = Deluge.Preferences.getOptionsManager();
|
||||
|
||||
var fieldset = this.add({
|
||||
xtype: 'fieldset',
|
||||
border: false,
|
||||
title: _('Port'),
|
||||
autoHeight: true,
|
||||
defaultType: 'uxspinner'
|
||||
});
|
||||
optMan.bind('daemon_port', fieldset.add({
|
||||
fieldLabel: _('Daemon port'),
|
||||
id: 'daemon_port'
|
||||
}]
|
||||
}, {
|
||||
xtype: 'fieldset',
|
||||
border: false,
|
||||
title: _('Connections'),
|
||||
autoHeight: true,
|
||||
labelWidth: 1,
|
||||
defaultType: 'checkbox',
|
||||
items: [{
|
||||
name: 'daemon_port'
|
||||
}));
|
||||
|
||||
fieldset = this.add({
|
||||
xtype: 'fieldset',
|
||||
border: false,
|
||||
title: _('Connections'),
|
||||
autoHeight: true,
|
||||
labelWidth: 1,
|
||||
defaultType: 'checkbox'
|
||||
});
|
||||
optMan.bind('allow_remote', fieldset.add({
|
||||
fieldLabel: '',
|
||||
labelSeparator: '',
|
||||
boxLabel: _('Allow Remote Connections'),
|
||||
id: 'allow_remote'
|
||||
}]
|
||||
}, {
|
||||
xtype: 'fieldset',
|
||||
border: false,
|
||||
title: _('Other'),
|
||||
autoHeight: true,
|
||||
labelWidth: 1,
|
||||
defaultType: 'checkbox',
|
||||
items: [{
|
||||
name: 'allow_remote'
|
||||
}));
|
||||
|
||||
fieldset = this.add({
|
||||
xtype: 'fieldset',
|
||||
border: false,
|
||||
title: _('Other'),
|
||||
autoHeight: true,
|
||||
labelWidth: 1,
|
||||
defaultType: 'checkbox'
|
||||
});
|
||||
optMan.bind('new_release_check', fieldset.add({
|
||||
fieldLabel: '',
|
||||
labelSeparator: '',
|
||||
height: 40,
|
||||
boxLabel: _('Periodically check the website for new releases'),
|
||||
id: 'new_releases'
|
||||
}]
|
||||
}]
|
||||
});
|
||||
id: 'new_release_check'
|
||||
}));
|
||||
}
|
||||
});
|
||||
Deluge.Preferences.addPage(new Ext.deluge.preferences.Daemon());
|
Loading…
Add table
Reference in a new issue