Skip to content

Prevent the search to get focus when deleting/pasting an entry#2211

Merged
koppor merged 3 commits into
JabRef:masterfrom
chriba:dontFocusSearch
Oct 30, 2016
Merged

Prevent the search to get focus when deleting/pasting an entry#2211
koppor merged 3 commits into
JabRef:masterfrom
chriba:dontFocusSearch

Conversation

@chriba

@chriba chriba commented Oct 29, 2016

Copy link
Copy Markdown
Contributor

Fixes: #2208

When you delete an entry the focus will no longer jump to the searchbar, instead it will select the next entry (also counts for pasting).

@chriba

chriba commented Oct 29, 2016

Copy link
Copy Markdown
Contributor Author

Now it works for cutting entries too.
I removed the code duplicate, although I'm not sure about the the pattern (not able to use runCommand(Actions.DELETE)).

markBaseChanged();
frame.output(formatOutputMessage(Localization.lang("Deleted"), entries.size()));
frame.output(formatOutputMessage(!cut ? Localization.lang("Deleted") : Localization.lang("Cut"), entries.size()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either you change the condition and put cut instead of not cut or you wrap it in if and else

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to cut (but didn't change the semantic').


public void editSignalled(BibEntry entry) {
final BasePanelMode mode = panel.getMode();
EntryEditor editor = panel.getEntryEditor(entry);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new editor was only needed if the condition was met, and previously the focus was possibly set to the wrong editor (if the condition wasn't met).

@Siedlerchr

Copy link
Copy Markdown
Member

To me code looks good :+2:

@koppor koppor merged commit 1b676b7 into JabRef:master Oct 30, 2016
@chriba chriba deleted the dontFocusSearch branch October 30, 2016 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants