Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fixpreviewcopy
Browse files Browse the repository at this point in the history
* upstream/master:
  Fix default import format pattern (#4731)
  Add key bindings (#4732)
  Convert "wait for save" dialog to JavaFX (#4697)
  Adding additional modifiers to be used in bibtex key generator
  Adding "von" part to Author's last name when exporting to MS Office 2007 (#4725)
  Bump mockito-core from 2.24.5 to 2.25.0 (#4723)
  remove obsolete localization strings fix checkstyle
  fix build
  cleanup
  convert file chooser in preferences
  remove unused swing stuff convert help  buttons
  • Loading branch information
Siedlerchr committed Mar 8, 2019
2 parents 02b7876 + 4d1738d commit 97819d8
Show file tree
Hide file tree
Showing 24 changed files with 178 additions and 670 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We added the ability change the column widths directly in the main table. [#4546](https://github.com/JabRef/jabref/issues/4546)
- We added the ability to execute default action in dialog by using with <kbd>Ctrl</kbd> + <kbd>Enter</kbd> combination [#4496](https://github.com/JabRef/jabref/issues/4496)
- We grouped and reordered the Main Menu (File, Edit, Library, Quality, Tools, and View tabs & icons). [#4666](https://github.com/JabRef/jabref/issues/4666) [#4667](https://github.com/JabRef/jabref/issues/4667) [#4668](https://github.com/JabRef/jabref/issues/4668) [#4669](https://github.com/JabRef/jabref/issues/4669) [#4670](https://github.com/JabRef/jabref/issues/4670) [#4671](https://github.com/JabRef/jabref/issues/4671) [#4672](https://github.com/JabRef/jabref/issues/4672) [#4673](https://github.com/JabRef/jabref/issues/4673)

- We added additional modifiers (capitalize, titlecase and sentencecase) to the Bibtex key generator. [#1506](https://github.com/JabRef/jabref/issues/1506)



Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ dependencies {

testRuntime 'org.apache.logging.log4j:log4j-core:2.11.1'
testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.2'
testCompile 'org.mockito:mockito-core:2.24.5'
testCompile 'org.mockito:mockito-core:2.25.0'
testCompile 'com.github.tomakehurst:wiremock:2.21.0'
testCompile 'org.assertj:assertj-swing-junit:3.9.2'
testCompile 'org.reflections:reflections:0.9.11'
Expand Down
13 changes: 2 additions & 11 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -500,17 +500,8 @@ public boolean quit() {
context.getDatabaseFile().map(File::getAbsolutePath).ifPresent(filenames::add);
}

// Wait for save operations to finish
for (int i = 0; i < tabbedPane.getTabs().size(); i++) {
if (getBasePanelAt(i).isSaving()) {
// There is a database still being saved, so we need to wait.
WaitForSaveOperation w = new WaitForSaveOperation(this);
w.show(); // This method won't return until canceled or the save operation is done.
if (w.canceled()) {
return false; // The user clicked cancel.
}
}
}
WaitForSaveFinishedDialog waitForSaveFinishedDialog = new WaitForSaveFinishedDialog(dialogService);
waitForSaveFinishedDialog.showAndWait(getBasePanelList());

// Good bye!
tearDownJabRef(filenames);
Expand Down
43 changes: 43 additions & 0 deletions src/main/java/org/jabref/gui/WaitForSaveFinishedDialog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.jabref.gui;

import java.util.List;

import javafx.concurrent.Task;

import org.jabref.logic.l10n.Localization;

/**
* Dialog shown when closing of application needs to wait for a save operation to finish.
*/
public class WaitForSaveFinishedDialog {

private final DialogService dialogService;

public WaitForSaveFinishedDialog(DialogService dialogService) {
this.dialogService = dialogService;
}

public void showAndWait(List<BasePanel> basePanels) {
if (basePanels.stream().anyMatch(BasePanel::isSaving)) {
Task<Void> waitForSaveFinished = new Task<Void>() {
@Override
protected Void call() throws Exception {
while (basePanels.stream().anyMatch(BasePanel::isSaving)) {
if (isCancelled()) {
return null;
} else {
Thread.sleep(100);
}
}
return null;
}
};

dialogService.showProgressDialogAndWait(
Localization.lang("Please wait..."),
Localization.lang("Waiting for save operation to finish") + "...",
waitForSaveFinished
);
}
}
}
82 changes: 0 additions & 82 deletions src/main/java/org/jabref/gui/WaitForSaveOperation.java

This file was deleted.

175 changes: 0 additions & 175 deletions src/main/java/org/jabref/gui/WrapLayout.java

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/java/org/jabref/gui/actions/StandardActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public enum StandardActions implements Action {
NEW_LIBRARY_BIBLATEX(Localization.lang("New %0 library", BibDatabaseMode.BIBLATEX.getFormattedName())),
OPEN_LIBRARY(Localization.lang("Open library"), IconTheme.JabRefIcons.OPEN, KeyBinding.OPEN_DATABASE),
IMPORT(Localization.lang("Import"), IconTheme.JabRefIcons.IMPORT),
EXPORT(Localization.lang("Export"), IconTheme.JabRefIcons.EXPORT),
EXPORT(Localization.lang("Export"), IconTheme.JabRefIcons.EXPORT, KeyBinding.EXPORT),
MERGE_DATABASE(Localization.lang("Append library"), Localization.lang("Append contents from a BibTeX library into the currently viewed library")),
SAVE_LIBRARY(Localization.lang("Save library"), IconTheme.JabRefIcons.SAVE, KeyBinding.SAVE_DATABASE),
SAVE_LIBRARY_AS(Localization.lang("Save library as..."), KeyBinding.SAVE_DATABASE_AS),
Expand All @@ -74,7 +74,7 @@ public enum StandardActions implements Action {
IMPORT_INTO_NEW_LIBRARY(Localization.lang("Import into new library"), KeyBinding.IMPORT_INTO_NEW_DATABASE),
IMPORT_INTO_CURRENT_LIBRARY(Localization.lang("Import into current library"), KeyBinding.IMPORT_INTO_CURRENT_DATABASE),
EXPORT_ALL(Localization.lang("Export all entries")),
EXPORT_SELECTED(Localization.lang("Export selected entries")),
EXPORT_SELECTED(Localization.lang("Export selected entries"), KeyBinding.EXPORT_SELECTED),
CONNECT_TO_SHARED_DB(Localization.lang("Connect to shared database"), IconTheme.JabRefIcons.CONNECT_DB),
PULL_CHANGES_FROM_SHARED_DB(Localization.lang("Pull changes from shared database"), KeyBinding.PULL_CHANGES_FROM_SHARED_DATABASE),
CLOSE_LIBRARY(Localization.lang("Close library"), Localization.lang("Close the current library"), IconTheme.JabRefIcons.CLOSE, KeyBinding.CLOSE_DATABASE),
Expand Down
Loading

0 comments on commit 97819d8

Please sign in to comment.