-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into fixpreviewcopy
* 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
Showing
24 changed files
with
178 additions
and
670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/org/jabref/gui/WaitForSaveFinishedDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.