Confirm removal of downloads

This commit is contained in:
Nils Maier 2014-05-16 00:35:38 +02:00
parent 5d1af829fd
commit 8b5b465231

View File

@ -38,14 +38,17 @@ function(
// put it in stopped list if active,
// otherwise permanantly remove it
// d: the download ctx
scope.remove = function(d, cb) {
scope.remove = function(d, cb, noConfirm) {
if (!noConfirm && !confirm("Remove %s and associated meta-data?".replace("%s", d.name))) {
return;
}
var method = 'remove';
if (scope.getType(d) == 'stopped')
method = 'removeDownloadResult';
if (d.followedFrom) {
scope.remove(d.followedFrom, function() {});
scope.remove(d.followedFrom, function() {}, true);
d.followedFrom = null;
}
rpc.once(method, [d.gid], cb);