fix some issues with the add window

This commit is contained in:
Damien Churchill 2010-01-26 18:18:14 +00:00
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() { initComponent: function() {
Ext.deluge.add.FileWindow.superclass.initComponent.call(this); Ext.deluge.add.FileWindow.superclass.initComponent.call(this);
this.addButton(_('Add'), this.onAdd, this); this.addButton(_('Add'), this.onAddClick, this);
this.form = this.add({ this.form = this.add({
xtype: 'form', 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()) { if (this.form.getForm().isValid()) {
this.torrentId = this.createTorrentId(); this.torrentId = this.createTorrentId();
this.form.getForm().submit({ this.form.getForm().submit({

View file

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

View file

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