From d545de86c751fecedf35bf9b7f404c4c9e5b09ce Mon Sep 17 00:00:00 2001 From: Simon Harrer Date: Fri, 9 Oct 2015 14:02:52 +0200 Subject: [PATCH] on click on "Auto" button, downloadFullText only happens after no external links could be set. --- .../gui/fieldeditors/FileListEditor.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/net/sf/jabref/gui/fieldeditors/FileListEditor.java b/src/main/java/net/sf/jabref/gui/fieldeditors/FileListEditor.java index a90054aa1f38..92ac6abb3e52 100644 --- a/src/main/java/net/sf/jabref/gui/fieldeditors/FileListEditor.java +++ b/src/main/java/net/sf/jabref/gui/fieldeditors/FileListEditor.java @@ -70,8 +70,6 @@ public class FileListEditor extends JTable implements FieldEditor, DownloadExter private final JButton auto; private final JPopupMenu menu = new JPopupMenu(); - private static boolean fileFound; - public FileListEditor(JabRefFrame frame, MetaData metaData, String fieldName, String content, EntryEditor entryEditor) { this.frame = frame; @@ -396,24 +394,27 @@ public void autoSetLinks() { @Override public void actionPerformed(ActionEvent e) { auto.setEnabled(true); + + + + if (e.getID() > 0) { - fileFound = true; entryEditor.updateField(FileListEditor.this); frame.output(Localization.lang("Finished autosetting external links.")); } else { frame.output(Localization.lang("Finished autosetting external links.") + " " + Localization.lang("No files found.")); + + // auto download file as no file found before + frame.basePanel().runCommand("downloadFullText"); } + + // reset + auto.setEnabled(true); } }, dialog)); - // auto download file - if(!fileFound) { - frame.basePanel().runCommand("downloadFullText"); - } - // reset - auto.setEnabled(true); - fileFound = false; + } /**