Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ooPanel
Browse files Browse the repository at this point in the history
* upstream/master:
  Add docbook 5 support (#4319)
  Bump java-diff-utils from 2.2.0 to 4.0 (#4507)
  3189 fix group renaming (#4470)
  Create test (#4505)
  Bump archunit-junit5-engine from 0.9.2 to 0.9.3 (#4503)
  Bump archunit-junit5-api from 0.9.2 to 0.9.3 (#4504)
  Bump mockito-core from 2.23.0 to 2.23.4 (#4502)
  Bump guava from 27.0-jre to 27.0.1-jre (#4499)
  Improve page checker (#4498)
  Add color picker to groups dialog (#4492)
  Fix kbd XML closing tag
  • Loading branch information
Siedlerchr committed Nov 25, 2018
2 parents 0c8a959 + 9213e3c commit 3b9d6c4
Show file tree
Hide file tree
Showing 46 changed files with 991 additions and 307 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- 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)
Expand All @@ -68,6 +68,7 @@ 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 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
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ 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'
Expand All @@ -125,7 +125,7 @@ dependencies {

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'
Expand Down Expand Up @@ -168,14 +168,14 @@ dependencies {
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 'org.mockito:mockito-core:2.23.4'
testCompile 'com.github.tomakehurst:wiremock:2.19.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.2'
testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.9.2'
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.+"

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;
}
2 changes: 1 addition & 1 deletion 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
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,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
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/dialogs/AutosaveUIManager.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jabref.gui.dialogs;

import org.jabref.Globals;
import org.jabref.gui.BasePanel;
import org.jabref.gui.exporter.SaveDatabaseAction;
import org.jabref.model.database.event.AutosaveEvent;
Expand All @@ -25,7 +26,7 @@ public AutosaveUIManager(BasePanel panel) {
@Subscribe
public void listen(@SuppressWarnings("unused") AutosaveEvent event) {
try {
new SaveDatabaseAction(panel).save();
new SaveDatabaseAction(panel, Globals.prefs).save();
} catch (Throwable e) {
LOGGER.error("Problem occured while saving.", e);
}
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import javafx.scene.layout.VBox;
import javafx.scene.text.Text;

import org.jabref.Globals;
import org.jabref.gui.BasePanel;
import org.jabref.gui.DialogService;
import org.jabref.gui.JabRefFrame;
Expand Down Expand Up @@ -53,16 +52,18 @@ public class SaveDatabaseAction {
private final BasePanel panel;
private final JabRefFrame frame;
private final DialogService dialogService;
private final JabRefPreferences prefs;

public SaveDatabaseAction(BasePanel panel) {
public SaveDatabaseAction(BasePanel panel, JabRefPreferences prefs) {
this.panel = panel;
this.frame = panel.frame();
this.dialogService = frame.getDialogService();
this.prefs = prefs;
}

private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SavePreferences.DatabaseSaveType saveType) throws SaveException {
try {
SavePreferences preferences = Globals.prefs.loadForSaveFromPreferences()
SavePreferences preferences = prefs.loadForSaveFromPreferences()
.withEncoding(encoding)
.withSaveType(saveType);

Expand Down Expand Up @@ -124,7 +125,7 @@ private boolean doSave() {
panel.getBibDatabaseContext()
.getMetaData()
.getEncoding()
.orElse(Globals.prefs.getDefaultEncoding()),
.orElse(prefs.getDefaultEncoding()),
SavePreferences.DatabaseSaveType.ALL);

if (success) {
Expand Down Expand Up @@ -182,10 +183,10 @@ private Optional<Path> getSavePath() {
FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder()
.addExtensionFilter(StandardFileType.BIBTEX_DB)
.withDefaultExtension(StandardFileType.BIBTEX_DB)
.withInitialDirectory(Globals.prefs.get(JabRefPreferences.WORKING_DIRECTORY))
.withInitialDirectory(prefs.get(JabRefPreferences.WORKING_DIRECTORY))
.build();
Optional<Path> selectedPath = dialogService.showFileSaveDialog(fileDialogConfiguration);
selectedPath.ifPresent(path -> Globals.prefs.setWorkingDir(path.getParent()));
selectedPath.ifPresent(path -> prefs.setWorkingDir(path.getParent()));
return selectedPath;
}

Expand Down Expand Up @@ -228,7 +229,7 @@ public void saveAs(Path file) {
private boolean readyForAutosave(BibDatabaseContext context) {
return ((context.getLocation() == DatabaseLocation.SHARED) ||
((context.getLocation() == DatabaseLocation.LOCAL)
&& Globals.prefs.getBoolean(JabRefPreferences.LOCAL_AUTO_SAVE)))
&& prefs.getBoolean(JabRefPreferences.LOCAL_AUTO_SAVE)))
&&
context.getDatabasePath().isPresent();
}
Expand All @@ -240,7 +241,7 @@ private boolean readyForBackup(BibDatabaseContext context) {
public void saveSelectedAsPlain() {
getSavePath().ifPresent(path -> {
try {
saveDatabase(path, true, Globals.prefs.getDefaultEncoding(), SavePreferences.DatabaseSaveType.PLAIN_BIBTEX);
saveDatabase(path, true, prefs.getDefaultEncoding(), SavePreferences.DatabaseSaveType.PLAIN_BIBTEX);
frame.getFileHistory().newFile(path);
frame.output(Localization.lang("Saved selected to '%0'.", path.toString()));
} catch (SaveException ex) {
Expand Down
Loading

0 comments on commit 3b9d6c4

Please sign in to comment.