Add error dialog "Problem finding files"#6842
Conversation
AutoSetFileLinksUtil: -> imported JabRefDialogService and Localization ->showErrorDialogAndWait(...) I am currently having trouble writing a test
|
@IfIWantedTo Welcome to JabRef! Back to the code, it's a bit more complicated then simply adding a dialog there. I would propose to create a list with the exceptions in that class |
Fixed mistake in first commit. .lists all exceptions .notifies user of error via DialogService
|
@Siedlerchr Thank u for your help! I have completely missed the loop before, thank you! I have replaced the code before with an iteration of Regarding the IDE: I figured there was a problem with the configuration and I went over the guide multiple times. Again, thank you for your comment! Without you, this would have taken much longer :) |
| } | ||
|
|
||
| if (ce != null) { | ||
| if (!fileExceptions.isEmpty()) { // is this where it goes? find out! |
There was a problem hiding this comment.
I would propose to move this into the succeeded methoid here :
There was a problem hiding this comment.
Oh ok, thank you. Can I ask you a few questions about the succeeded() method?
As far as I understood, it notifies the user when it has set the file links, i.e. when the returned List of linkAssociatedFiles(...) is not empty. In the other case Finished automatically setting external links. No files found. I haven't quite understood yet, how this else case is different from what I am trying to accomplish.
There was a problem hiding this comment.
Sorry for the delay in answering. The succeeded method is called whenever the task is finished normally and doesn't get interrupted.
It either says files found or no files found, but it doesn't tell the user if there was an error (exception) which prevented finding the files.
So one addtional else case (your changes) is to notify the users that there have been X exceptions with the hint
e.g. There were x files with an exception. See log for details
- add returnFileExceptions() in AutoSetFileLinksUtil - add if ( 'there are exceptions' ) -> notify user in AutoSetFileLinkAction (placement still unclear, might be changed later)
…into IfIWantedTo-fix-issue-5890
|
I tried to finish this PR. Just did not had a file at hand to test the actual auto link, but every other case. So i think this should work, since I did not change the actual logic of the method. So ready for review. |
tobiasdiez
left a comment
There was a problem hiding this comment.
Thanks @IfIWantedTo for your contribution and @calixtus for finishing this PR.
…dtask * upstream/master: add language mapping for chinese remove chinese content fix hamcrest link Add Traditional Chinese (#7240) Show development information Allow manual trigger of the deployment workflow Release v5.2 Adapt changelog for 5.2 release Update external-libraries.md checkstyle L10n master (#7235) fix fetcher architecture test Add missing author Add error dialog "Problem finding files" (#6842) Disable ACM, Google Scholar, JSTOR (#7229)
I added an Error Dialog in AutoSetFileLinks. #5890
I decided to open a pull request in order to get feedback on what I've done.
This is my first contribution to OpenSource ever, so beware of stupid mistakes.
I am currently trying to go through the motions of contributing. However, I have run into a
few issues: