Skip to content

Commit

Permalink
CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus committed Feb 20, 2020
1 parent 08fa945 commit 9b8e385
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ private MenuBar createMenu() {

quality.getItems().addAll(
factory.createMenuItem(StandardActions.FIND_DUPLICATES, new DuplicateSearch(this, dialogService, stateManager)),
factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(dialogService, stateManager)),
factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(this, dialogService, stateManager)),
factory.createMenuItem(StandardActions.CHECK_INTEGRITY, new IntegrityCheckAction(this, stateManager, Globals.TASK_EXECUTOR)),
factory.createMenuItem(StandardActions.CLEANUP_ENTRIES, new OldDatabaseCommandWrapper(Actions.CLEANUP, this, stateManager)),

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/maintable/RightClickMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static ContextMenu create(BibEntryTableViewModel entry, KeyBindingReposit
contextMenu.getItems().add(new ChangeEntryTypeMenu().getChangeEntryTypeMenu(entry.getEntry(), panel.getBibDatabaseContext(), panel.getUndoManager()));
contextMenu.getItems().add(factory.createMenuItem(StandardActions.MERGE_WITH_FETCHED_ENTRY, new MergeWithFetchedEntryAction(panel, dialogService, stateManager)));
contextMenu.getItems().add(factory.createMenuItem(StandardActions.ATTACH_FILE, new AttachFileAction(panel, dialogService, stateManager, preferencesService)));
contextMenu.getItems().add(factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(dialogService, stateManager)));
contextMenu.getItems().add(factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(panel.frame(), dialogService, stateManager)));

return contextMenu;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.jabref.Globals;
import org.jabref.gui.DialogService;
import org.jabref.gui.JabRefFrame;
import org.jabref.gui.StateManager;
import org.jabref.gui.actions.ActionHelper;
import org.jabref.gui.actions.SimpleCommand;
Expand All @@ -18,10 +19,12 @@

public class MergeEntriesAction extends SimpleCommand {

private final JabRefFrame frame;
private final DialogService dialogService;
private final StateManager stateManager;

public MergeEntriesAction(DialogService dialogService, StateManager stateManager) {
public MergeEntriesAction(JabRefFrame frame, DialogService dialogService, StateManager stateManager) {
this.frame = frame;
this.dialogService = dialogService;
this.stateManager = stateManager;

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

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

0 comments on commit 9b8e385

Please sign in to comment.