From 7647f02572bd4430b68d36fbfec1d61bccd2208e Mon Sep 17 00:00:00 2001 From: Linus Dietz Date: Wed, 21 Feb 2018 17:06:00 +0100 Subject: [PATCH 1/2] Fix logic --- .../gui/importer/actions/MergeReviewIntoCommentAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java index 71b52e42eaf..c1aa6a96b74 100644 --- a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentAction.java @@ -20,7 +20,7 @@ public void performAction(BasePanel basePanel, ParserResult parserResult) { migration.performMigration(parserResult); List conflicts = MergeReviewIntoCommentMigration.collectConflicts(parserResult); - if (new MergeReviewIntoCommentConfirmationDialog(basePanel).askUserForMerge(conflicts)) { + if (!conflicts.isEmpty() && new MergeReviewIntoCommentConfirmationDialog(basePanel).askUserForMerge(conflicts)) { migration.performConflictingMigration(parserResult); } } From c0677b3d653c3a86db0e99a12979cbd2b89124e9 Mon Sep 17 00:00:00 2001 From: Linus Dietz Date: Wed, 21 Feb 2018 17:09:48 +0100 Subject: [PATCH 2/2] Rename confirmation into "Merge fields" --- .../actions/MergeReviewIntoCommentConfirmationDialog.java | 5 +++-- src/main/resources/l10n/JabRef_en.properties | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentConfirmationDialog.java b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentConfirmationDialog.java index 4a7eaedd8f0..b6db65c716b 100644 --- a/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentConfirmationDialog.java +++ b/src/main/java/org/jabref/gui/importer/actions/MergeReviewIntoCommentConfirmationDialog.java @@ -25,13 +25,14 @@ public boolean askUserForMerge(List conflicts) { .map(Optional::get) .collect(Collectors.joining(",\n")); - int answer = JOptionPane.showConfirmDialog( + String[] options = {Localization.lang("Merge fields")}; + int answer = JOptionPane.showOptionDialog( panel, bibKeys + " " + Localization.lang("has/have both a 'Comment' and a 'Review' field.") + "\n" + Localization.lang("Since the 'Review' field was deprecated in JabRef 4.2, these two fields are about to be merged into the 'Comment' field.") + "\n" + Localization.lang("The conflicting fields of these entries will be merged into the 'Comment' field."), - Localization.lang("Review Field Migration"), JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE); + Localization.lang("Review Field Migration"), JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); return 0 == answer; } diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 6b4b8ea1d3d..cc23c0e41a1 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -719,6 +719,7 @@ Memory\ stick\ mode=Memory stick mode Menu\ and\ label\ font\ size=Menu and label font size Merged\ external\ changes=Merged external changes +Merge\ fields=Merge fields Messages=Messages