Skip to content

Commit

Permalink
on click on "Auto" button, downloadFullText only happens after no ext…
Browse files Browse the repository at this point in the history
…ernal links could be set.
  • Loading branch information
simonharrer authored and stefan-kolb committed Oct 9, 2015
1 parent b62071f commit 9e0bb87
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/main/java/net/sf/jabref/gui/fieldeditors/FileListEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,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;
Expand Down Expand Up @@ -429,24 +427,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;

}

/**
Expand Down

0 comments on commit 9e0bb87

Please sign in to comment.