use of com.biglybt.pif.download.DownloadRemovalVetoException in project BiglyBT by BiglySoftware.
the class ManagerUtils method moveToArchive.
public static void moveToArchive(final List<Download> downloads, ArchiveCallback _run_when_complete) {
final ArchiveCallback run_when_complete = _run_when_complete == null ? new ArchiveCallback() : _run_when_complete;
Utils.getOffOfSWTThread(new AERunnable() {
@Override
public void runSupport() {
try {
String title = MessageText.getString("archive.info.title");
String text = MessageText.getString("archive.info.text");
MessageBoxShell prompter = new MessageBoxShell(title, text, new String[] { MessageText.getString("Button.ok") }, 0);
String remember_id = "managerutils.archive.info";
prompter.setRemember(remember_id, true, MessageText.getString("MessageBoxWindow.nomoreprompting"));
prompter.setAutoCloseInMS(0);
prompter.open(null);
prompter.waitUntilClosed();
for (Download dm : downloads) {
try {
DownloadStub stub = dm.stubbify();
run_when_complete.success(dm, stub);
} catch (DownloadRemovalVetoException e) {
run_when_complete.failed(dm, e);
if (!e.isSilent()) {
UIFunctionsManager.getUIFunctions().forceNotify(UIFunctions.STATUSICON_ERROR, MessageText.getString("globalmanager.download.remove.veto"), e.getMessage(), dm.getName(), new Object[] { dm }, -1);
}
} catch (Throwable e) {
run_when_complete.failed(dm, e);
Debug.out(e);
}
}
} finally {
run_when_complete.completed();
}
}
});
}
Aggregations