-
-
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
Download many files in one go #1869
Conversation
c36fd29
to
287b388
Compare
If it does what you promise, I love you! 😍 😆 Will try this tomorrow.
Not sure if I understand you correctly: So I download e.g. 20 files, and 5 fails. Is then the dialog "Failed DL" displayed 5 times? |
Localization.lang("Directory not found"), JOptionPane.ERROR_MESSAGE); | ||
return; | ||
} | ||
// TODO: this needs its own thread as it blocks the UI! |
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.
Is this blocking still a problem?
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.
Not sure if it was before either...
Well, what you select is what you get. :-) I agree that your approach would be even better, but that is out of the scope for me at the moment. One could still reenable one selected entry at a time, with the added benefit of being able to start more than one, but I do not really know if that is a better way to do it. Maybe it is better to pop up a dialog asking if the user is sure they want to try to find > 10(?) full text documents as this can be quite a hassle? |
Agree with you. Add this dialog warning, for more than x? entries . Regarding the blocking: Does not block the UI atm. |
I updated and set it to 10. Not sure how much one should actually write in the dialog... |
90a3f72
to
07ec89b
Compare
@@ -44,6 +44,20 @@ public void init() throws Throwable { | |||
|
|||
@Override | |||
public void run() { | |||
if (basePanel.getSelectedEntries().size() >= 10) { |
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.
Please extract that "magic number" to a constant.
https://en.wikipedia.org/wiki/Magic_number_(programming)
Code LGTM, just move that magic number to a constant. |
Yeah, was thinking about the constant thing as well. Will fix it. I guess it is a good idea to merge now so people have time to find possible issues. |
Improved the file name generation as well. If the formatter does return an empty string, the BibTeX key is used. If no BibTeX key, "default" is used. |
* Download many files in one go * Added warnings dialog if 10 or more entries are selected for full text download * Extracted magic number and fixed file name generation fallback * Some code cleanups
Implements #1496 and also allows selecting multiple documents to find full text documents for. I think that it doesn't always show a dialog for every failed files when having multiple ongoing downloads.
Please try it out at http://builds.jabref.org/downloadmanyfiles