From cde9b4e98fdb5651644adea09b8cbc417e76114b Mon Sep 17 00:00:00 2001 From: Nick Mancuso Date: Fri, 14 Dec 2018 15:11:55 -0500 Subject: [PATCH 1/7] Removed DownloadExternalFile call, replaced with LinkedFileViewModel fuctionality --- .../gui/externalfiles/FindFullTextAction.java | 73 ++++++++++--------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java index bb72fa8ff3f..cb265eb44e8 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java @@ -1,6 +1,5 @@ package org.jabref.gui.externalfiles; -import java.io.IOException; import java.net.URL; import java.nio.file.Path; import java.util.ArrayList; @@ -11,19 +10,23 @@ import javax.swing.SwingUtilities; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.ListProperty; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleListProperty; +import javafx.collections.FXCollections; import org.jabref.Globals; import org.jabref.gui.BasePanel; import org.jabref.gui.DialogService; import org.jabref.gui.actions.BaseAction; -import org.jabref.gui.undo.UndoableFieldChange; +import org.jabref.gui.fieldeditors.LinkedFileViewModel; import org.jabref.gui.util.BackgroundTask; -import org.jabref.gui.util.DefaultTaskExecutor; import org.jabref.logic.importer.FulltextFetchers; import org.jabref.logic.l10n.Localization; -import org.jabref.model.FieldChange; import org.jabref.model.entry.BibEntry; -import org.jabref.model.entry.FieldName; +import org.jabref.model.entry.LinkedFile; +import org.jabref.preferences.JabRefPreferences; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,8 +50,9 @@ public FindFullTextAction(DialogService dialogService, BasePanel basePanel) { @Override public void action() { BackgroundTask.wrap(this::findFullTexts) - .onSuccess(downloads -> SwingUtilities.invokeLater(() -> downloadFullTexts(downloads))) - .executeWith(Globals.TASK_EXECUTOR); + .onSuccess(downloads -> SwingUtilities.invokeLater(() -> downloadFullTexts(downloads))) + .executeWith(Globals.TASK_EXECUTOR); + } private Map, BibEntry> findFullTexts() { @@ -76,6 +80,7 @@ private Map, BibEntry> findFullTexts() { } } + /****TODO:PROBLEM HERE, ENTRIES ARE BEING IGNORED**/ Map, BibEntry> downloads = new ConcurrentHashMap<>(); for (BibEntry entry : basePanel.getSelectedEntries()) { FulltextFetchers fetchers = new FulltextFetchers(Globals.prefs.getImportFormatPreferences()); @@ -101,35 +106,37 @@ private void downloadFullTexts(Map, BibEntry> downloads) { return; } - DownloadExternalFile fileDownload = new DownloadExternalFile(dialogService, - basePanel.getBibDatabaseContext(), entry); - try { - fileDownload.download(result.get(), "application/pdf", file -> { - DefaultTaskExecutor.runInJavaFXThread(() -> { - Optional fieldChange = entry.addFile(file); - if (fieldChange.isPresent()) { - UndoableFieldChange edit = new UndoableFieldChange(entry, FieldName.FILE, - entry.getField(FieldName.FILE).orElse(null), fieldChange.get().getNewValue()); - basePanel.getUndoManager().addEdit(edit); - basePanel.markBaseChanged(); - } - }); - - }); - } catch (IOException e) { - LOGGER.warn("Problem downloading file", e); - basePanel.output(Localization.lang("Full text document download failed for entry %0", - entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); - } + + /********************TODO:WORKING HERE*******************/ + FulltextFetchers fetcher = new FulltextFetchers(JabRefPreferences.getInstance().getImportFormatPreferences()); + final BooleanProperty fulltextLookupInProgress = new SimpleBooleanProperty(false); + final ListProperty files = new SimpleListProperty<>(FXCollections.observableArrayList(LinkedFileViewModel::getObservables)); + + + + BackgroundTask + .wrap(() -> fetcher.findFullTextPDF(entry)) + .onRunning(() -> fulltextLookupInProgress.setValue(true)) + .onFinished(() -> fulltextLookupInProgress.setValue(false)) + .onSuccess(url -> { + LinkedFileViewModel onlineFile = new LinkedFileViewModel( + new LinkedFile(result.get(), ""), + entry, basePanel.getBibDatabaseContext(), + Globals.TASK_EXECUTOR, dialogService, + JabRefPreferences.getInstance()); + files.add(onlineFile); + onlineFile.download(); + }) + .executeWith(Globals.TASK_EXECUTOR); + + basePanel.output(Localization.lang("Finished downloading full text document for entry %0.", entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); - } else { - String title = Localization.lang("No full text document found"); - String message = Localization.lang("No full text document found for entry %0.", - entry.getCiteKeyOptional().orElse(Localization.lang("undefined"))); - basePanel.output(message); - DefaultTaskExecutor.runInJavaFXThread(() -> dialogService.showErrorDialogAndWait(title, message)); + } else { + + dialogService.notify(Localization.lang("No full text document found")); + } finishedTasks.add(result); } From 0bd59b33d982e1c0a55e9a2cc184d52d965886ae Mon Sep 17 00:00:00 2001 From: Nick Mancuso Date: Fri, 14 Dec 2018 15:16:11 -0500 Subject: [PATCH 2/7] Added some notes --- .../org/jabref/gui/externalfiles/FindFullTextAction.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java index cb265eb44e8..97821477d9e 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java @@ -80,7 +80,7 @@ private Map, BibEntry> findFullTexts() { } } - /****TODO:PROBLEM HERE, ENTRIES ARE BEING IGNORED**/ + /****TODO:PROBLEM HERE, ENTRIES ARE BEING IGNORED, ALSO LOOK IN MAINTABLE @ GETSELECTEDENTRIES()**/ Map, BibEntry> downloads = new ConcurrentHashMap<>(); for (BibEntry entry : basePanel.getSelectedEntries()) { FulltextFetchers fetchers = new FulltextFetchers(Globals.prefs.getImportFormatPreferences()); @@ -112,8 +112,6 @@ private void downloadFullTexts(Map, BibEntry> downloads) { final BooleanProperty fulltextLookupInProgress = new SimpleBooleanProperty(false); final ListProperty files = new SimpleListProperty<>(FXCollections.observableArrayList(LinkedFileViewModel::getObservables)); - - BackgroundTask .wrap(() -> fetcher.findFullTextPDF(entry)) .onRunning(() -> fulltextLookupInProgress.setValue(true)) @@ -129,7 +127,6 @@ private void downloadFullTexts(Map, BibEntry> downloads) { }) .executeWith(Globals.TASK_EXECUTOR); - basePanel.output(Localization.lang("Finished downloading full text document for entry %0.", entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); @@ -138,6 +135,8 @@ private void downloadFullTexts(Map, BibEntry> downloads) { dialogService.notify(Localization.lang("No full text document found")); } + + /***************************** TODO:*********************************/ finishedTasks.add(result); } for (Optional result : finishedTasks) { From 3f67c97bdef963a04c7af07e758db14ff96d0699 Mon Sep 17 00:00:00 2001 From: Nick Mancuso Date: Sat, 15 Dec 2018 10:51:20 -0500 Subject: [PATCH 3/7] Added addLinkedFileFromURL method to handle linking and display dialogs --- .../gui/externalfiles/FindFullTextAction.java | 64 +++++++++++++------ 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java index 97821477d9e..cd29fd6ba8b 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java @@ -42,6 +42,11 @@ public class FindFullTextAction implements BaseAction { private final BasePanel basePanel; private final DialogService dialogService; + //Stuff for downloading full texts + FulltextFetchers fetcher = new FulltextFetchers(JabRefPreferences.getInstance().getImportFormatPreferences()); + private final BooleanProperty fulltextLookupInProgress = new SimpleBooleanProperty(false); + private final ListProperty files = new SimpleListProperty<>(FXCollections.observableArrayList(LinkedFileViewModel::getObservables)); + public FindFullTextAction(DialogService dialogService, BasePanel basePanel) { this.basePanel = basePanel; this.dialogService = dialogService; @@ -80,7 +85,6 @@ private Map, BibEntry> findFullTexts() { } } - /****TODO:PROBLEM HERE, ENTRIES ARE BEING IGNORED, ALSO LOOK IN MAINTABLE @ GETSELECTEDENTRIES()**/ Map, BibEntry> downloads = new ConcurrentHashMap<>(); for (BibEntry entry : basePanel.getSelectedEntries()) { FulltextFetchers fetchers = new FulltextFetchers(Globals.prefs.getImportFormatPreferences()); @@ -107,40 +111,62 @@ private void downloadFullTexts(Map, BibEntry> downloads) { return; } - /********************TODO:WORKING HERE*******************/ - FulltextFetchers fetcher = new FulltextFetchers(JabRefPreferences.getInstance().getImportFormatPreferences()); - final BooleanProperty fulltextLookupInProgress = new SimpleBooleanProperty(false); - final ListProperty files = new SimpleListProperty<>(FXCollections.observableArrayList(LinkedFileViewModel::getObservables)); - + //Download full text BackgroundTask .wrap(() -> fetcher.findFullTextPDF(entry)) .onRunning(() -> fulltextLookupInProgress.setValue(true)) .onFinished(() -> fulltextLookupInProgress.setValue(false)) - .onSuccess(url -> { - LinkedFileViewModel onlineFile = new LinkedFileViewModel( - new LinkedFile(result.get(), ""), - entry, basePanel.getBibDatabaseContext(), - Globals.TASK_EXECUTOR, dialogService, - JabRefPreferences.getInstance()); - files.add(onlineFile); - onlineFile.download(); - }) + .onSuccess(url -> addLinkedFileFromURL(result.get(), entry)) .executeWith(Globals.TASK_EXECUTOR); - basePanel.output(Localization.lang("Finished downloading full text document for entry %0.", - entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); - } else { dialogService.notify(Localization.lang("No full text document found")); } - /***************************** TODO:*********************************/ finishedTasks.add(result); } for (Optional result : finishedTasks) { downloads.remove(result); } } + + /** + * This method attaches a linked file from a URL (if not already linked) to an entry and using the key and value pair + * from the findFullTexts map + * @param url the url "key" + * @param entry the entry "value" + */ + private void addLinkedFileFromURL(URL url, BibEntry entry) { + + LinkedFile newLinkedFile = new LinkedFile(url, ""); + String basePanelOutput ; + + if (!entry.getFiles().contains(newLinkedFile)) { + + LinkedFileViewModel onlineFile = new LinkedFileViewModel( + newLinkedFile, + entry, + basePanel.getBibDatabaseContext(), + Globals.TASK_EXECUTOR, + dialogService, + JabRefPreferences.getInstance()); + + files.add(onlineFile); + onlineFile.download(); + + entry.addFile(newLinkedFile); + + basePanelOutput = "Finished downloading full text document for entry %0."; + + } else { + + basePanelOutput = "Full text document for entry %0 already linked."; + + } + + basePanel.output(Localization.lang(basePanelOutput, + entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); + } } From 69cc4785923975ed3a60de0e9bb163cb98952c44 Mon Sep 17 00:00:00 2001 From: Nick Mancuso Date: Sat, 15 Dec 2018 11:07:02 -0500 Subject: [PATCH 4/7] Fixed issues per codacity review --- .../jabref/gui/externalfiles/FindFullTextAction.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java index cd29fd6ba8b..5284624554f 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java @@ -15,7 +15,9 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleListProperty; import javafx.collections.FXCollections; + import org.jabref.Globals; + import org.jabref.gui.BasePanel; import org.jabref.gui.DialogService; import org.jabref.gui.actions.BaseAction; @@ -26,8 +28,11 @@ import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; + import org.jabref.preferences.JabRefPreferences; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; /** @@ -43,7 +48,7 @@ public class FindFullTextAction implements BaseAction { private final DialogService dialogService; //Stuff for downloading full texts - FulltextFetchers fetcher = new FulltextFetchers(JabRefPreferences.getInstance().getImportFormatPreferences()); + private final FulltextFetchers fetcher = new FulltextFetchers(JabRefPreferences.getInstance().getImportFormatPreferences()); private final BooleanProperty fulltextLookupInProgress = new SimpleBooleanProperty(false); private final ListProperty files = new SimpleListProperty<>(FXCollections.observableArrayList(LinkedFileViewModel::getObservables)); @@ -120,11 +125,8 @@ private void downloadFullTexts(Map, BibEntry> downloads) { .executeWith(Globals.TASK_EXECUTOR); } else { - dialogService.notify(Localization.lang("No full text document found")); - } - finishedTasks.add(result); } for (Optional result : finishedTasks) { From fd9448f24423836e0ee276bf2a6ad0b955cf992e Mon Sep 17 00:00:00 2001 From: Nick Mancuso Date: Sat, 15 Dec 2018 12:38:21 -0500 Subject: [PATCH 5/7] Fixed issues per gradlew check, added new Localization.lang entry, removed unused Localization.lang entry --- .../gui/externalfiles/FindFullTextAction.java | 24 +++++-------------- src/main/resources/l10n/JabRef_en.properties | 2 +- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java index 5284624554f..ee85c4222d9 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java @@ -17,7 +17,6 @@ import javafx.collections.FXCollections; import org.jabref.Globals; - import org.jabref.gui.BasePanel; import org.jabref.gui.DialogService; import org.jabref.gui.actions.BaseAction; @@ -26,13 +25,10 @@ import org.jabref.logic.importer.FulltextFetchers; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.BibEntry; - import org.jabref.model.entry.LinkedFile; - import org.jabref.preferences.JabRefPreferences; import org.slf4j.Logger; - import org.slf4j.LoggerFactory; /** @@ -49,7 +45,6 @@ public class FindFullTextAction implements BaseAction { //Stuff for downloading full texts private final FulltextFetchers fetcher = new FulltextFetchers(JabRefPreferences.getInstance().getImportFormatPreferences()); - private final BooleanProperty fulltextLookupInProgress = new SimpleBooleanProperty(false); private final ListProperty files = new SimpleListProperty<>(FXCollections.observableArrayList(LinkedFileViewModel::getObservables)); public FindFullTextAction(DialogService dialogService, BasePanel basePanel) { @@ -119,13 +114,12 @@ private void downloadFullTexts(Map, BibEntry> downloads) { //Download full text BackgroundTask .wrap(() -> fetcher.findFullTextPDF(entry)) - .onRunning(() -> fulltextLookupInProgress.setValue(true)) - .onFinished(() -> fulltextLookupInProgress.setValue(false)) .onSuccess(url -> addLinkedFileFromURL(result.get(), entry)) .executeWith(Globals.TASK_EXECUTOR); } else { - dialogService.notify(Localization.lang("No full text document found")); + dialogService.notify(Localization.lang("No full text document found for entry %0.", + entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); } finishedTasks.add(result); } @@ -143,7 +137,6 @@ private void downloadFullTexts(Map, BibEntry> downloads) { private void addLinkedFileFromURL(URL url, BibEntry entry) { LinkedFile newLinkedFile = new LinkedFile(url, ""); - String basePanelOutput ; if (!entry.getFiles().contains(newLinkedFile)) { @@ -159,16 +152,11 @@ private void addLinkedFileFromURL(URL url, BibEntry entry) { onlineFile.download(); entry.addFile(newLinkedFile); - - basePanelOutput = "Finished downloading full text document for entry %0."; - + dialogService.notify(Localization.lang("Finished downloading full text document for entry %0.", + entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); } else { - - basePanelOutput = "Full text document for entry %0 already linked."; - + dialogService.notify(Localization.lang("Full text document for entry %0 already linked.", + entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); } - - basePanel.output(Localization.lang(basePanelOutput, - entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); } } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 8a86a4706cc..1af3cc0c045 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1991,6 +1991,7 @@ However,\ a\ new\ database\ was\ created\ alongside\ the\ pre-3.6\ one.=However, Opens\ a\ link\ where\ the\ current\ development\ version\ can\ be\ downloaded=Opens a link where the current development version can be downloaded See\ what\ has\ been\ changed\ in\ the\ JabRef\ versions=See what has been changed in the JabRef versions Referenced\ BibTeX\ key\ does\ not\ exist=Referenced BibTeX key does not exist +Full\ text\ document\ for\ entry\ %0\ already\ linked.=Full text document for entry %0 already linked. Finished\ downloading\ full\ text\ document\ for\ entry\ %0.=Finished downloading full text document for entry %0. Look\ up\ full\ text\ documents=Look up full text documents You\ are\ about\ to\ look\ up\ full\ text\ documents\ for\ %0\ entries.=You are about to look up full text documents for %0 entries. @@ -2132,7 +2133,6 @@ Any\ file=Any file No\ linked\ files\ found\ for\ export.=No linked files found for export. -Full\ text\ document\ download\ failed\ for\ entry\ %0=Full text document download failed for entry %0 No\ full\ text\ document\ found\ for\ entry\ %0.=No full text document found for entry %0. Delete\ Entry=Delete Entry From 2e3c90224589e81c6bc03385016af19cf4ba75f0 Mon Sep 17 00:00:00 2001 From: Nick Mancuso Date: Sun, 16 Dec 2018 13:35:20 -0500 Subject: [PATCH 6/7] Added extends SimpleCommand to FindFullTextAction --- src/main/java/org/jabref/gui/BasePanel.java | 2 +- .../gui/externalfiles/FindFullTextAction.java | 36 ++++++------------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/src/main/java/org/jabref/gui/BasePanel.java b/src/main/java/org/jabref/gui/BasePanel.java index 6291f893d02..9155e2fc3e9 100644 --- a/src/main/java/org/jabref/gui/BasePanel.java +++ b/src/main/java/org/jabref/gui/BasePanel.java @@ -429,7 +429,7 @@ private void setupActions() { actions.put(Actions.REMOVE_FROM_GROUP, new GroupAddRemoveDialog(this, false, false)); actions.put(Actions.MOVE_TO_GROUP, new GroupAddRemoveDialog(this, true, true)); - actions.put(Actions.DOWNLOAD_FULL_TEXT, new FindFullTextAction(frame.getDialogService(), this)); + actions.put(Actions.DOWNLOAD_FULL_TEXT, new FindFullTextAction(this)::execute); } /** diff --git a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java index ee85c4222d9..f706e4b692e 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java @@ -8,18 +8,10 @@ import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; -import javax.swing.SwingUtilities; - -import javafx.beans.property.BooleanProperty; -import javafx.beans.property.ListProperty; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.property.SimpleListProperty; -import javafx.collections.FXCollections; - import org.jabref.Globals; import org.jabref.gui.BasePanel; import org.jabref.gui.DialogService; -import org.jabref.gui.actions.BaseAction; +import org.jabref.gui.actions.SimpleCommand; import org.jabref.gui.fieldeditors.LinkedFileViewModel; import org.jabref.gui.util.BackgroundTask; import org.jabref.logic.importer.FulltextFetchers; @@ -34,7 +26,7 @@ /** * Try to download fulltext PDF for selected entry(ies) by following URL or DOI link. */ -public class FindFullTextAction implements BaseAction { +public class FindFullTextAction extends SimpleCommand { private static final Logger LOGGER = LoggerFactory.getLogger(FindFullTextAction.class); // The minimum number of selected entries to ask the user for confirmation @@ -43,21 +35,16 @@ public class FindFullTextAction implements BaseAction { private final BasePanel basePanel; private final DialogService dialogService; - //Stuff for downloading full texts - private final FulltextFetchers fetcher = new FulltextFetchers(JabRefPreferences.getInstance().getImportFormatPreferences()); - private final ListProperty files = new SimpleListProperty<>(FXCollections.observableArrayList(LinkedFileViewModel::getObservables)); - - public FindFullTextAction(DialogService dialogService, BasePanel basePanel) { + public FindFullTextAction(BasePanel basePanel) { this.basePanel = basePanel; - this.dialogService = dialogService; + this.dialogService = basePanel.frame().getDialogService(); } @Override - public void action() { + public void execute() { BackgroundTask.wrap(this::findFullTexts) - .onSuccess(downloads -> SwingUtilities.invokeLater(() -> downloadFullTexts(downloads))) + .onSuccess(this::downloadFullTexts) .executeWith(Globals.TASK_EXECUTOR); - } private Map, BibEntry> findFullTexts() { @@ -112,10 +99,7 @@ private void downloadFullTexts(Map, BibEntry> downloads) { } //Download full text - BackgroundTask - .wrap(() -> fetcher.findFullTextPDF(entry)) - .onSuccess(url -> addLinkedFileFromURL(result.get(), entry)) - .executeWith(Globals.TASK_EXECUTOR); + addLinkedFileFromURL(result.get(), entry); } else { dialogService.notify(Localization.lang("No full text document found for entry %0.", @@ -129,7 +113,7 @@ private void downloadFullTexts(Map, BibEntry> downloads) { } /** - * This method attaches a linked file from a URL (if not already linked) to an entry and using the key and value pair + * This method attaches a linked file from a URL (if not already linked) to an entry using the key and value pair * from the findFullTexts map * @param url the url "key" * @param entry the entry "value" @@ -148,10 +132,10 @@ private void addLinkedFileFromURL(URL url, BibEntry entry) { dialogService, JabRefPreferences.getInstance()); - files.add(onlineFile); onlineFile.download(); - entry.addFile(newLinkedFile); + entry.addFile(onlineFile.getFile()); + dialogService.notify(Localization.lang("Finished downloading full text document for entry %0.", entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); } else { From af710b9ffa6263fc15b4e27bd72936fdea75b2f1 Mon Sep 17 00:00:00 2001 From: nmancus1 Date: Sun, 16 Dec 2018 22:44:20 -0500 Subject: [PATCH 7/7] Added entry to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09ee0dd7875..3b90e8b80f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,6 +88,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where the ArXiv Fetcher did not support HTTP URLs [koppor#328](https://github.com/koppor/jabref/issues/328) - We fixed an issue where only one PDF file could be imported [#4422](https://github.com/JabRef/jabref/issues/4422) - We fixed an issue where "Move to group" would always move the first entry in the library and not the selected [#4414](https://github.com/JabRef/jabref/issues/4414) +- We fixed an issue where an older dialog appears when downloading full texts from the quality menu. [#4489](https://github.com/JabRef/jabref/issues/4489)