Added a Cancel button to the graceful shutdown-dialog. Fixes issue #771.

This commit is contained in:
jellemdekker
2018-12-22 12:53:42 +01:00
parent 3f15352ebf
commit 69b1bf5a26

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 {