Merge pull request #784 from jellemdekker/bugfix/771_abort_graceful_shutdown_dialog

Added a Cancel button to the graceful shutdown-dialog
This commit is contained in:
Sebastian Stenzel
2019-01-14 13:05:40 +01:00
committed by GitHub

View File

@@ -222,7 +222,7 @@ public class MainController implements ViewController {
ButtonType forceShutdownButtonType = new ButtonType(localization.getString("main.gracefulShutdown.button.forceShutdown"));
Alert gracefulShutdownDialog = DialogBuilderUtil.buildGracefulShutdownDialog(
localization.getString("main.gracefulShutdown.dialog.title"), localization.getString("main.gracefulShutdown.dialog.header"), localization.getString("main.gracefulShutdown.dialog.content"),
forceShutdownButtonType, forceShutdownButtonType, tryAgainButtonType);
forceShutdownButtonType, ButtonType.CANCEL, forceShutdownButtonType, tryAgainButtonType);
Optional<ButtonType> choice = gracefulShutdownDialog.showAndWait();
choice.ifPresent(btnType -> {
@@ -230,6 +230,8 @@ public class MainController implements ViewController {
gracefulShutdown();
} else if (forceShutdownButtonType.equals(btnType)) {
Platform.runLater(Platform::exit);
} else {
return;
}
});
} else {