Skip to content

Commit

Permalink
Present options to return to the 'Select entry type' menu or create a…
Browse files Browse the repository at this point in the history
…n article for manual entry when the fetcher DOI failed to find an entry for an ID [JabRef#7870]
  • Loading branch information
mrcstan committed Oct 31, 2021
1 parent 643587a commit 398f74a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We improved the Drag and Drop behavior in the "Customize Entry Types" Dialog [#6338](https://github.com/JabRef/jabref/issues/6338)
- When determing the URL of an ArXiV eprint, the URL now points to the version [#8149](https://github.com/JabRef/jabref/pull/8149)
- We Included all standard fields with citation key when exporting to Old OpenOffice/LibreOffice Calc Format [#8176](https://github.com/JabRef/jabref/pull/8176)

- We present options to return to the 'Select entry type' menu or create an article for manual entry when the fetcher DOI failed to find an entry for an ID [#7870](https://github.com/JabRef/jabref/issues/7870)
### Fixed

- We fixed an issue where an exception ocurred when a linked online file was edited in the entry editor [#8008](https://github.com/JabRef/jabref/issues/8008)
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/org/jabref/gui/EntryTypeViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javafx.concurrent.Worker;

import org.jabref.gui.duplicationFinder.DuplicateResolverDialog;
import org.jabref.gui.importer.NewEntryAction;
import org.jabref.logic.citationkeypattern.CitationKeyGenerator;
import org.jabref.logic.database.DuplicateCheck;
import org.jabref.logic.importer.FetcherException;
Expand All @@ -25,6 +26,7 @@
import org.jabref.logic.l10n.Localization;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.strings.StringUtil;
import org.jabref.model.entry.types.StandardEntryType;
import org.jabref.preferences.PreferencesService;

import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator;
Expand Down Expand Up @@ -180,7 +182,13 @@ public void runFetcherWorker() {
} else if (result.isEmpty()) {
String fetcher = selectedItemProperty().getValue().getName();
String searchId = idText.getValue();
dialogService.showErrorDialogAndWait(Localization.lang("Fetcher '%0' did not find an entry for id '%1'.", fetcher, searchId));
boolean addEntryFlag = dialogService.showConfirmationDialogAndWait("DOI not found",
Localization.lang("Fetcher '%0' did not find an entry for id '%1'.", fetcher, searchId),
"Add entry manually", "Return to dialog");
if (addEntryFlag) {
new NewEntryAction(libraryTab.frame(), StandardEntryType.Article, dialogService, preferencesService, stateManager).execute();
searchSuccesfulProperty.set(true);
}
}
fetcherWorker = new FetcherWorker();

Expand Down

0 comments on commit 398f74a

Please sign in to comment.