Skip to content

Commit d0d3d0b

Browse files
tobiasdiezkoppor
authored andcommitted
Rename "lookup fulltext" to "download fulltext" (#5667)
Closes #3874 and surpasses #5216.
1 parent 56d68b3 commit d0d3d0b

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

src/main/java/org/jabref/gui/BasePanel.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import org.jabref.gui.entryeditor.EntryEditor;
4242
import org.jabref.gui.exporter.SaveDatabaseAction;
4343
import org.jabref.gui.exporter.WriteXMPAction;
44-
import org.jabref.gui.externalfiles.FindFullTextAction;
44+
import org.jabref.gui.externalfiles.DownloadFullTextAction;
4545
import org.jabref.gui.externalfiletype.ExternalFileType;
4646
import org.jabref.gui.externalfiletype.ExternalFileTypes;
4747
import org.jabref.gui.importer.actions.AppendDatabaseAction;
@@ -371,7 +371,7 @@ private void setupActions() {
371371
actions.put(Actions.ABBREVIATE_SHORTEST_UNIQUE, new AbbreviateAction(this, AbbreviationType.SHORTEST_UNIQUE));
372372
actions.put(Actions.UNABBREVIATE, new UnabbreviateAction(this));
373373

374-
actions.put(Actions.DOWNLOAD_FULL_TEXT, new FindFullTextAction(this)::execute);
374+
actions.put(Actions.DOWNLOAD_FULL_TEXT, new DownloadFullTextAction(this)::execute);
375375
}
376376

377377
/**

src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java

+11-14
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@
3030
/**
3131
* Try to download fulltext PDF for selected entry(ies) by following URL or DOI link.
3232
*/
33-
public class FindFullTextAction extends SimpleCommand {
33+
public class DownloadFullTextAction extends SimpleCommand {
3434

35-
private static final Logger LOGGER = LoggerFactory.getLogger(FindFullTextAction.class);
35+
private static final Logger LOGGER = LoggerFactory.getLogger(DownloadFullTextAction.class);
3636
// The minimum number of selected entries to ask the user for confirmation
3737
private static final int WARNING_LIMIT = 5;
3838

3939
private final BasePanel basePanel;
4040
private final DialogService dialogService;
4141

42-
public FindFullTextAction(BasePanel basePanel) {
42+
public DownloadFullTextAction(BasePanel basePanel) {
4343
this.basePanel = basePanel;
4444
this.dialogService = basePanel.frame().getDialogService();
4545
}
@@ -54,14 +54,14 @@ public void execute() {
5454

5555
if (basePanel.getSelectedEntries().size() >= WARNING_LIMIT) {
5656
boolean confirmDownload = dialogService.showConfirmationDialogAndWait(
57-
Localization.lang("Look up full text documents"),
57+
Localization.lang("Download full text documents"),
5858
Localization.lang(
59-
"You are about to look up full text documents for %0 entries.",
59+
"You are about to download full text documents for %0 entries.",
6060
String.valueOf(basePanel.getSelectedEntries().size())) + "\n"
6161
+ Localization.lang("JabRef will send at least one request per entry to a publisher.")
6262
+ "\n"
6363
+ Localization.lang("Do you still want to continue?"),
64-
Localization.lang("Look up full text documents"),
64+
Localization.lang("Download full text documents"),
6565
Localization.lang("Cancel"));
6666

6767
if (!confirmDownload) {
@@ -87,7 +87,7 @@ protected Map<BibEntry, Optional<URL>> call() {
8787
findFullTextsTask.setOnSucceeded(value -> downloadFullTexts(findFullTextsTask.getValue()));
8888

8989
dialogService.showProgressDialogAndWait(
90-
Localization.lang("Look up full text documents"),
90+
Localization.lang("Download full text documents"),
9191
Localization.lang("Looking for full text document..."),
9292
findFullTextsTask);
9393

@@ -100,17 +100,15 @@ private void downloadFullTexts(Map<BibEntry, Optional<URL>> downloads) {
100100
Optional<URL> result = download.getValue();
101101
if (result.isPresent()) {
102102
Optional<Path> dir = basePanel.getBibDatabaseContext().getFirstExistingFileDir(Globals.prefs.getFilePreferences());
103-
104-
if (!dir.isPresent()) {
105-
103+
if (dir.isEmpty()) {
106104
dialogService.showErrorDialogAndWait(Localization.lang("Directory not found"),
107105
Localization.lang("Main file directory not set!") + " " + Localization.lang("Preferences")
108106
+ " -> " + Localization.lang("File"));
109107
return;
110108
}
111-
//Download and link full text
112-
addLinkedFileFromURL(result.get(), entry, dir.get());
113109

110+
// Download and link full text
111+
addLinkedFileFromURL(result.get(), entry, dir.get());
114112
} else {
115113
dialogService.notify(Localization.lang("No full text document found for entry %0.",
116114
entry.getCiteKeyOptional().orElse(Localization.lang("undefined"))));
@@ -130,15 +128,14 @@ private void addLinkedFileFromURL(URL url, BibEntry entry, Path targetDirectory)
130128
LinkedFile newLinkedFile = new LinkedFile(url, "");
131129

132130
if (!entry.getFiles().contains(newLinkedFile)) {
133-
134131
LinkedFileViewModel onlineFile = new LinkedFileViewModel(
135132
newLinkedFile,
136133
entry,
137134
basePanel.getBibDatabaseContext(),
138135
Globals.TASK_EXECUTOR,
139136
dialogService,
140137
JabRefPreferences.getInstance().getXMPPreferences(),
141-
JabRefPreferences.getInstance().getFilePreferences(),
138+
JabRefPreferences.getInstance().getFilePreferences(),
142139
ExternalFileTypes.getInstance());
143140

144141
try {

src/main/java/org/jabref/gui/keyboard/KeyBinding.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public enum KeyBinding {
2626
DECREASE_TABLE_FONT_SIZE("Decrease table font size", Localization.lang("Decrease table font size"), "ctrl+MINUS", KeyBindingCategory.VIEW),
2727
DELETE_ENTRY("Delete entry", Localization.lang("Delete entry"), "DELETE", KeyBindingCategory.BIBTEX),
2828
DEFAULT_DIALOG_ACTION("Execute default action in dialog", Localization.lang("Execute default action in dialog"), "ctrl+ENTER", KeyBindingCategory.VIEW),
29-
DOWNLOAD_FULL_TEXT("Look up full text documents", Localization.lang("Look up full text documents"), "alt+F7", KeyBindingCategory.QUALITY),
29+
DOWNLOAD_FULL_TEXT("Download full text documents", Localization.lang("Download full text documents"), "alt+F7", KeyBindingCategory.QUALITY),
3030
EDIT_ENTRY("Edit entry", Localization.lang("Edit entry"), "ctrl+E", KeyBindingCategory.BIBTEX),
3131
EXPORT("Export", Localization.lang("Export"), "ctrl+alt+e", KeyBindingCategory.FILE),
3232
EXPORT_SELECTED("Export Selected", Localization.lang("Export selected entries"), "ctrl+shift+e", KeyBindingCategory.FILE),

src/main/resources/l10n/JabRef_en.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1722,8 +1722,8 @@ See\ what\ has\ been\ changed\ in\ the\ JabRef\ versions=See what has been chang
17221722
Referenced\ BibTeX\ key\ does\ not\ exist=Referenced BibTeX key does not exist
17231723
Full\ text\ document\ for\ entry\ %0\ already\ linked.=Full text document for entry %0 already linked.
17241724
Finished\ downloading\ full\ text\ document\ for\ entry\ %0.=Finished downloading full text document for entry %0.
1725-
Look\ up\ full\ text\ documents=Look up full text documents
1726-
You\ are\ about\ to\ look\ up\ full\ text\ documents\ for\ %0\ entries.=You are about to look up full text documents for %0 entries.
1725+
Download\ full\ text\ documents=Download full text documents
1726+
You\ are\ about\ to\ download\ full\ text\ documents\ for\ %0\ entries.=You are about to download full text documents for %0 entries.
17271727
last\ four\ nonpunctuation\ characters\ should\ be\ numerals=last four nonpunctuation characters should be numerals
17281728
17291729
Author=Author

0 commit comments

Comments
 (0)