From 5b34fe8d30cd203ef331f4878b3fdbe104fc0ad7 Mon Sep 17 00:00:00 2001 From: Zhouheng98 <127819870+Zhouheng98@users.noreply.github.com> Date: Sun, 5 Nov 2023 00:04:49 +1100 Subject: [PATCH] Enable journal information fetcher directly in popup (#10598) * fix-for-issue-10458 * l10n and minor code tweak * CHANGELOG.md * fix l10n --------- Co-authored-by: Christoph Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> --- CHANGELOG.md | 2 +- .../fieldeditors/JournalInfoOptInDialogHelper.java | 14 ++++++++++---- src/main/resources/l10n/JabRef_en.properties | 8 +++++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b45208a55f2..24c632a982d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue where the added protected term has unwanted leading and trailing whitespaces, where the formatted text has unwanted empty brackets and where the word at the cursor in the textbox can be added to the list. [#10415](https://github.com/JabRef/jabref/issues/10415) - We fixed an issue where in the merge dialog the file field of entries was not correctly merged when the first and second entry both contained values inside the file field. [#10572](https://github.com/JabRef/jabref/issues/10572) -- We fixed some small inconsistencies in the user interface. [#10507](https://github.com/JabRef/jabref/issues/10507) +- We fixed some small inconsistencies in the user interface. [#10507](https://github.com/JabRef/jabref/issues/10507) [#10458](https://github.com/JabRef/jabref/issues/10458) ### Removed diff --git a/src/main/java/org/jabref/gui/fieldeditors/JournalInfoOptInDialogHelper.java b/src/main/java/org/jabref/gui/fieldeditors/JournalInfoOptInDialogHelper.java index c811936a379..b1209ba95db 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/JournalInfoOptInDialogHelper.java +++ b/src/main/java/org/jabref/gui/fieldeditors/JournalInfoOptInDialogHelper.java @@ -15,12 +15,18 @@ public static boolean isJournalInfoEnabled(DialogService dialogService, EntryEdi } if (preferences.shouldEnableJournalPopup() == EntryEditorPreferences.JournalPopupEnabled.DISABLED) { - dialogService.notify( - Localization.lang("Please enable journal information fetching in %0 > %1", + boolean enableJournalPopup = dialogService.showConfirmationDialogAndWait( + Localization.lang("Enable Journal Information Fetching?"), + Localization.lang("Would you like to enable fetching of journal information? This can be changed later in %0 > %1.", Localization.lang("Preferences"), - Localization.lang("Web search")) + Localization.lang("Entry editor")), Localization.lang("Enable"), Localization.lang("Keep disabled") ); - return false; + + preferences.setEnableJournalPopup(enableJournalPopup + ? EntryEditorPreferences.JournalPopupEnabled.ENABLED + : EntryEditorPreferences.JournalPopupEnabled.DISABLED); + + return enableJournalPopup; } boolean journalInfoEnabled = dialogService.showConfirmationDialogAndWait( diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index e0c5c45f5cd..e780f69dcde 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -477,7 +477,6 @@ Year=Year ISSN\ or\ journal\ name\ required\ for\ fetching\ journal\ information=ISSN or journal name required for fetching journal information Fetch\ journal\ information\ online\ to\ show=Fetch journal information online to show Allow\ sending\ ISSN\ to\ a\ JabRef\ online\ service\ (SCimago)\ for\ fetching\ journal\ information=Allow sending ISSN to a JabRef online service (SCimago) for fetching journal information -Please\ enable\ journal\ information\ fetching\ in\ %0\ >\ %1=Please enable journal information fetching in %0 > %1 Categories=Categories ISSN=ISSN Publisher=Publisher @@ -2605,3 +2604,10 @@ Pushing\ citations\ to\ TeXShop\ is\ only\ possible\ on\ macOS\!=Pushing citatio Single\ instance=Single instance Enforce\ single\ JabRef\ instance\ (and\ allow\ remote\ operations)\ using\ port=Enforce single JabRef instance (and allow remote operations) using port + + +Enable\ Journal\ Information\ Fetching?=Enable Journal Information Fetching? +Would\ you\ like\ to\ enable\ fetching\ of\ journal\ information?\ This\ can\ be\ changed\ later\ in\ %0\ >\ %1.=Would you like to enable fetching of journal information? This can be changed later in %0 > %1. +Enable=Enable +Keep\ disabled=Keep disabled +