Skip to content

Added checking integrity dialog #3388

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

Merged
merged 2 commits into from
Nov 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We no longer create a new entry editor when selecting a new entry to increase performance. [#3187](https://github.com/JabRef/jabref/pull/3187)
- We increased performance and decreased the memory footprint of the entry editor drastically. [#3331](https://github.com/JabRef/jabref/pull/3331)
- Late initialization of the context menus in the entry editor. This improves performance and memory footprint further [#3340](https://github.com/JabRef/jabref/pull/3340)

- We added a dialog to show that JabRef is working on checking integrity. [#3358](https://github.com/JabRef/jabref/issues/3358)

### Fixed
- We fixed the translation of \textendash in the entry preview [#3307](https://github.com/JabRef/jabref/issues/3307)
Expand Down
36 changes: 35 additions & 1 deletion src/main/java/org/jabref/gui/actions/IntegrityCheckAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.RowFilter;
import javax.swing.SwingWorker;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableColumnModel;
import javax.swing.table.TableModel;
Expand All @@ -30,9 +32,12 @@

import com.jgoodies.forms.builder.FormBuilder;
import com.jgoodies.forms.layout.FormLayout;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class IntegrityCheckAction extends MnemonicAwareAction {

private static final Log LOGGER = LogFactory.getLog(IntegrityCheckAction.class);
private static final String ELLIPSES = "...";

private final JabRefFrame frame;
Expand All @@ -50,7 +55,36 @@ public void actionPerformed(ActionEvent e) {
Globals.prefs.getBibtexKeyPatternPreferences(),
Globals.journalAbbreviationLoader
.getRepository(Globals.prefs.getJournalAbbreviationPreferences()));
List<IntegrityMessage> messages = check.checkBibtexDatabase();

final JDialog integrityDialog = new JDialog(frame, true);
integrityDialog.setUndecorated(true);
integrityDialog.setLocationRelativeTo(frame);
JProgressBar integrityProgressBar = new JProgressBar();
integrityProgressBar.setIndeterminate(true);
integrityProgressBar.setStringPainted(true);
integrityProgressBar.setString(Localization.lang("Checking integrity..."));
integrityDialog.add(integrityProgressBar);
integrityDialog.pack();
SwingWorker<List<IntegrityMessage>, Void> worker = new SwingWorker<List<IntegrityMessage>, Void>() {
@Override
protected List<IntegrityMessage> doInBackground() {
List<IntegrityMessage> messages = check.checkBibtexDatabase();
return messages;
}

@Override
protected void done() {
integrityDialog.dispose();
}
};
worker.execute();
integrityDialog.setVisible(true);
List<IntegrityMessage> messages = null;
try {
messages = worker.get();
} catch (Exception ex) {
LOGGER.error("Integrity check failed.", ex);
}

if (messages.isEmpty()) {
JOptionPane.showMessageDialog(frame.getCurrentBasePanel(), Localization.lang("No problems found."));
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_da.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=Anzeigen_der_Kons

Remove_line_breaks=Entfernen_der_Zeilenumbrüche
Removes_all_line_breaks_in_the_field_content.=Entfernen_aller_Zeilenumbrüche_im_Inhalt_des_Feldes.
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_el.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=Show_console_outp

Remove_line_breaks=Remove_line_breaks
Removes_all_line_breaks_in_the_field_content.=Removes_all_line_breaks_in_the_field_content.
Checking_integrity...=Checking_integrity...
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=Afficher_la_sorti

Remove_line_breaks=Supprimer_les_sauts_de_ligne
Removes_all_line_breaks_in_the_field_content.=Supprime_tous_les_sauts_de_ligne_du_contenu_d'un_champ
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_in.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_no.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_pt_BR.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_sv.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_tr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=Consol_çıktıs

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_vi.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2339,3 +2339,4 @@ Show_console_output_(only_necessary_when_the_launcher_is_used)=

Remove_line_breaks=
Removes_all_line_breaks_in_the_field_content.=
Checking_integrity...=