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

Adding notifications when writing metadata to pdfs #8647

Merged
merged 4 commits into from
Apr 10, 2022

Conversation

AntonioIgorCarvalho
Copy link
Contributor

@AntonioIgorCarvalho AntonioIgorCarvalho commented Apr 5, 2022

Adding notifications when writing metadata to pdfs

Fixes #8276

Simple notifications added when clicking in this button specifically, as mentioned in issue #8276
button

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

Screenshot with success:
success

Screenshot when writting in a deleted file:
notfound

Screenshot when writting in a corrupted file:
error

Error log when writting in a corrupted file:
log

Adding notifications when writing metadata to pdfs
@ThiloteE
Copy link
Member

ThiloteE commented Apr 5, 2022

Wow, this already looks pretty good. Definitely a step forward! Thank you!

@AntonioIgorCarvalho AntonioIgorCarvalho marked this pull request as ready for review April 6, 2022 15:28
@Siedlerchr
Copy link
Member

Please have a look at the faliing unit test regarding Localization, see also https://devdocs.jabref.org/getting-into-the-code/code-howtos#using-localization-correctly

} catch (IOException | TransformerException ex) {
// TODO: Print error message
// Localization.lang("Error while writing") + " '" + file.toString() + "': " + ex;
dialogService.notify(Localization.lang("Error while writing") + " '" + file.toString() + "': " + ex);
Copy link
Member

Choose a reason for hiding this comment

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

Please also log the message using LOGGER.error(...)

} catch (IOException | TransformerException ex) {
// TODO: Print error message
// Localization.lang("Error while writing") + " '" + file.toString() + "': " + ex;
dialogService.notify(Localization.lang("Error while writing") + " '" + file.toString() + "': " + ex);
Copy link
Member

Choose a reason for hiding this comment

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

Instead of printing the exception in the notify, I would add instead: dialogService.notify(Localization.lang("Error while writing metadata. See the error log for details.")

@ThiloteE
Copy link
Member

ThiloteE commented Apr 6, 2022

I tested your current version.

When I tried to write metadata to a write protected file the following error emerged:

image

Which is fine i guess.

When i tried writing a normal file, "Finished writing metadata!". When the file was moved somewhere else "File not found" emerged.

Looking good. Thumps up.

@ThiloteE ThiloteE added this to the v5.6 milestone Apr 7, 2022
@Siedlerchr
Copy link
Member

Thanks for the follow up! Please have a look at the failing test

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 10, 2022
@Siedlerchr
Copy link
Member

I took the opportunity to fix and slighly reword the localization.

@koppor koppor merged commit e754cac into JabRef:main Apr 10, 2022
@koppor koppor removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 10, 2022
@Siedlerchr
Copy link
Member

Thanks nontheless for your contribution @AntonioIgorCarvalho

Siedlerchr added a commit that referenced this pull request Apr 11, 2022
…-0.3.0' of github.com:JabRef/jabref into dependabot/gradle/com.github.tomtung-latex2unicode_2.12-0.3.0

* 'dependabot/gradle/com.github.tomtung-latex2unicode_2.12-0.3.0' of github.com:JabRef/jabref:
  try version 0.3.1
  Save xmp data to new file and then copy it back (#8656)
  Adding notifications when writing metadata to pdfs (#8647)
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.

Add XMP metadata has been written succesfully/failed to pdf
4 participants