Fix up the sizing of the downloads preference page

This commit is contained in:
Damien Churchill 2009-10-01 10:51:27 +00:00
parent 5be72551f0
commit 0a9cccb5e8
2 changed files with 108 additions and 104 deletions

View File

@ -29,7 +29,6 @@ Copyright:
but you are not obligated to do so. If you do not wish to do so, delete but you are not obligated to do so. If you do not wish to do so, delete
this exception statement from your version. If you delete this exception this exception statement from your version. If you delete this exception
statement from all source files in the program, then also delete it here. statement from all source files in the program, then also delete it here.
*/ */
Ext.namespace('Ext.ux.util'); Ext.namespace('Ext.ux.util');

View File

@ -3,22 +3,22 @@ Script: Deluge.Preferences.Downloads.js
The downloads preferences page. The downloads preferences page.
Copyright: Copyright:
(C) Damien Churchill 2009 <damoxc@gmail.com> (C) Damien Churchill 2009 <damoxc@gmail.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option) the Free Software Foundation; either version 3, or (at your option)
any later version. any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, write to: along with this program. If not, write to:
The Free Software Foundation, Inc., The Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor 51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
In addition, as a special exception, the copyright holders give In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the OpenSSL permission to link the code of portions of this program with the OpenSSL
@ -33,94 +33,99 @@ Copyright:
Ext.namespace('Ext.deluge.preferences'); Ext.namespace('Ext.deluge.preferences');
Ext.deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, { Ext.deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
constructor: function(config) { constructor: function(config) {
config = Ext.apply({ config = Ext.apply({
border: false, border: false,
title: _('Downloads'), title: _('Downloads'),
layout: 'form', layout: 'form',
autoHeight: true autoHeight: true
}, config); }, config);
Ext.deluge.preferences.Downloads.superclass.constructor.call(this, config); Ext.deluge.preferences.Downloads.superclass.constructor.call(this, config);
}, },
initComponent: function() { initComponent: function() {
Ext.deluge.preferences.Downloads.superclass.initComponent.call(this); Ext.deluge.preferences.Downloads.superclass.initComponent.call(this);
var optMan = Deluge.Preferences.getOptionsManager(); var optMan = Deluge.Preferences.getOptionsManager();
var fieldset = this.add({ var fieldset = this.add({
xtype: 'fieldset', xtype: 'fieldset',
border: false, border: false,
title: _('Folders'), title: _('Folders'),
labelWidth: 150, labelWidth: 150,
defaultType: 'textfield', defaultType: 'textfield',
autoHeight: true, autoHeight: true,
labelAlign: 'top' labelAlign: 'top',
}); width: 260,
optMan.bind('download_location', fieldset.add({ style: 'margin-bottom: 5px; padding-bottom: 5px;'
name: 'download_location', });
fieldLabel: _('Download to'), optMan.bind('download_location', fieldset.add({
width: 240 name: 'download_location',
})); fieldLabel: _('Download to'),
optMan.bind('move_completed_path', fieldset.add({ width: 240
name: 'move_completed_path', }));
fieldLabel: _('Move completed to'), optMan.bind('move_completed_path', fieldset.add({
width: 240, name: 'move_completed_path',
disabled: true fieldLabel: _('Move completed to'),
})); width: 240,
optMan.bind('torrentfiles_location', fieldset.add({ disabled: true
name: 'torrentfiles_location', }));
fieldLabel: _('Copy of .torrent files to'), optMan.bind('torrentfiles_location', fieldset.add({
width: 240, name: 'torrentfiles_location',
disabled: true fieldLabel: _('Copy of .torrent files to'),
})); width: 240,
optMan.bind('autoadd_location', fieldset.add({ disabled: true
name: 'autoadd_location', }));
fieldLabel: _('Autoadd .torrent files from'), optMan.bind('autoadd_location', fieldset.add({
width: 240, name: 'autoadd_location',
disabled: true fieldLabel: _('Autoadd .torrent files from'),
})); width: 240,
disabled: true
fieldset = this.add({ }));
xtype: 'fieldset',
border: false, fieldset = this.add({
title: _('Allocation'), xtype: 'fieldset',
autoHeight: true, border: false,
labelWidth: 1, title: _('Allocation'),
defaultType: 'radiogroup' autoHeight: true,
}); labelWidth: 1,
optMan.bind('compact_allocation', fieldset.add({ defaultType: 'radiogroup',
name: 'compact_allocation', style: 'margin-bottom: 5px; padding-bottom: 5px;',
labelSeparator: '', width: 260
items: [ });
{boxLabel: _('Compact') + '&nbsp;', inputValue: true}, optMan.bind('compact_allocation', fieldset.add({
{boxLabel: _('Full'), inputValue: false} name: 'compact_allocation',
] labelSeparator: '',
})); items: [
{boxLabel: _('Compact') + '&nbsp;', inputValue: true},
fieldset = this.add({ {boxLabel: _('Full'), inputValue: false}
xtype: 'fieldset', ]
border: false, }));
title: _('Options'),
autoHeight: true, fieldset = this.add({
labelWidth: 1, xtype: 'fieldset',
defaultType: 'checkbox' border: false,
}); title: _('Options'),
optMan.bind('prioritize_first_last_pieces', fieldset.add({ autoHeight: true,
name: 'prioritize_first_last_pieces', labelWidth: 1,
labelSeparator: '', defaultType: 'checkbox',
boxLabel: _('Prioritize first and last pieces of torrent') width: 260
})); });
optMan.bind('add_paused', fieldset.add({ optMan.bind('prioritize_first_last_pieces', fieldset.add({
name: 'add_paused', name: 'prioritize_first_last_pieces',
labelSeparator: '', labelSeparator: '',
boxLabel: _('Add torrents in Paused state') boxLabel: _('Prioritize first and last pieces of torrent')
})); }));
optMan.bind('add_paused', fieldset.add({
this.on('show', this.onShow, this); name: 'add_paused',
}, labelSeparator: '',
boxLabel: _('Add torrents in Paused state')
onShow: function() { }));
Ext.deluge.preferences.Downloads.superclass.onShow.call(this);
} this.on('show', this.onShow, this);
},
onShow: function() {
Ext.deluge.preferences.Downloads.superclass.onShow.call(this);
}
}); });
Deluge.Preferences.addPage(new Ext.deluge.preferences.Downloads()); Deluge.Preferences.addPage(new Ext.deluge.preferences.Downloads());