Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into docbookfive
Browse files Browse the repository at this point in the history
* upstream/master:
  Change location of some fields in the entry editor (#4448)
  Bump applicationinsights-core from 2.2.0 to 2.2.1 (#4488)
  Added feature to add server timezone when connecting to shared database (#4483)
  Bump applicationinsights-logging-log4j2 from 2.2.0 to 2.2.1 (#4487)
  fix save button
  Update archunit from 0.9.1 -> 0.9.2
  Fix move to group always moves first entry (#4457)
  Add eprint cleanup (#4445)
  respect preference state (#4468)
  Set auto-update checkbox enable/disable when reading preferences (#4446)
  Improve MathSciNet fetcher and add ISBN fetcher to entry editor toolbar  (#4444)
  New translations JabRef_en.properties (German) (#4455)
  New Crowdin translations (#4454)
  Fix error in l10n file: Toogle -> Toggle (#4453)
  Remove depandabot
  • Loading branch information
Siedlerchr committed Nov 17, 2018
2 parents 020a03f + 2953849 commit c169517
Show file tree
Hide file tree
Showing 58 changed files with 4,371 additions and 2,403 deletions.
12 changes: 11 additions & 1 deletion 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,6 +36,8 @@ 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)
Expand Down Expand Up @@ -76,7 +86,7 @@ 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)



Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Build Status](https://travis-ci.org/JabRef/jabref.svg?branch=master)](https://travis-ci.org/JabRef/jabref)
[![codecov.io](https://codecov.io/github/JabRef/jabref/coverage.svg?branch=master)](https://codecov.io/github/JabRef/jabref?branch=master)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=JabRef/jabref)](https://dependabot.com)
[![Donation](https://img.shields.io/badge/donate%20to-jabref-orange.svg)](https://donations.jabref.org)

JabRef is an open-source, cross-platform citation and reference management tool licensed under the [MIT license](https://tldrlegal.com/license/mit-license).
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ 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.2.1'
compile group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.2.1'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testCompile 'org.junit.jupiter:junit-jupiter-params:5.3.1'
Expand All @@ -174,8 +174,8 @@ dependencies {
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'
testCompile 'com.tngtech.archunit:archunit-junit5-api:0.9.2'
testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.9.2'
testCompile "org.testfx:testfx-core:4.0.+"
testCompile "org.testfx:testfx-junit5:4.0.+"

Expand Down
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
5 changes: 3 additions & 2 deletions src/main/java/org/jabref/gui/cleanup/CleanupDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
import org.jabref.logic.cleanup.CleanupPreset;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.metadata.FilePreferences;

public class CleanupDialog extends BaseDialog<CleanupPreset> {

public CleanupDialog(BibDatabaseContext databaseContext, CleanupPreset initialPreset) {
public CleanupDialog(BibDatabaseContext databaseContext, CleanupPreset initialPreset, FilePreferences filePreferences) {
setTitle(Localization.lang("Cleanup entries"));
getDialogPane().setPrefSize(600, 600);
getDialogPane().getButtonTypes().setAll(ButtonType.OK, ButtonType.CANCEL);

CleanupPresetPanel presetPanel = new CleanupPresetPanel(databaseContext, initialPreset);
CleanupPresetPanel presetPanel = new CleanupPresetPanel(databaseContext, initialPreset, filePreferences);
getDialogPane().setContent(presetPanel);
setResultConverter(button -> {
if (button == ButtonType.OK) {
Expand Down
33 changes: 33 additions & 0 deletions src/main/java/org/jabref/gui/cleanup/CleanupPresetPanel.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>
<fx:root xmlns:fx="http://javafx.com/fxml/1" spacing="10.0" type="VBox" xmlns="http://javafx.com/javafx/8.0.121"
fx:controller="org.jabref.gui.cleanup.CleanupPresetPanel">

<CheckBox fx:id="cleanUpDOI" text="%Move DOIs from note and URL field to DOI field and remove http prefix"/>
<CheckBox fx:id="cleanUpEprint"
text="%Move preprint information from 'URL' and 'journal' field to the 'eprint' field"/>
<CheckBox fx:id="cleanUpISSN" text="%Reformat ISSN"/>
<CheckBox fx:id="cleanUpUpgradeExternalLinks"/>
<CheckBox fx:id="cleanUpMovePDF"/>
<CheckBox fx:id="cleanUpMakePathsRelative" text="%Make paths of linked files relative (if possible)"/>
<CheckBox fx:id="cleanUpRenamePDF" text="%Rename PDFs to given filename format pattern"/>
<VBox spacing="5.0">
<Label fx:id="cleanupRenamePDFLabel"/>
<CheckBox fx:id="cleanUpRenamePDFonlyRelativePaths" text="%Rename only PDFs having a relative path"/>
<VBox.margin>
<Insets left="40.0"/>
</VBox.margin>
</VBox>

<CheckBox fx:id="cleanUpBiblatex"
text="%Convert to biblatex format (for example, move the value of the 'journal' field to 'journaltitle')"/>
<CheckBox fx:id="cleanUpBibtex"
text="%Convert to BibTeX format (for example, move the value of the 'journaltitle' field to 'journal')"/>

<VBox fx:id="formatterContainer"/>

</fx:root>
Loading

0 comments on commit c169517

Please sign in to comment.