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

Close entry editor when the shown entry is removed externally #3156

Merged
merged 2 commits into from
Aug 27, 2017

Conversation

lenhard
Copy link
Member

@lenhard lenhard commented Aug 25, 2017

Fixes the remaining part of #2946

When you externally delete an entry that is opened in the entry editor and accept the change in the dialog in JabRef, then the entry editor closes. That way, it prevents you from editing an entry that does no longer exist.

As a side note: The BasePanel is ripe for a refactoring. There are a good dozen classes that I could extract. In the light of only doing bug fixes before the 4.0 release, I'll avoid that now. But when we've released, this class gets it...

  • Change in CHANGELOG.md described
  • Tests created for changes
  • Screenshots added (for bigger UI changes)
  • Manually tested changed features in running JabRef
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)
  • If you changed the localization: Did you run gradle localizationUpdate?

@lenhard lenhard added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 25, 2017
@@ -2097,6 +2098,18 @@ public void listen(EntryAddedEvent addedEntryEvent) {
}
}

private class EntryRemovedListener {
Copy link
Member

Choose a reason for hiding this comment

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

Why do you introduce this private class? Why not directly add the listener to the BasePanel?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because there are several other listeners in BasePanel that are all implemented as separate classes. That way it is easier to one day extract the listeners into different files and reduce the size of BasePanel

Btw.: BasePanel currently has no closing method, so these listeners are never unregistered and are essentially a memory leak. Not too big a problem, though: A new BasePanel is created very rarely and the listeners are very small (another reason for the separate class at the moment).

@lenhard
Copy link
Member Author

lenhard commented Aug 27, 2017

For the sake of getting things done. I'll merge now directly, even though there's only one review. I guess because of our current shortage in personal we'll have to deviate from the two-reviewer rule now and then.

@lenhard lenhard merged commit 8abf3ed into master Aug 27, 2017
@lenhard lenhard deleted the entry-editor-external branch August 27, 2017 16:03
Siedlerchr added a commit that referenced this pull request Aug 27, 2017
* upstream/master:
  Add preference to disable validation in the entry editor by default (#3154)
  Fix freezing on browse in protected terms dialog when adding from entry editor (#3158)
  Close entry editor when the shown entry is removed externally (#3156)
  .jar are not ignored any more (#3155)
  Increase size of file and keywords editors (#3141)
  Make Replace Strings work in bibtexkeyfield
  Fix errorprone (#3151)
  Fix display of percentage symbol in entry preview (#3149)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants