From 2b1ae49bf7058b006cea265b22bcc4e709d587dc Mon Sep 17 00:00:00 2001 From: Alan Biju Date: Mon, 24 Oct 2022 01:44:48 +1100 Subject: [PATCH 1/7] Fixes koppor#566 --- CHANGELOG.md | 1 + .../java/org/jabref/gui/importer/GrobidOptInDialogHelper.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ed74a68e2c..36fbbe4269c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where hitting enter on the search field within the preferences dialog closed the dialog. [koppor#630](https://github.com/koppor/jabref/issues/630) - We fixed a typo within a connection error message. [koppor#625](https://github.com/koppor/jabref/issues/625) - We fixed an issue where the 'close dialog' key binding was not closing the Preferences dialog. [#8888](https://github.com/jabref/jabref/issues/8888) +- We fixed an issue where the dialogue window for sending to Grobid would not appear after importing a pdf the first time. [koppor#566](https://github.com/koppor/jabref/issues/566) ### Removed diff --git a/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java b/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java index cf21a38a30c..be989a8c71a 100644 --- a/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java +++ b/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java @@ -19,8 +19,8 @@ public class GrobidOptInDialogHelper { * @return if the user enabled Grobid, either in the past or after being asked by the dialog. */ public static boolean showAndWaitIfUserIsUndecided(DialogService dialogService, GrobidPreferences preferences) { - if (preferences.isGrobidEnabled()) { - return true; + if (!preferences.isGrobidEnabled()) { + return false; } if (preferences.isGrobidOptOut()) { return false; From a52fb39e083bd780b6edc9c9cc8b59aceaa65a96 Mon Sep 17 00:00:00 2001 From: Alan Biju Date: Sat, 29 Oct 2022 13:49:03 +1100 Subject: [PATCH 2/7] Changed dialogue box --- .../gui/importer/GrobidOptInDialogHelper.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java b/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java index be989a8c71a..8ac9b6b271f 100644 --- a/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java +++ b/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java @@ -19,17 +19,17 @@ public class GrobidOptInDialogHelper { * @return if the user enabled Grobid, either in the past or after being asked by the dialog. */ public static boolean showAndWaitIfUserIsUndecided(DialogService dialogService, GrobidPreferences preferences) { - if (!preferences.isGrobidEnabled()) { - return false; + if (preferences.isGrobidEnabled()) { + return true; } - if (preferences.isGrobidOptOut()) { + /*if (preferences.isGrobidOptOut()) { return false; - } - boolean grobidEnabled = dialogService.showConfirmationDialogWithOptOutAndWait( + }*/ + boolean grobidEnabled = dialogService.showConfirmationDialogAndWait( Localization.lang("Remote services"), Localization.lang("Allow sending PDF files and raw citation strings to a JabRef online service (Grobid) to determine Metadata. This produces better results."), - Localization.lang("Do not ask again"), - (optOut) -> preferences.grobidOptOutProperty().setValue(optOut)); + Localization.lang("Yes"), + Localization.lang("No")); preferences.grobidEnabledProperty().setValue(grobidEnabled); return grobidEnabled; } From 8e2f8fb13ee57c99a65a2074376cc6a64d115773 Mon Sep 17 00:00:00 2001 From: Alan Biju Date: Sat, 29 Oct 2022 16:21:18 +1100 Subject: [PATCH 3/7] Finished dialogue box. Need to add privacy statement --- .../org/jabref/gui/importer/GrobidOptInDialogHelper.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java b/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java index 8ac9b6b271f..b06cc4bd325 100644 --- a/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java +++ b/src/main/java/org/jabref/gui/importer/GrobidOptInDialogHelper.java @@ -19,18 +19,21 @@ public class GrobidOptInDialogHelper { * @return if the user enabled Grobid, either in the past or after being asked by the dialog. */ public static boolean showAndWaitIfUserIsUndecided(DialogService dialogService, GrobidPreferences preferences) { + System.out.println(preferences.isGrobidEnabled()); + System.out.println(preferences.isGrobidOptOut()); if (preferences.isGrobidEnabled()) { return true; } - /*if (preferences.isGrobidOptOut()) { - return false; - }*/ + if (preferences.isGrobidOptOut()) { + return preferences.isGrobidEnabled(); + } boolean grobidEnabled = dialogService.showConfirmationDialogAndWait( Localization.lang("Remote services"), Localization.lang("Allow sending PDF files and raw citation strings to a JabRef online service (Grobid) to determine Metadata. This produces better results."), Localization.lang("Yes"), Localization.lang("No")); preferences.grobidEnabledProperty().setValue(grobidEnabled); + preferences.grobidOptOutProperty().setValue(true); return grobidEnabled; } } From 041fca2d58c7090426ba15a809f1a2b348b41c0a Mon Sep 17 00:00:00 2001 From: Alan Biju Date: Sat, 29 Oct 2022 20:16:27 +1100 Subject: [PATCH 4/7] Added privacy statement in prefs --- .../org/jabref/gui/preferences/importexport/ImportExportTab.fxml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/jabref/gui/preferences/importexport/ImportExportTab.fxml b/src/main/java/org/jabref/gui/preferences/importexport/ImportExportTab.fxml index a1fc3bbb64d..ed29f976436 100644 --- a/src/main/java/org/jabref/gui/preferences/importexport/ImportExportTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/importexport/ImportExportTab.fxml @@ -29,6 +29,7 @@