finish the queue preferences page

This commit is contained in:
Damien Churchill 2009-07-30 23:11:28 +00:00
parent ccaf4e65f7
commit 63af59ab46
1 changed files with 185 additions and 7 deletions

View File

@ -1,8 +1,186 @@
/* Ext.namespace('Ext.deluge.preferences');
Deluge.Preferences.addPage(_('Queue'), { Ext.deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
constructor: function(config) {
config = Ext.apply({
border: false, border: false,
xtype: 'form', title: _('Queue'),
layout: 'form', layout: 'form'
items: [] }, config);
Ext.deluge.preferences.Queue.superclass.constructor.call(this, config);
},
initComponent: function() {
Ext.deluge.preferences.Queue.superclass.initComponent.call(this);
var optMan = Deluge.Preferences.getOptionsManager();
var fieldset = this.add({
xtype: 'fieldset',
border: false,
title: _('General'),
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox'
});
optMan.bind('queue_new_to_top', fieldset.add({
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Queue new torrents to top'),
name: 'queue_new_to_top'
}));
fieldset = this.add({
xtype: 'fieldset',
border: false,
title: _('Active Torrents'),
autoHeight: true,
labelWidth: 150,
defaultType: 'uxspinner',
style: 'margin-bottom: 0px; padding-bottom: 0px;',
});
optMan.bind('max_active_limit', fieldset.add({
fieldLabel: _('Total Active'),
name: 'max_active_limit',
value: 8,
width: 80,
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
},
}));
optMan.bind('max_active_downloading', fieldset.add({
fieldLabel: _('Total Active Downloading'),
name: 'max_active_downloading',
value: 3,
width: 80,
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
},
}));
optMan.bind('max_active_seeding', fieldset.add({
fieldLabel: _('Total Active Seeding'),
name: 'max_active_seeding',
value: 5,
width: 80,
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
},
}));
optMan.bind('dont_count_slow_torrents', fieldset.add({
xtype: 'checkbox',
name: 'dont_count_slow_torrents',
height: 40,
hideLabel: true,
boxLabel: _('Do not count slow torrents')
}));
fieldset = this.add({
xtype: 'fieldset',
border: false,
title: _('Seeding'),
autoHeight: true,
labelWidth: 150,
defaultType: 'uxspinner',
style: 'margin-bottom: 0px; padding-bottom: 0px;',
});
optMan.bind('share_ratio_limit', fieldset.add({
fieldLabel: _('Share Ratio Limit'),
name: 'share_ratio_limit',
value: 8,
width: 80,
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
},
}));
optMan.bind('seed_time_ratio_limit', fieldset.add({
fieldLabel: _('Share Time Ratio'),
name: 'seed_time_ratio_limit',
value: 3,
width: 80,
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
},
}));
optMan.bind('seed_time_limit', fieldset.add({
fieldLabel: _('Seed Time (m)'),
name: 'seed_time_limit',
value: 5,
width: 80,
strategy: {
xtype: 'number',
decimalPrecision: 0,
minValue: -1,
maxValue: 99999
},
}));
fieldset = this.add({
xtype: 'fieldset',
border: false,
autoHeight: true,
layout: 'table',
layoutConfig: {columns: 2},
labelWidth: 0,
defaultType: 'checkbox',
defaults: {
fieldLabel: '',
labelSeparator: ''
}
});
this.stopAtRatio = fieldset.add({
name: 'stop_seed_at_ratio',
boxLabel: _('Stop seeding when share ratio reaches:')
});
this.stopAtRatio.on('check', this.onStopRatioCheck, this);
optMan.bind('stop_seed_at_ratio', this.stopAtRatio);
this.stopRatio = fieldset.add({
xtype: 'uxspinner',
name: 'stop_seed_ratio',
ctCls: 'x-deluge-indent-checkbox',
disabled: true,
value: 2.0,
width: 60,
strategy: {
xtype: 'number',
minValue: -1,
maxValue: 99999,
incrementValue: 0.1,
alternateIncrementValue: 1,
decimalPrecision: 1
}
});
optMan.bind('stop_seed_ratio', this.stopRatio);
this.removeAtRatio = fieldset.add({
name: 'remove_seed_at_ratio',
ctCls: 'x-deluge-indent-checkbox',
boxLabel: _('Remove torrent when share ratio is reached'),
disabled: true,
colspan: 2
});
optMan.bind('remove_seed_at_ratio', this.removeAtRatio);
},
onStopRatioCheck: function(e, checked) {
this.stopRatio.setDisabled(!checked);
this.removeAtRatio.setDisabled(!checked);
}
}); });
*/ Deluge.Preferences.addPage(new Ext.deluge.preferences.Queue());