From 8b475809b9c3ffc157cd4bcc2e15c2b503791463 Mon Sep 17 00:00:00 2001 From: tobias <tobias.ullerich@icloud.com> Date: Tue, 6 Sep 2016 11:08:34 +0200 Subject: [PATCH] Fixed Dialogs --- PlayWall/src/de/tobias/playpad/PlayPadMain.java | 9 +++++---- .../playpad/viewcontroller/main/MainViewController.java | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/PlayWall/src/de/tobias/playpad/PlayPadMain.java b/PlayWall/src/de/tobias/playpad/PlayPadMain.java index 924c2c8f..517b73e1 100644 --- a/PlayWall/src/de/tobias/playpad/PlayPadMain.java +++ b/PlayWall/src/de/tobias/playpad/PlayPadMain.java @@ -31,7 +31,7 @@ import de.tobias.utils.util.OS.OSType; import de.tobias.utils.util.Worker; import javafx.application.Application; import javafx.application.Platform; -import javafx.scene.control.ButtonType; +import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.image.Image; import javafx.stage.Stage; import javafx.stage.Window; @@ -60,7 +60,7 @@ public class PlayPadMain extends Application implements LocalizationDelegate { private static PlayPadImpl impl; private static PlayPadUpdater updater; - + public static ResourceBundle getUiResourceBundle() { return uiResourceBundle; } @@ -108,7 +108,8 @@ public class PlayPadMain extends Application implements LocalizationDelegate { try { Image stageIcon = new Image(iconPath); PlayPadMain.stageIcon = Optional.of(stageIcon); - } catch (Exception e) {} + } catch (Exception e) { + } /* * Setup @@ -165,7 +166,7 @@ public class PlayPadMain extends Application implements LocalizationDelegate { Platform.runLater(() -> { AutoUpdateDialog autoUpdateDialog = new AutoUpdateDialog(owner); - autoUpdateDialog.showAndWait().filter(item -> item == ButtonType.APPLY).ifPresent(result -> + autoUpdateDialog.showAndWait().filter(item -> item.getButtonData() == ButtonData.APPLY).ifPresent(result -> { try { Updates.startUpdate(); diff --git a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java index c9a0df0f..49998376 100644 --- a/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java +++ b/PlayWall/src/de/tobias/playpad/viewcontroller/main/MainViewController.java @@ -52,6 +52,7 @@ import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; +import javafx.scene.control.ButtonBar.ButtonData; import javafx.scene.control.ButtonType; import javafx.scene.input.KeyCombination; import javafx.scene.input.KeyEvent; @@ -308,10 +309,10 @@ public class MainViewController extends ViewController implements IMainViewContr if (result.isPresent()) { globalSettings.setIgnoreSaveDialog(alert.isSelected()); ButtonType buttonType = result.get(); - if (buttonType == ButtonType.YES) { + if (buttonType.getButtonData() == ButtonData.YES) { // Projekt Speichern saveProject(); - } else if (buttonType == ButtonType.CANCEL) { + } else if (buttonType.getButtonData() == ButtonData.CANCEL_CLOSE) { return false; } } -- GitLab