diff --git a/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java b/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java index aec95051171..ee562c53401 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java @@ -67,9 +67,18 @@ protected List call() throws InterruptedException, for (int i = 0; i < entries.size(); i++) { + if (isCancelled()) { + break; + } + List files = entries.get(i).getFiles(); for (int j = 0; j < files.size(); j++) { + + if (isCancelled()) { + break; + } + updateMessage(Localization.lang("Copying file %0 of entry %1", Integer.toString(j + 1), Integer.toString(i + 1))); LinkedFile fileName = files.get(j); @@ -78,14 +87,18 @@ protected List call() throws InterruptedException, newPath = OptionalUtil.combine(Optional.of(exportPath), fileToExport, resolvePathFilename); - newPath.ifPresent(newFile -> { + if (newPath.isPresent()) { + + Path newFile = newPath.get(); boolean success = FileUtil.copyFile(fileToExport.get(), newFile, false); updateProgress(totalFilesCounter++, totalFilesCount); try { Thread.sleep(300); } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + if (isCancelled()) { + updateMessage("Cancelled"); + break; + } } if (success) { updateMessage(localizedSucessMessage); @@ -99,7 +112,9 @@ protected List call() throws InterruptedException, writeLogMessage(newFile, bw, localizedErrorMessage); addResultToList(newFile, success, localizedErrorMessage); } - }); + + } + } } updateMessage(Localization.lang("Finished copying")); diff --git a/src/main/java/org/jabref/gui/integrity/IntegrityCheckAction.java b/src/main/java/org/jabref/gui/integrity/IntegrityCheckAction.java index 3bc53cb180e..0bf4c182db8 100644 --- a/src/main/java/org/jabref/gui/integrity/IntegrityCheckAction.java +++ b/src/main/java/org/jabref/gui/integrity/IntegrityCheckAction.java @@ -65,7 +65,7 @@ protected List call() { dialogService.notify(Localization.lang("No problems found.")); } else { Dialog dialog = new IntegrityCheckDialog(messages, frame.getCurrentBasePanel()); - dialogService.showCustomDialogAndWait(dialog); + dialog.showAndWait(); } }); task.setOnFailed(event -> dialogService.showErrorDialogAndWait("Integrity check failed.")); diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 1af3cc0c045..4ef9bf2dc56 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -433,10 +433,6 @@ Files\ opened=Files opened Filter=Filter -Filter\ All=Filter All - -Filter\ None=Filter None - Finished\ automatically\ setting\ external\ links.=Finished automatically setting external links. Finished\ writing\ XMP\ for\ %0\ file\ (%1\ skipped,\ %2\ errors).=Finished writing XMP for %0 file (%1 skipped, %2 errors).