Skip to content

Commit

Permalink
Merge pull request #3762 from JabRef/meaningful-button-review-field-m…
Browse files Browse the repository at this point in the history
…igration

* Fix logic
* Rename confirmation into "Merge fields"
  • Loading branch information
koppor authored Feb 23, 2018
2 parents 06b6905 + c0677b3 commit 9daaf75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void performAction(BasePanel basePanel, ParserResult parserResult) {

migration.performMigration(parserResult);
List<BibEntry> conflicts = MergeReviewIntoCommentMigration.collectConflicts(parserResult);
if (new MergeReviewIntoCommentConfirmationDialog(basePanel).askUserForMerge(conflicts)) {
if (!conflicts.isEmpty() && new MergeReviewIntoCommentConfirmationDialog(basePanel).askUserForMerge(conflicts)) {
migration.performConflictingMigration(parserResult);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ public boolean askUserForMerge(List<BibEntry> 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;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9daaf75

Please sign in to comment.