fix some issues with the add window

This commit is contained in:
Damien Churchill 2010-01-26 18:18:14 +00:00
parent 0634592bd9
commit 518a73079a
3 changed files with 11 additions and 13 deletions

View file

@ -52,7 +52,7 @@ Ext.deluge.add.FileWindow = Ext.extend(Ext.deluge.add.Window, {
initComponent: function() {
Ext.deluge.add.FileWindow.superclass.initComponent.call(this);
this.addButton(_('Add'), this.onAdd, this);
this.addButton(_('Add'), this.onAddClick, this);
this.form = this.add({
xtype: 'form',
@ -73,7 +73,7 @@ Ext.deluge.add.FileWindow = Ext.extend(Ext.deluge.add.Window, {
});
},
onAdd: function(field, e) {
onAddClick: function(field, e) {
if (this.form.getForm().isValid()) {
this.torrentId = this.createTorrentId();
this.form.getForm().submit({

View file

@ -52,7 +52,7 @@ Ext.deluge.add.UrlWindow = Ext.extend(Ext.deluge.add.Window, {
initComponent: function() {
Ext.deluge.add.UrlWindow.superclass.initComponent.call(this);
this.addButton(_('Add'), this.onAdd, this);
this.addButton(_('Add'), this.onAddClick, this);
var form = this.add({
xtype: 'form',
@ -78,7 +78,7 @@ Ext.deluge.add.UrlWindow = Ext.extend(Ext.deluge.add.Window, {
this.cookieField.on('specialkey', this.onAdd, this);
},
onAdd: function(field, e) {
onAddClick: function(field, e) {
if ((field.id == 'url' || field.id == 'cookies') && e.getKey() != e.ENTER) return;
var field = this.urlField;

View file

@ -49,7 +49,7 @@ Ext.deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
initComponent: function() {
Ext.deluge.add.OptionsPanel.superclass.initComponent.call(this);
this.files = this.add(new Ext.tree.ColumnTree({
this.files = this.add(new Ext.ux.tree.TreeGrid({
layout: 'fit',
title: _('Files'),
rootVisible: false,
@ -64,14 +64,12 @@ Ext.deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
width: 275,
dataIndex: 'filename'
},{
xtype: 'tgrendercolumn',
header: _('Size'),
width: 80,
dataIndex: 'size'
}],
root: new Ext.tree.AsyncTreeNode({
text: 'Files'
})
dataIndex: 'size',
renderer: fsize
}]
}));
new Ext.tree.TreeSorter(this.files, {
folderSort: true
@ -146,7 +144,7 @@ Ext.deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
autoHeight: true,
labelWidth: 100,
width: 200,
defaultType: 'uxspinner'
defaultType: 'spinnerfield'
});
this.optionsManager.bind('max_download_speed', fieldset.add({
fieldLabel: _('Max Down Speed'),
@ -560,4 +558,4 @@ Ext.deluge.add.AddWindow = Ext.extend(Ext.deluge.add.Window, {
this.url.show();
}
});
//Deluge.Add = new Ext.deluge.add.AddWindow();
Deluge.Add = new Ext.deluge.add.AddWindow();