Skip to content

Adding notifications when writing metadata to pdfs#8647

Merged
koppor merged 4 commits into
JabRef:mainfrom
AntonioIgorCarvalho:fix-issue-8276
Apr 10, 2022
Merged

Adding notifications when writing metadata to pdfs#8647
koppor merged 4 commits into
JabRef:mainfrom
AntonioIgorCarvalho:fix-issue-8276

Conversation

@AntonioIgorCarvalho

@AntonioIgorCarvalho AntonioIgorCarvalho commented Apr 5, 2022

Copy link
Copy Markdown
Contributor

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

ThiloteE commented Apr 5, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

ThiloteE commented Apr 6, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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