Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into release-5-0-beta
Browse files Browse the repository at this point in the history
* upstream/master:
  Fix upload to GitHub artifacts (#5712)
  Try to fix csl update (#5718)
  Fix import into currently open library (#5717)
  Add throttle to AutosaveUIManager (#5680)
  Do not couple search position to sidebar width (#5716)
  fix springer fetcher tests
  Bump controlsfx from 11.0.0 to 11.0.1 (#5714)
  • Loading branch information
Siedlerchr committed Dec 8, 2019
2 parents 7c79ea9 + a86b0bf commit ef69299
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 88 deletions.
5 changes: 5 additions & 0 deletions .github/failure-csl-update
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Error while updating citation styles
labels: code-quality, dependencies
---
[Update of citation styles failed!](https://github.com/JabRef/jabref/actions?query=workflow%3A%22Refresh+Citation+Style+Language+Files%22)
10 changes: 5 additions & 5 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ jobs:
export BADASS_JLINK_JPACKAGE_HOME="${GITHUB_WORKSPACE}${{ matrix.jdk14Path }}"
./gradlew -PprojVersion="${{ steps.gitversion.outputs.AssemblySemVer }}" -PprojVersionInfo="${{ steps.gitversion.outputs.InformationalVersion }}" jpackage
shell: bash
- name: Add installer as artifact
uses: actions/upload-artifact@master
with:
name: JabRef-${{ matrix.displayName }}
path: build/distribution
- name: Package application image
run: ${{ matrix.archivePortable }}
shell: bash
Expand All @@ -115,6 +110,11 @@ jobs:
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"}
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"}
shell: pwsh
- name: Upload to GitHub workflow artifacts store
uses: actions/upload-artifact@master
with:
name: JabRef-${{ matrix.displayName }}
path: build/distribution
- name: Upload to builds.jabref.org
uses: garygrossgarten/github-action-scp@release
with:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/refresh-csl-subtrees.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v1
uses: actions/checkout@v2-beta
with:
ref: master
- name: Add csl-styles remote
run: git remote add -f csl-styles https://github.com/citation-style-language/styles.git
- name: Update csl-styles
Expand All @@ -23,3 +25,10 @@ jobs:
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Report issues
if: failure()
uses: JasonEtco/create-an-issue@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/failure-csl-update.md
4 changes: 2 additions & 2 deletions .idea/runConfigurations/JabRef_Main.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We added support to switch between biblatex and bibtex library types. [#5550](https://github.com/JabRef/jabref/issues/5550)
- We changed the save action buttons to be easier to understand. [#5565](https://github.com/JabRef/jabref/issues/5565)
- We made the columns for groups, files and uri in the main table reorderable and merged the clickable icon columns for uri, url, doi and eprint. [#5544](https://github.com/JabRef/jabref/pull/5544)
- We reduced the number of write actions performed when autosave is enabled [#5679](https://github.com/JabRef/jabref/issues/5679)

### Fixed

Expand Down Expand Up @@ -61,13 +62,15 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- The "Automatically set file links" feature now follows symbolic links. [#5664](https://github.com/JabRef/jabref/issues/5664)
- After successful import of one or multiple bib entries the main table scrolls to the first imported entry [#5383](https://github.com/JabRef/jabref/issues/5383)
- We fixed an exception which occurred when an invalid jstyle was loaded. [#5452](https://github.com/JabRef/jabref/issues/5452)
- We fixed an issue where the command line arguments `importBibtex` and `importToOpen` did not import into the currently open library, but opened a new one. [#5537](https://github.com/JabRef/jabref/issues/5537)
- We fixed an error where the preview theme did not adapt to the "Dark" mode [#5463](https://github.com/JabRef/jabref/issues/5463)
- We fixed an issue where the merge dialog showed the wrong text colour in "Dark" mode [#5516](https://github.com/JabRef/jabref/issues/5516)
- We fixed visibility issues with the scrollbar and group selection highlight in "Dark" mode, and enabled "Dark" mode for the OpenOffice preview in the style selection window. [#5522](https://github.com/JabRef/jabref/issues/5522)
- We fixed an issue where the author field was not correctly parsed during bibtex key-generation. [#5551](https://github.com/JabRef/jabref/issues/5551)
- We fixed an issue where notifications where shown during autosave. [#5555](https://github.com/JabRef/jabref/issues/5555)
- We fixed an issue where the side pane was not remembering its position. [#5615](https://github.com/JabRef/jabref/issues/5615)
- We fixed an issue where JabRef could not interact with [Oracle XE](https://www.oracle.com/de/database/technologies/appdev/xe.html) in the [shared SQL database setup](https://docs.jabref.org/collaborative-work/sqldatabase).
- We fixed an issue where the toolbar icons were hidden on smaller screens.

### Removed

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ dependencies {
compile 'org.fxmisc.richtext:richtextfx:0.10.3'
compile group: 'org.glassfish.hk2.external', name: 'jakarta.inject', version: '2.6.1'
compile 'com.jfoenix:jfoenix:9.0.9'
compile 'org.controlsfx:controlsfx:11.0.0'
compile 'org.controlsfx:controlsfx:11.0.1'

compile 'org.jsoup:jsoup:1.12.1'
compile 'com.konghq:unirest-java:3.2.00'
Expand Down
67 changes: 34 additions & 33 deletions src/main/java/org/jabref/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.io.File;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

import javafx.application.Platform;
import javafx.scene.Scene;
Expand Down Expand Up @@ -97,6 +97,13 @@ private void openDatabases() {
openLastEditedDatabases();
}

// Remove invalid databases
List<ParserResult> invalidDatabases = bibDatabases.stream()
.filter(ParserResult::isInvalid)
.collect(Collectors.toList());
failed.addAll(invalidDatabases);
bibDatabases.removeAll(invalidDatabases);

// passed file (we take the first one) should be focused
String focusedFile = bibDatabases.stream()
.findFirst()
Expand All @@ -106,40 +113,34 @@ private void openDatabases() {

// Add all bibDatabases databases to the frame:
boolean first = false;
if (!bibDatabases.isEmpty()) {
for (Iterator<ParserResult> parserResultIterator = bibDatabases.iterator(); parserResultIterator.hasNext();) {
ParserResult pr = parserResultIterator.next();
// Define focused tab
if (pr.getFile().filter(path -> path.getAbsolutePath().equals(focusedFile)).isPresent()) {
first = true;
}
for (ParserResult pr : bibDatabases) {
// Define focused tab
if (pr.getFile().filter(path -> path.getAbsolutePath().equals(focusedFile)).isPresent()) {
first = true;
}

if (pr.isInvalid()) {
failed.add(pr);
parserResultIterator.remove();
} else if (pr.getDatabase().isShared()) {
try {
new SharedDatabaseUIManager(mainFrame).openSharedDatabaseFromParserResult(pr);
} catch (SQLException | DatabaseNotSupportedException | InvalidDBMSConnectionPropertiesException |
NotASharedDatabaseException e) {
pr.getDatabaseContext().clearDatabaseFile(); // do not open the original file
pr.getDatabase().clearSharedDatabaseID();

LOGGER.error("Connection error", e);
mainFrame.getDialogService().showErrorDialogAndWait(
Localization.lang("Connection error"),
Localization.lang("A local copy will be opened."),
e);
}
toOpenTab.add(pr);
} else if (pr.toOpenTab()) {
// things to be appended to an opened tab should be done after opening all tabs
// add them to the list
toOpenTab.add(pr);
} else {
mainFrame.addParserResult(pr, first);
first = false;
if (pr.getDatabase().isShared()) {
try {
new SharedDatabaseUIManager(mainFrame).openSharedDatabaseFromParserResult(pr);
} catch (SQLException | DatabaseNotSupportedException | InvalidDBMSConnectionPropertiesException |
NotASharedDatabaseException e) {
pr.getDatabaseContext().clearDatabaseFile(); // do not open the original file
pr.getDatabase().clearSharedDatabaseID();

LOGGER.error("Connection error", e);
mainFrame.getDialogService().showErrorDialogAndWait(
Localization.lang("Connection error"),
Localization.lang("A local copy will be opened."),
e);
}
toOpenTab.add(pr);
} else if (pr.toOpenTab()) {
// things to be appended to an opened tab should be done after opening all tabs
// add them to the list
toOpenTab.add(pr);
} else {
mainFrame.addParserResult(pr, first);
first = false;
}
}

Expand Down
52 changes: 23 additions & 29 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,6 @@ public void changed(ObservableValue<? extends Boolean> observable, Boolean oldVa

EasyBind.subscribe(sidePane.visibleProperty(), visible -> {
if (visible) {
// Run SplitPane.setResizableWithParent later to avoid miscalculation during initial layouting
Platform.runLater(() -> SplitPane.setResizableWithParent(sidePane, Boolean.FALSE));
if (!splitPane.getItems().contains(sidePane)) {
splitPane.getItems().add(0, sidePane);
setDividerPosition();
Expand Down Expand Up @@ -452,6 +450,7 @@ private void setDividerPosition() {

private Node createToolbar() {
Pane leftSpacer = new Pane();
leftSpacer.setMinWidth(50);
HBox.setHgrow(leftSpacer, Priority.SOMETIMES);
Pane rightSpacer = new Pane();
HBox.setHgrow(rightSpacer, Priority.SOMETIMES);
Expand All @@ -471,9 +470,6 @@ private Node createToolbar() {
factory.createIconButton(StandardActions.SAVE_LIBRARY, new OldDatabaseCommandWrapper(Actions.SAVE, this, stateManager)),
leftSpacer
);
leftSide.setMinWidth(100);
leftSide.prefWidthProperty().bind(sidePane.widthProperty());
leftSide.maxWidthProperty().bind(sidePane.widthProperty());

final PushToApplicationAction pushToApplicationAction = getPushToApplicationsManager().getPushToApplicationAction();
final Button pushToApplicationButton = factory.createIconButton(pushToApplicationAction.getActionInformation(), pushToApplicationAction);
Expand Down Expand Up @@ -976,37 +972,35 @@ public void updateAllTabTitles() {
}

public void addTab(BasePanel basePanel, boolean raisePanel) {
DefaultTaskExecutor.runInJavaFXThread(() -> {
// add tab
Tab newTab = new Tab(basePanel.getTabTitle(), basePanel);
tabbedPane.getTabs().add(newTab);
newTab.setOnCloseRequest(event -> {
closeTab((BasePanel) newTab.getContent());
event.consume();
});
// add tab
Tab newTab = new Tab(basePanel.getTabTitle(), basePanel);
tabbedPane.getTabs().add(newTab);
newTab.setOnCloseRequest(event -> {
closeTab((BasePanel) newTab.getContent());
event.consume();
});

// update all tab titles
updateAllTabTitles();
// update all tab titles
updateAllTabTitles();

if (raisePanel) {
tabbedPane.getSelectionModel().select(newTab);
}
if (raisePanel) {
tabbedPane.getSelectionModel().select(newTab);
}

// Register undo/redo listener
basePanel.getUndoManager().registerListener(new UndoRedoEventManager());
// Register undo/redo listener
basePanel.getUndoManager().registerListener(new UndoRedoEventManager());

BibDatabaseContext context = basePanel.getBibDatabaseContext();
BibDatabaseContext context = basePanel.getBibDatabaseContext();

if (readyForAutosave(context)) {
AutosaveManager autosaver = AutosaveManager.start(context);
autosaver.registerListener(new AutosaveUIManager(basePanel));
}
if (readyForAutosave(context)) {
AutosaveManager autosaver = AutosaveManager.start(context);
autosaver.registerListener(new AutosaveUIManager(basePanel));
}

BackupManager.start(context, Globals.entryTypesManager, prefs);
BackupManager.start(context, Globals.entryTypesManager, prefs);

// Track opening
trackOpenNewDatabase(basePanel);
});
// Track opening
trackOpenNewDatabase(basePanel);
}

private void trackOpenNewDatabase(BasePanel basePanel) {
Expand Down
Loading

0 comments on commit ef69299

Please sign in to comment.