fix the remove torrent dialog

This commit is contained in:
Damien Churchill 2009-07-23 22:30:08 +00:00
commit 034606b203
3 changed files with 19 additions and 15 deletions

View file

@ -52,7 +52,7 @@
labelSeparator: '', labelSeparator: '',
items: [ items: [
{boxLabel: _('Compact'), value: 'true'}, {boxLabel: _('Compact'), value: 'true'},
{boxLabel: _('Full'), value: 'false'} {boxLabel: _('Full'), value: 'false',style: 'margin-right: 10px;'}
] ]
}); });

View file

@ -61,6 +61,19 @@ Ext.deluge.RemoveWindow = Ext.extend(Ext.Window, {
}); });
}, },
remove: function(removeData) {
Ext.each(this.torrentIds, function(torrentId) {
Deluge.Client.core.remove_torrent(torrentId, removeData, {
success: function() {
this.onRemoved(torrentId);
},
scope: this,
torrentId: torrentId
});
}, this);
},
show: function(ids) { show: function(ids) {
Ext.deluge.RemoveWindow.superclass.show.call(this); Ext.deluge.RemoveWindow.superclass.show.call(this);
this.torrentIds = ids; this.torrentIds = ids;
@ -69,28 +82,19 @@ Ext.deluge.RemoveWindow = Ext.extend(Ext.Window, {
onCancel: function() { onCancel: function() {
this.hide(); this.hide();
this.torrentIds = null; this.torrentIds = null;
this.chkgrp.setValue([false, false]);
}, },
onRemove: function() { onRemove: function() {
Deluge.Client.core.remove_torrent(this.torrentIds, false, { this.remove(false);
success: this.onRemoved,
scope: this
});
}, },
onRemoveData: function() { onRemoveData: function() {
Deluge.Client.core.remove_torrent(this.torrentIds, true, { this.remove(true);
success: this.onRemoved,
scope: this
});
}, },
onRemoved: function() { onRemoved: function(torrentId) {
Deluge.Events.fire('torrentRemoved', this.torrentIds); Deluge.Events.fire('torrentRemoved', torrentId);
this.torrentIds = null;
this.hide(); this.hide();
this.chkgrp.setValue([false, false]);
Deluge.UI.update(); Deluge.UI.update();
} }
}); });

File diff suppressed because one or more lines are too long