Skip to content
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

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

Merged
merged 3 commits into from
Oct 30, 2016
Merged

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

merged 3 commits into from
Oct 30, 2016

Conversation

chriba
Copy link
Contributor

@chriba chriba commented Oct 29, 2016

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
Copy link
Contributor Author

chriba commented Oct 29, 2016

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)).

@@ -783,7 +785,10 @@ private void delete() {
getUndoManager().addEdit(compound);

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

Copy link
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
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').

@@ -183,11 +183,10 @@ public void editSignalled() {

public void editSignalled(BibEntry entry) {
final BasePanelMode mode = panel.getMode();
EntryEditor editor = panel.getEntryEditor(entry);
Copy link
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
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
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