Skip to content

Commit

Permalink
fix l10n
Browse files Browse the repository at this point in the history
fix aborting of copy files task and showing of integrity check dialog
  • Loading branch information
Siedlerchr committed Jan 4, 2019
1 parent 7269d27 commit e4ba277
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
23 changes: 19 additions & 4 deletions src/main/java/org/jabref/gui/copyfiles/CopyFilesTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,18 @@ protected List<CopyFilesResultItemViewModel> call() throws InterruptedException,

for (int i = 0; i < entries.size(); i++) {

if (isCancelled()) {
break;
}

List<LinkedFile> 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);
Expand All @@ -78,14 +87,18 @@ protected List<CopyFilesResultItemViewModel> 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);
Expand All @@ -99,7 +112,9 @@ protected List<CopyFilesResultItemViewModel> call() throws InterruptedException,
writeLogMessage(newFile, bw, localizedErrorMessage);
addResultToList(newFile, success, localizedErrorMessage);
}
});

}

}
}
updateMessage(Localization.lang("Finished copying"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected List<IntegrityMessage> call() {
dialogService.notify(Localization.lang("No problems found."));
} else {
Dialog<Void> dialog = new IntegrityCheckDialog(messages, frame.getCurrentBasePanel());
dialogService.showCustomDialogAndWait(dialog);
dialog.showAndWait();
}
});
task.setOnFailed(event -> dialogService.showErrorDialogAndWait("Integrity check failed."));
Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit e4ba277

Please sign in to comment.