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

fix for Library is marked as unsaved (*) after accepting changes from the file #11046

Closed
wants to merge 6 commits into from

Conversation

amrithdas
Copy link
Contributor

@amrithdas amrithdas commented Mar 19, 2024

Library will be saved along with accepting external changes in the bibTex file.
modified the code to save library upon clicking accept button in the review changes dialog box.
Closes #11027

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@koppor
Copy link
Member

koppor commented Mar 19, 2024

I am not sure if just saving is the right approach. JabRef has an autosave feature, which is offering "similar" functionality.

The original issue was: "even though it should match exactly the contents of the file saved to disk".

I am clarifying the requirement at #11027 (comment).

@@ -910,7 +910,8 @@ public void resetChangeMonitor() {
taskExecutor,
dialogService,
preferencesService,
databaseNotificationPane));
databaseNotificationPane,
this));
Copy link
Member

Choose a reason for hiding this comment

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

I think, better org.jabref.gui.StateManager#activeTabProperty should be used inside the code instead of passing down the tab.

@@ -88,12 +91,13 @@ private static Optional<ParserResult> showReviewBackupDialog(
List<DatabaseChange> changes = DatabaseChangeList.compareAndGetChanges(originalDatabase, backupDatabase, changeResolverFactory);
DatabaseChangesResolverDialog reviewBackupDialog = new DatabaseChangesResolverDialog(
changes,
originalDatabase, "Review Backup"
originalDatabase, "Review Backup",
libraryTab
Copy link
Member

Choose a reason for hiding this comment

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

Nono, there should be no save for restored backups. Please do not overwrite backups.

@koppor
Copy link
Member

koppor commented Mar 19, 2024

@amrithdas The discussion turned out that it is only about the asterisk marker, NOT about saving. Saving may lead to issues, thus this should be kept separate. Just try to change the logic that the library is not changed if all external changes were accepted.

@amrithdas
Copy link
Contributor Author

amrithdas commented Mar 19, 2024

@koppor so only asterisk needs to be removed when external changes are accepted?
Ok I think I got the point since the changes are accepted there is no need to save cause its the same as the file in the disk.
Let me see what can be done.

@amrithdas amrithdas closed this Mar 19, 2024
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.

Library is marked as unsaved (*) after accepting changes from the file
2 participants