Skip to content

Store changes in source tab when new entry is selected#3097

Merged
matthiasgeiger merged 15 commits into
masterfrom
fix-sourcetab-update
Aug 13, 2017
Merged

Store changes in source tab when new entry is selected#3097
matthiasgeiger merged 15 commits into
masterfrom
fix-sourcetab-update

Conversation

@lenhard

@lenhard lenhard commented Aug 11, 2017

Copy link
Copy Markdown
Member

Fixes #3086

The problem was that the source tab only stored changes on focus change and this did not happen when you just select a new entry in the main table.

The PR modifies an attribute in the EntryEditor (movingToDifferentEntry) and turns it into a BooleanProperty so that you can bind to it and react to changes.

EDIT: Also fixes a second (unreported) issue: Now the base panel is marked as dirty when you type something in the source tab.

EDIT 2: Fixes also #3063

Now the Other fields tab is rebuilt whenever an other field is newly added or removed at the BibEntry. This is achieved with the event system and a new subtype of FieldChangedEvent.

  • 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 11, 2017
@lenhard lenhard removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 11, 2017
@lenhard lenhard changed the title Store changes in source tab when new entry is selected [WIP] Store changes in source tab when new entry is selected Aug 11, 2017
@lenhard lenhard changed the title [WIP] Store changes in source tab when new entry is selected Store changes in source tab when new entry is selected Aug 11, 2017
@lenhard lenhard added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 11, 2017
OtherFieldsTab tab = new OtherFieldsTab(frame, panel, entryType, this, entry);
if (tab.getFields().size() > 0) {
// add it at default index, but that is just a guess
int defaultIndex = 4;

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.

Please add a constant for the magic number

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

@matthiasgeiger matthiasgeiger left a comment

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.

Looks good to me and also works ;-)

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.

Changes in Source Tab are not saved correctly without switching to another tab

3 participants