Skip to content

Commit 9b8e385

Browse files
committed
CHANGELOG.md
1 parent 08fa945 commit 9b8e385

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/main/java/org/jabref/gui/JabRefFrame.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ private MenuBar createMenu() {
755755

756756
quality.getItems().addAll(
757757
factory.createMenuItem(StandardActions.FIND_DUPLICATES, new DuplicateSearch(this, dialogService, stateManager)),
758-
factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(dialogService, stateManager)),
758+
factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(this, dialogService, stateManager)),
759759
factory.createMenuItem(StandardActions.CHECK_INTEGRITY, new IntegrityCheckAction(this, stateManager, Globals.TASK_EXECUTOR)),
760760
factory.createMenuItem(StandardActions.CLEANUP_ENTRIES, new OldDatabaseCommandWrapper(Actions.CLEANUP, this, stateManager)),
761761

src/main/java/org/jabref/gui/maintable/RightClickMenu.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static ContextMenu create(BibEntryTableViewModel entry, KeyBindingReposit
6868
contextMenu.getItems().add(new ChangeEntryTypeMenu().getChangeEntryTypeMenu(entry.getEntry(), panel.getBibDatabaseContext(), panel.getUndoManager()));
6969
contextMenu.getItems().add(factory.createMenuItem(StandardActions.MERGE_WITH_FETCHED_ENTRY, new MergeWithFetchedEntryAction(panel, dialogService, stateManager)));
7070
contextMenu.getItems().add(factory.createMenuItem(StandardActions.ATTACH_FILE, new AttachFileAction(panel, dialogService, stateManager, preferencesService)));
71-
contextMenu.getItems().add(factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(dialogService, stateManager)));
71+
contextMenu.getItems().add(factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(panel.frame(), dialogService, stateManager)));
7272

7373
return contextMenu;
7474
}

src/main/java/org/jabref/gui/mergeentries/MergeEntriesAction.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import org.jabref.Globals;
88
import org.jabref.gui.DialogService;
9+
import org.jabref.gui.JabRefFrame;
910
import org.jabref.gui.StateManager;
1011
import org.jabref.gui.actions.ActionHelper;
1112
import org.jabref.gui.actions.SimpleCommand;
@@ -18,10 +19,12 @@
1819

1920
public class MergeEntriesAction extends SimpleCommand {
2021

22+
private final JabRefFrame frame;
2123
private final DialogService dialogService;
2224
private final StateManager stateManager;
2325

24-
public MergeEntriesAction(DialogService dialogService, StateManager stateManager) {
26+
public MergeEntriesAction(JabRefFrame frame, DialogService dialogService, StateManager stateManager) {
27+
this.frame = frame;
2528
this.dialogService = dialogService;
2629
this.stateManager = stateManager;
2730

@@ -53,9 +56,10 @@ public void execute() {
5356
dlg.setTitle(Localization.lang("Merge entries"));
5457
Optional<BibEntry> mergedEntry = dlg.showAndWait();
5558
if (mergedEntry.isPresent()) {
56-
// FixMe: BibDatabase::insertEntry does not contain logic to mark the BasePanel as changed and to mark
57-
// entries with a timestamp, only BasePanel::insertEntry does.
58-
databaseContext.getDatabase().insertEntry(mergedEntry.get());
59+
// ToDo: BibDatabase::insertEntry does not contain logic to mark the BasePanel as changed and to mark
60+
// entries with a timestamp, only BasePanel::insertEntry does. Workaround for the moment is to get the
61+
// BasePanel from the constructor injected JabRefFrame. Should be refactored and extracted!
62+
frame.getCurrentBasePanel().insertEntry(mergedEntry.get());
5963

6064
// Create a new entry and add it to the undo stack
6165
// Remove the other two entries and add them to the undo stack (which is not working...)

0 commit comments

Comments
 (0)