mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-27 11:45:44 +00:00
fix the remove torrent dialog
This commit is contained in:
parent
037871e1b3
commit
034606b203
@ -52,7 +52,7 @@
|
||||
labelSeparator: '',
|
||||
items: [
|
||||
{boxLabel: _('Compact'), value: 'true'},
|
||||
{boxLabel: _('Full'), value: 'false'}
|
||||
{boxLabel: _('Full'), value: 'false',style: 'margin-right: 10px;'}
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -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
Loading…
x
Reference in New Issue
Block a user