Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into portblock
Browse files Browse the repository at this point in the history
* upstream/master: (49 commits)
  improve styling of preferences side menu (#4556)
  Cleanup interfaces (#4553)
  Bump fontbox from 2.0.12 to 2.0.13 (#4552)
  Bump pdfbox from 2.0.12 to 2.0.13 (#4551)
  Bump wiremock from 2.19.0 to 2.20.0 (#4550)
  Fixes that renaming a group did not change the group name in the interface (#4549)
  Bump applicationinsights-logging-log4j2 from 2.2.1 to 2.3.0 (#4540)
  Bump antlr4-runtime from 4.7.1 to 4.7.2 (#4542)
  Bump applicationinsights-core from 2.2.1 to 2.3.0 (#4541)
  Bump antlr4 from 4.7.1 to 4.7.2 (#4543)
  Fix journal name "Astronomy Journal" to "Astronomical Journal"
  fix-for-issue-4489 (#4538)
  Sorting of read-status isn't working as expected #4521 (#4536)
  Add preselect last used export format in export to clipboard dialog (#4533)
  fixed 4365 put html in clipboard (#4519)
  [WIP] Convert Exporter Customization Dialog to javafx (#4394)
  Fixes #4437 (#4531)
  Bump checkstyle from 8.14 to 8.15 (#4528)
  Correct PNAS abbrev. (#4524)
  Create test (#4518)
  ...
  • Loading branch information
Siedlerchr committed Dec 28, 2018
2 parents 5004bbc + b936ba9 commit 928fd8e
Show file tree
Hide file tree
Showing 117 changed files with 2,503 additions and 1,431 deletions.
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
## [Unreleased]

### Changed
- We changed the location of some fields in the entry editor (you might need to reset your preferences for these changes to come into effect)
- Journal/Year/Month in biblatex mode -> Deprecated (if filled)
- DOI/URL: General -> Optional
- Internal fields like ranking, read status and priority: Other -> General
- Moreover, empty deprecated fields are no longer shown
- Added server timezone parameter when connecting to a shared database.
- We updated the dialog for setting up general fields.
- URL field formatting is updated. All whitespace chars, located at the beginning/ending of the url, are trimmed automatically
- We changed the behavior of the field formatting dialog such that the `bibtexkey` is not changed when formatting all fields or all text fields.
- We added a "Move file to file directory and rename file" option for simultaneously moving and renaming of document file. [#4166](https://github.com/JabRef/jabref/issues/4166)
- Use integrated graphics card instead of discrete on macOS [#4070](https://github.com/JabRef/jabref/issues/4070)
- We added a cleanup operation that detects an arXiv identifier in the note, journal or url field and moves it to the `eprint` field.
Because of this change, the last-used cleanup operations were reset.
- We changed the minimum required version of Java to 1.8.0_171, as this is the latest release for which the automatic Java update works. [4093](https://github.com/JabRef/jabref/issues/4093)
- The special fields like `Printed` and `Read status` now show gray icons when the row is hovered.
- We added a button in the tab header which allows you to close the database with one click. https://github.com/JabRef/jabref/issues/494
Expand All @@ -28,15 +36,18 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We changed the default keyboard shortcuts for moving between entries when the entry editor is active to ̀<kbd>alt</kbd> + <kbd>up/down</kbd>.
- Opening a new file now prompts the directory of the currently selected file, instead of the directory of the last opened file.
- Window state is saved on close and restored on start.
- We made the MathSciNet fetcher more reliable.
- We added the ISBN fetcher to the list of fetcher available under "Update with bibliographic information from the web" in the entry editor toolbar.
- Files without a defined external file type are now directly opened with the default application of the operating system
- We streamlined the process to rename and move files by removing the confirmation dialogs.
- We removed the redundant new lines of markings and wrapped the summary in the File annotation tab. [#3823](https://github.com/JabRef/jabref/issues/3823)
- We add auto url formatting when user paste link to URL field in entry editor. [koppor#254](https://github.com/koppor/jabref/issues/254)
- We added a minimal height for the entry editor so that it can no longer be hidden by accident. [#4279](https://github.com/JabRef/jabref/issues/4279)
- We added a new keyboard shortcut so that the entry editor could be closed by <kbd>Ctrl<kbd> + <kbd>E<kbd>. [#4222] (https://github.com/JabRef/jabref/issues/4222)
- We added a new keyboard shortcut so that the entry editor could be closed by <kbd>Ctrl</kbd> + <kbd>E</kbd>. [#4222] (https://github.com/JabRef/jabref/issues/4222)
- We added an option in the preference dialog box, that allows user to pick the dark or light theme option. [#4130] (https://github.com/JabRef/jabref/issues/4130)
- We updated updated the Related Articles tab to accept JSON from the new version of the Mr. DLib service
- We added an option in the preference dialog box that allows user to choose behavior after dragging and dropping files in Entry Editor. [#4356](https://github.com/JabRef/jabref/issues/4356)
- We added the ability to have an export preference where previously "File"-->"Export"/"Export selected entries" would not save the user's preference[#4495](https://github.com/JabRef/jabref/issues/4495)



Expand All @@ -58,7 +69,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where the custom file column were sorted incorrectly. https://github.com/JabRef/jabref/issues/3119
- We fixed an issues where the entry losses focus when a field is edited and at the same time used for sorting. https://github.com/JabRef/jabref/issues/3373
- We fixed an issue where the menu on Mac OS was not displayed in the usual Mac-specific way. https://github.com/JabRef/jabref/issues/3146
- We improved the integrity check for page numbers. [#4113](https://github.com/JabRef/jabref/issues/4113) and [feature request in the forum](http://discourse.jabref.org/t/pages-field-allow-use-of-en-dash/1199)
- We fixed an issue where the order of fields in customized entry types was not saved correctly. [#4033](http://github.com/JabRef/jabref/issues/4033)
- We fixed an issue where renaming a group did not change the group name in the interface. [#3189](https://github.com/JabRef/jabref/issues/3189)
- We fixed an issue where the groups tree of the last database was still shown even after the database was already closed.
- We fixed an issue where the "Open file dialog" may disappear behind other windows. https://github.com/JabRef/jabref/issues/3410
- We fixed an issue where the number of entries matched was not updated correctly upon adding or removing an entry. [#3537](https://github.com/JabRef/jabref/issues/3537)
Expand All @@ -76,8 +89,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where the list of XMP Exclusion fields in the preferences was not be saved [#4072](https://github.com/JabRef/jabref/issues/4072)
- We fixed an issue where the ArXiv Fetcher did not support HTTP URLs [koppor#328](https://github.com/koppor/jabref/issues/328)
- We fixed an issue where only one PDF file could be imported [#4422](https://github.com/JabRef/jabref/issues/4422)


- We fixed an issue where "Move to group" would always move the first entry in the library and not the selected [#4414](https://github.com/JabRef/jabref/issues/4414)
- We fixed an issue where an older dialog appears when downloading full texts from the quality menu. [#4489](https://github.com/JabRef/jabref/issues/4489)



Expand Down
39 changes: 20 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ dependencies {
compile 'com.jgoodies:jgoodies-common:1.8.1'
compile 'com.jgoodies:jgoodies-forms:1.9.0'

compile 'org.apache.pdfbox:pdfbox:2.0.12'
compile 'org.apache.pdfbox:fontbox:2.0.12'
compile 'org.apache.pdfbox:pdfbox:2.0.13'
compile 'org.apache.pdfbox:fontbox:2.0.13'
compile 'org.apache.pdfbox:xmpbox:2.0.12'

// required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635
Expand All @@ -110,30 +110,30 @@ dependencies {
compile "org.libreoffice:ridl:5.4.2"
compile "org.libreoffice:unoil:5.4.2"

compile 'io.github.java-diff-utils:java-diff-utils:2.2.0'
compile 'io.github.java-diff-utils:java-diff-utils:4.0'
compile 'info.debatty:java-string-similarity:1.1.0'

antlr3 'org.antlr:antlr:3.5.2'
compile 'org.antlr:antlr-runtime:3.5.2'

antlr4 'org.antlr:antlr4:4.7.1'
compile 'org.antlr:antlr4-runtime:4.7.1'
antlr4 'org.antlr:antlr4:4.7.2'
compile 'org.antlr:antlr4-runtime:4.7.2'

compile 'mysql:mysql-connector-java:8.0.13'

compile 'org.postgresql:postgresql:42.2.5'

compile 'net.java.dev.glazedlists:glazedlists_java15:1.9.1'

compile 'com.google.guava:guava:27.0-jre'
compile 'com.google.guava:guava:27.0.1-jre'

// JavaFX stuff
compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-4'
compile 'de.saxsys:mvvmfx-validation:1.7.0'
compile 'de.saxsys:mvvmfx:1.7.0'
compile 'org.fxmisc.easybind:easybind:1.0.3'
compile 'org.fxmisc.flowless:flowless:0.6.1'
compile 'org.fxmisc.richtext:richtextfx:0.9.1'
compile 'org.fxmisc.richtext:richtextfx:0.9.2'
compile 'com.sibvisions.external.jvxfx:dndtabpane:0.1'
compile 'javax.inject:javax.inject:1'
compile 'com.jfoenix:jfoenix:8.0.7'
Expand All @@ -157,29 +157,30 @@ dependencies {

errorproneJavac 'com.google.errorprone:javac:1.8.0-u20'

compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.2.0'
compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.2.0'
compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.3.0'
compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.3.0'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.2'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.2'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.2'
testCompile 'org.junit.platform:junit-platform-launcher:1.3.2'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.3.1'
testCompile 'org.junit.platform:junit-platform-launcher:1.3.1'
testCompile 'org.junit-pioneer:junit-pioneer:0.3.0'
testRuntime 'org.apache.logging.log4j:log4j-core:2.11.1'
testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.1'
testCompile 'org.mockito:mockito-core:2.23.0'
testCompile 'com.github.tomakehurst:wiremock:2.19.0'
testCompile 'org.mockito:mockito-core:2.23.4'
testCompile 'com.github.tomakehurst:wiremock:2.20.0'
testCompile 'org.assertj:assertj-swing-junit:3.8.0'
testCompile 'org.reflections:reflections:0.9.11'
testCompile 'org.xmlunit:xmlunit-core:2.6.2'
testCompile 'org.xmlunit:xmlunit-matchers:2.6.2'
testCompile 'com.tngtech.archunit:archunit-junit5-api:0.9.1'
testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.9.1'
testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.9.3'
testCompile 'com.tngtech.archunit:archunit-junit5-api:0.9.3'
testCompile "org.testfx:testfx-core:4.0.+"
testCompile "org.testfx:testfx-junit5:4.0.+"

checkstyle 'com.puppycrawl.tools:checkstyle:8.14'
checkstyle 'com.puppycrawl.tools:checkstyle:8.15'
}

jacoco {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/jabref/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.prefs.BackingStoreException;

Expand Down Expand Up @@ -459,8 +458,7 @@ private void importPreferences() {
Globals.prefs.importPreferences(cli.getPreferencesImport());
EntryTypes.loadCustomEntryTypes(Globals.prefs.loadCustomEntryTypes(BibDatabaseMode.BIBTEX),
Globals.prefs.loadCustomEntryTypes(BibDatabaseMode.BIBLATEX));
Map<String, TemplateExporter> customExporters = Globals.prefs.customExports.getCustomExportFormats(Globals.prefs,
Globals.journalAbbreviationLoader);
List<TemplateExporter> customExporters = Globals.prefs.getCustomExportFormats(Globals.journalAbbreviationLoader);
LayoutFormatterPreferences layoutPreferences = Globals.prefs
.getLayoutFormatterPreferences(Globals.journalAbbreviationLoader);
SavePreferences savePreferences = Globals.prefs.loadForExportFromPreferences();
Expand Down
21 changes: 20 additions & 1 deletion src/main/java/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@
.check-box > .box,
.menu-button,
.choice-box,
.color-picker.split-button > .color-picker-label,
.combo-box-base,
.combo-box-base:editable > .arrow-button {
-fx-background-color: transparent;
Expand Down Expand Up @@ -956,3 +955,23 @@ We want to have a look that matches our icons in the tool-bar */
.progress-bar > .track {
-fx-background-color: -jr-accent;
}

.jfx-color-picker:armed,
.jfx-color-picker:hover,
.jfx-color-picker:focused,
.jfx-color-picker {
-fx-background-color: transparent, transparent, transparent, transparent;
-fx-background-radius: 0px;
-fx-background-insets: 0px;
-fx-effect: null;
}

.color-palette {
-fx-background-color: -fx-background;
-fx-background-radius: 0px;
-fx-background-insets: 0px;
}

.color-palette-region .button {
-fx-border-width: 0px;
}
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void output(String s) {
}

private void setupActions() {
SaveDatabaseAction saveAction = new SaveDatabaseAction(this);
SaveDatabaseAction saveAction = new SaveDatabaseAction(this, Globals.prefs);
CleanupAction cleanUpAction = new CleanupAction(this, Globals.prefs);

actions.put(Actions.UNDO, undoAction);
Expand Down Expand Up @@ -429,7 +429,7 @@ private void setupActions() {
actions.put(Actions.REMOVE_FROM_GROUP, new GroupAddRemoveDialog(this, false, false));
actions.put(Actions.MOVE_TO_GROUP, new GroupAddRemoveDialog(this, true, true));

actions.put(Actions.DOWNLOAD_FULL_TEXT, new FindFullTextAction(frame.getDialogService(), this));
actions.put(Actions.DOWNLOAD_FULL_TEXT, new FindFullTextAction(this)::execute);
}

/**
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,6 @@ private void tearDownJabRef(List<String> filenames) {
}

fileHistory.storeHistory();
prefs.customExports.store(Globals.prefs);
prefs.customImports.store();

prefs.flush();

// dispose all windows, even if they are not displayed anymore
Expand Down Expand Up @@ -928,7 +925,7 @@ private MenuBar createMenu() {

factory.createMenuItem(StandardActions.SETUP_GENERAL_FIELDS, new SetupGeneralFieldsAction()),
factory.createMenuItem(StandardActions.MANAGE_CUSTOM_IMPORTS, new ManageCustomImportsAction(this)),
factory.createMenuItem(StandardActions.MANAGE_CUSTOM_EXPORTS, new ManageCustomExportsAction(this)),
factory.createMenuItem(StandardActions.MANAGE_CUSTOM_EXPORTS, new ManageCustomExportsAction()),
factory.createMenuItem(StandardActions.MANAGE_EXTERNAL_FILETYPES, new EditExternalFileTypesAction()),
factory.createMenuItem(StandardActions.MANAGE_JOURNALS, new ManageJournalsAction()),
factory.createMenuItem(StandardActions.CUSTOMIZE_KEYBINDING, new CustomizeKeyBindingAction()),
Expand Down Expand Up @@ -1335,7 +1332,7 @@ private boolean confirmClose(BasePanel panel) {
if (response.isPresent() && response.get().equals(saveChanges)) {
// The user wants to save.
try {
SaveDatabaseAction saveAction = new SaveDatabaseAction(panel);
SaveDatabaseAction saveAction = new SaveDatabaseAction(panel, Globals.prefs);
if (!saveAction.save()) {
// The action was either canceled or unsuccessful.
output(Localization.lang("Unable to save library"));
Expand Down
19 changes: 17 additions & 2 deletions src/main/java/org/jabref/gui/PreviewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
import com.google.common.eventbus.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

/**
* Displays an BibEntry using the given layout format.
Expand Down Expand Up @@ -351,7 +354,19 @@ public void close() {
}

private void copyPreviewToClipBoard() {
String previewContent = (String) previewView.getEngine().executeScript("document.documentElement.outerHTML");
clipBoardManager.setContent(previewContent);
StringBuilder previewStringContent = new StringBuilder();
Document document = previewView.getEngine().getDocument();
NodeList nodeList = document.getElementsByTagName("*");

for (int i = 0; i < nodeList.getLength(); i++) {
Element element = (Element) nodeList.item(i);
previewStringContent.append(element.getNodeValue()).append("\n");
}

ClipboardContent content = new ClipboardContent();
content.putString(previewStringContent.toString());
content.putHtml((String) previewView.getEngine().executeScript("document.documentElement.outerHTML"));

clipBoardManager.setContent(content);
}
}
49 changes: 23 additions & 26 deletions src/main/java/org/jabref/gui/actions/CleanupAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableFieldChange;
import org.jabref.gui.util.BackgroundTask;
import org.jabref.gui.util.DefaultTaskExecutor;
import org.jabref.logic.cleanup.CleanupPreset;
import org.jabref.logic.cleanup.CleanupWorker;
import org.jabref.logic.l10n.Localization;
Expand All @@ -23,11 +22,6 @@ public class CleanupAction implements BaseAction {
private final BasePanel panel;
private final DialogService dialogService;

/**
* Global variable to count unsuccessful renames
*/
private int unsuccessfulRenames;

private boolean isCanceled;
private int modifiedEntriesCount;
private final JabRefPreferences preferences;
Expand All @@ -44,13 +38,31 @@ public void action() {
if (isCanceled) {
return;
}
CleanupDialog cleanupDialog = new CleanupDialog(panel.getBibDatabaseContext(), preferences.getCleanupPreset());
CleanupDialog cleanupDialog = new CleanupDialog(panel.getBibDatabaseContext(), preferences.getCleanupPreset(), preferences.getFilePreferences());

Optional<CleanupPreset> chosenPreset = cleanupDialog.showAndWait();
chosenPreset.ifPresent(cleanupPreset ->
BackgroundTask.wrap(() -> cleanup(cleanupPreset))
.onSuccess(x -> showResults())
.executeWith(Globals.TASK_EXECUTOR));

if (chosenPreset.isPresent()) {
if (chosenPreset.get().isRenamePDFActive() && preferences.getBoolean(JabRefPreferences.ASK_AUTO_NAMING_PDFS_AGAIN)) {
boolean confirmed = dialogService.showConfirmationDialogWithOptOutAndWait(Localization.lang("Autogenerate PDF Names"),
Localization.lang("Auto-generating PDF-Names does not support undo. Continue?"),
Localization.lang("Autogenerate PDF Names"),
Localization.lang("Cancel"),
Localization.lang("Disable this confirmation dialog"),
optOut -> Globals.prefs.putBoolean(JabRefPreferences.ASK_AUTO_NAMING_PDFS_AGAIN, !optOut));

if (!confirmed) {
isCanceled = true;
return;
}
}

preferences.setCleanupPreset(chosenPreset.get());

BackgroundTask.wrap(() -> cleanup(chosenPreset.get()))
.onSuccess(result -> showResults())
.executeWith(Globals.TASK_EXECUTOR);
}
}

public void init() {
Expand Down Expand Up @@ -111,21 +123,6 @@ private void showResults() {
private void cleanup(CleanupPreset cleanupPreset) {
preferences.setCleanupPreset(cleanupPreset);

if (cleanupPreset.isRenamePDF() && preferences.getBoolean(JabRefPreferences.ASK_AUTO_NAMING_PDFS_AGAIN)) {

boolean confirmed = DefaultTaskExecutor.runInJavaFXThread(() -> dialogService.showConfirmationDialogWithOptOutAndWait(Localization.lang("Autogenerate PDF Names"),
Localization.lang("Auto-generating PDF-Names does not support undo. Continue?"),
Localization.lang("Autogenerate PDF Names"),
Localization.lang("Cancel"),
Localization.lang("Disable this confirmation dialog"),
optOut -> Globals.prefs.putBoolean(JabRefPreferences.ASK_AUTO_NAMING_PDFS_AGAIN, !optOut)));

if (!confirmed) {
isCanceled = true;
return;
}
}

for (BibEntry entry : panel.getSelectedEntries()) {
// undo granularity is on entry level
NamedCompound ce = new NamedCompound(Localization.lang("Cleanup entry"));
Expand Down
Loading

0 comments on commit 928fd8e

Please sign in to comment.