Skip to content

Commit

Permalink
Added warnings dialog if 10 or more entries are selected for full tex…
Browse files Browse the repository at this point in the history
…t download
  • Loading branch information
oscargus committed Aug 27, 2016
1 parent 287b388 commit 90a3f72
Show file tree
Hide file tree
Showing 18 changed files with 100 additions and 37 deletions.
19 changes: 16 additions & 3 deletions src/main/java/net/sf/jabref/external/FindFullTextAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ public void init() throws Throwable {

@Override
public void run() {
if (basePanel.getSelectedEntries().size() >= 10) {
String[] options = new String[]{Localization.lang("Look up full text documents"), Localization.lang("Cancel")};
int answer = JOptionPane.showOptionDialog(basePanel.frame(),
Localization.lang(
"You are about to look up full text documents for %0 entries.",
String.valueOf(basePanel.getSelectedEntries().size())) + "\n"
+ Localization.lang("Do you still want to continue?"),
Localization.lang("Look up full text documents"), JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
if (answer != JOptionPane.OK_OPTION) {
basePanel.output(Localization.lang("Operation canceled."));
return;
}
}
for (BibEntry entry : basePanel.getSelectedEntries()) {
FulltextFetchers fft = new FulltextFetchers();
downloads.put(fft.findFullTextPDF(entry), entry);
Expand All @@ -66,7 +80,6 @@ public void update() {
Localization.lang("Directory not found"), JOptionPane.ERROR_MESSAGE);
return;
}
// TODO: this needs its own thread as it blocks the UI!
DownloadExternalFile def = new DownloadExternalFile(basePanel.frame(),
basePanel.getBibDatabaseContext(), entry);
try {
Expand All @@ -84,11 +97,11 @@ public void update() {
} catch (IOException e) {
LOGGER.warn("Problem downloading file", e);
}
basePanel.output(Localization.lang("Finished downloading full text document for entry %0",
basePanel.output(Localization.lang("Finished downloading full text document for entry %0.",
entry.getCiteKeyOptional().orElse(Localization.lang("undefined"))));
} else {
String title = Localization.lang("Full text document download failed");
String message = Localization.lang("Full text document download failed for entry %0",
String message = Localization.lang("Full text document download failed for entry %0.",
entry.getCiteKeyOptional().orElse(Localization.lang("undefined")));

basePanel.output(message);
Expand Down
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1772,5 +1772,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2484,5 +2484,8 @@ See_what_has_been_changed_in_the_JabRef_versions=Beschreibt_was_in_den_verschied

Referenced_BibTeX_key_does_not_exist=Referenzierter_BibTeX-Key_existiert_nicht

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
6 changes: 4 additions & 2 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2303,5 +2303,7 @@ Opens_JabRef's_website=Opens_JabRef's_website
Opens_a_link_where_the_current_development_version_can_be_downloaded=Opens_a_link_where_the_current_development_version_can_be_downloaded
See_what_has_been_changed_in_the_JabRef_versions=See_what_has_been_changed_in_the_JabRef_versions
Referenced_BibTeX_key_does_not_exist=Referenced_BibTeX_key_does_not_exist
Finished_downloading_full_text_document_for_entry_%0=Finished_downloading_full_text_document_for_entry_%0
Full_text_document_download_failed_for_entry_%0=Full_text_document_download_failed_for_entry_%0
Finished_downloading_full_text_document_for_entry_%0.=Finished_downloading_full_text_document_for_entry_%0.
Full_text_document_download_failed_for_entry_%0.=Full_text_document_download_failed_for_entry_%0.
Look_up_full_text_documents=Look_up_full_text_documents
You_are_about_to_look_up_full_text_documents_for_%0_entries.=You_are_about_to_look_up_full_text_documents_for_%0_entries.
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1673,5 +1673,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2453,5 +2453,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1722,5 +1722,8 @@ See_what_has_been_changed_in_the_JabRef_versions=Afficher_les_changements_dans_l

Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_in.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1689,5 +1689,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1790,5 +1790,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2430,5 +2430,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2462,5 +2462,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_no.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2854,5 +2854,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1686,5 +1686,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2431,5 +2431,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1634,5 +1634,8 @@ See_what_has_been_changed_in_the_JabRef_versions=Se_vad_som_har_ändrats_i_de_ol

Referenced_BibTeX_key_does_not_exist=Refererad_BibTeX-nyckel_finns_ej

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_tr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1707,5 +1707,8 @@ See_what_has_been_changed_in_the_JabRef_versions=

Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_vi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2457,5 +2457,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=
7 changes: 5 additions & 2 deletions src/main/resources/l10n/JabRef_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1698,5 +1698,8 @@ Opens_a_link_where_the_current_development_version_can_be_downloaded=
See_what_has_been_changed_in_the_JabRef_versions=
Referenced_BibTeX_key_does_not_exist=

Finished_downloading_full_text_document_for_entry_%0=
Full_text_document_download_failed_for_entry_%0=

Finished_downloading_full_text_document_for_entry_%0.=
Full_text_document_download_failed_for_entry_%0.=
Look_up_full_text_documents=
You_are_about_to_look_up_full_text_documents_for_%0_entries.=

0 comments on commit 90a3f72

Please sign in to comment.