fix the remove torrent dialog

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

View File

@ -52,7 +52,7 @@
labelSeparator: '',
items: [
{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) {
Ext.deluge.RemoveWindow.superclass.show.call(this);
this.torrentIds = ids;
@ -69,28 +82,19 @@ Ext.deluge.RemoveWindow = Ext.extend(Ext.Window, {
onCancel: function() {
this.hide();
this.torrentIds = null;
this.chkgrp.setValue([false, false]);
},
onRemove: function() {
Deluge.Client.core.remove_torrent(this.torrentIds, false, {
success: this.onRemoved,
scope: this
});
this.remove(false);
},
onRemoveData: function() {
Deluge.Client.core.remove_torrent(this.torrentIds, true, {
success: this.onRemoved,
scope: this
});
this.remove(true);
},
onRemoved: function() {
Deluge.Events.fire('torrentRemoved', this.torrentIds);
this.torrentIds = null;
onRemoved: function(torrentId) {
Deluge.Events.fire('torrentRemoved', torrentId);
this.hide();
this.chkgrp.setValue([false, false]);
Deluge.UI.update();
}
});

File diff suppressed because one or more lines are too long