-
-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(merge-dialog): fix 'treat duplicates the same way' checkbox #14224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv | |||||
|
|
||||||
| ### Fixed | ||||||
|
|
||||||
| - We fixed the checkbox in merge dialog "Treat duplicates the same way". Now it works | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
and add issue number There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it okay to link melting pot issue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just use the PR number then |
||||||
|
|
||||||
| ### Removed | ||||||
|
|
||||||
| ## [6.0-alpha.3] – 2025-10-30 | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -57,6 +57,9 @@ public class DuplicateSearch extends SimpleCommand { | |||||
| private final BibEntryTypesManager entryTypesManager; | ||||||
| private final TaskExecutor taskExecutor; | ||||||
|
|
||||||
| // For "apply to all entries" functionality. | ||||||
| private DuplicateResolverResult rememberedDecision = null; | ||||||
Siedlerchr marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for uniformity
Suggested change
|
||||||
|
|
||||||
| public DuplicateSearch(Supplier<LibraryTab> tabSupplier, | ||||||
| DialogService dialogService, | ||||||
| StateManager stateManager, | ||||||
|
|
@@ -83,6 +86,7 @@ public void execute() { | |||||
| libraryAnalyzed.set(false); | ||||||
| autoRemoveExactDuplicates.set(false); | ||||||
| duplicateCount.set(0); | ||||||
| rememberedDecision = null; | ||||||
|
|
||||||
| if (entries.size() < 2) { | ||||||
| return; | ||||||
|
|
@@ -160,9 +164,23 @@ private void askResolveStrategy(DuplicateSearchResult result, BibEntry first, Bi | |||||
|
|
||||||
| dialog.titleProperty().bind(Bindings.concat(dialog.getTitle()).concat(" (").concat(duplicateProgress.getValue()).concat("/").concat(duplicateTotal).concat(")")); | ||||||
|
|
||||||
| DuplicateResolverResult resolverResult = dialogService.showCustomDialogAndWait(dialog) | ||||||
| .orElse(DuplicateResolverResult.BREAK); | ||||||
| DuplicateResolverResult resolverResult; | ||||||
|
|
||||||
| if (preferences.getMergeDialogPreferences().shouldMergeApplyToAllEntries() && rememberedDecision != null) { | ||||||
| resolverResult = rememberedDecision; | ||||||
| } else { | ||||||
| resolverResult = dialogService.showCustomDialogAndWait(dialog) | ||||||
| .orElse(DuplicateResolverResult.BREAK); | ||||||
|
|
||||||
| if (preferences.getMergeDialogPreferences().shouldMergeApplyToAllEntries()) { | ||||||
| rememberedDecision = resolverResult; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| applyDecisionToResult(result, first, second, resolverResult, dialog); | ||||||
| } | ||||||
|
|
||||||
| private void applyDecisionToResult(DuplicateSearchResult result, BibEntry first, BibEntry second, DuplicateResolverResult resolverResult, DuplicateResolverDialog dialog) { | ||||||
| if ((resolverResult == DuplicateResolverResult.KEEP_LEFT) | ||||||
| || (resolverResult == DuplicateResolverResult.AUTOREMOVE_EXACT)) { | ||||||
| result.remove(second); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue number