-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would propose to move this into the succeeded methoid here :
jabref/src/main/java/org/jabref/gui/externalfiles/AutoLinkFilesAction.java
Lines 60 to 68 in 5ab494e
Task<List<BibEntry>> linkFilesTask = new Task<>() { | |
@Override | |
protected List<BibEntry> call() { | |
return util.linkAssociatedFiles(entries, nc); | |
} | |
@Override | |
protected void succeeded() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
src/main/java/org/jabref/gui/externalfiles/AutoLinkFilesAction.java
Outdated
Show resolved
Hide resolved
…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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @IfIWantedTo for your contribution and @calixtus for finishing this PR.
src/main/java/org/jabref/gui/externalfiles/AutoLinkFilesAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/gui/externalfiles/AutoSetFileLinksUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/gui/externalfiles/AutoLinkFilesAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/gui/externalfiles/AutoLinkFilesAction.java
Outdated
Show resolved
Hide resolved
…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: