|
6 | 6 |
|
7 | 7 | import org.jabref.Globals;
|
8 | 8 | import org.jabref.gui.DialogService;
|
| 9 | +import org.jabref.gui.JabRefFrame; |
9 | 10 | import org.jabref.gui.StateManager;
|
10 | 11 | import org.jabref.gui.actions.ActionHelper;
|
11 | 12 | import org.jabref.gui.actions.SimpleCommand;
|
|
18 | 19 |
|
19 | 20 | public class MergeEntriesAction extends SimpleCommand {
|
20 | 21 |
|
| 22 | + private final JabRefFrame frame; |
21 | 23 | private final DialogService dialogService;
|
22 | 24 | private final StateManager stateManager;
|
23 | 25 |
|
24 |
| - public MergeEntriesAction(DialogService dialogService, StateManager stateManager) { |
| 26 | + public MergeEntriesAction(JabRefFrame frame, DialogService dialogService, StateManager stateManager) { |
| 27 | + this.frame = frame; |
25 | 28 | this.dialogService = dialogService;
|
26 | 29 | this.stateManager = stateManager;
|
27 | 30 |
|
@@ -53,9 +56,10 @@ public void execute() {
|
53 | 56 | dlg.setTitle(Localization.lang("Merge entries"));
|
54 | 57 | Optional<BibEntry> mergedEntry = dlg.showAndWait();
|
55 | 58 | 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()); |
59 | 63 |
|
60 | 64 | // Create a new entry and add it to the undo stack
|
61 | 65 | // Remove the other two entries and add them to the undo stack (which is not working...)
|
|
0 commit comments