diff --git a/src/kintsugi3d/builder/core/IBRRequestManager.java b/src/kintsugi3d/builder/core/IBRRequestManager.java index 98b49a92..95bc57ac 100644 --- a/src/kintsugi3d/builder/core/IBRRequestManager.java +++ b/src/kintsugi3d/builder/core/IBRRequestManager.java @@ -14,9 +14,10 @@ import java.util.LinkedList; import java.util.Queue; +import javafx.scene.control.*; +import kintsugi3d.builder.javafx.controllers.menubar.MenubarController; import kintsugi3d.gl.interactive.GraphicsRequest; import javafx.application.Platform; -import javafx.scene.control.Alert; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import kintsugi3d.gl.core.Context; @@ -125,7 +126,17 @@ public synchronized void addIBRRequest(ObservableIBRRequest request) log.error("Error occurred while executing request:", e); Platform.runLater(() -> { - new Alert(Alert.AlertType.NONE, "An error occurred processing request. Processing has stopped.\nCheck the log for more info.").show(); + ButtonType ok = new ButtonType("OK", ButtonBar.ButtonData.CANCEL_CLOSE); + ButtonType showLog = new ButtonType("Show Log", ButtonBar.ButtonData.YES); + Alert alert = new Alert(Alert.AlertType.NONE, + "An error occurred processing request. Processing has stopped\nSee the log for more info.", + ok, showLog); + + ((ButtonBase) alert.getDialogPane().lookupButton(showLog)).setOnAction(event -> { + // Use the menubar's console open function to prevent 2 console windows from appearing + MenubarController.getInstance().help_console(); + }); + alert.show(); }); } } diff --git a/src/kintsugi3d/builder/javafx/ProjectIO.java b/src/kintsugi3d/builder/javafx/ProjectIO.java index 1dad3cee..c2fd1e70 100644 --- a/src/kintsugi3d/builder/javafx/ProjectIO.java +++ b/src/kintsugi3d/builder/javafx/ProjectIO.java @@ -153,7 +153,7 @@ private static void handleException(String message, Throwable e) log.error("{}:", message, e); Platform.runLater(() -> { - ButtonType ok = new ButtonType("OK", ButtonBar.ButtonData.OK_DONE); + ButtonType ok = new ButtonType("OK", ButtonBar.ButtonData.CANCEL_CLOSE); ButtonType showLog = new ButtonType("Show Log", ButtonBar.ButtonData.YES); Alert alert = new Alert(Alert.AlertType.NONE, message + "\nSee the log for more info.", ok, showLog); ((ButtonBase) alert.getDialogPane().lookupButton(showLog)).setOnAction(event -> { diff --git a/src/kintsugi3d/builder/javafx/controllers/menubar/ChunkViewerController.java b/src/kintsugi3d/builder/javafx/controllers/menubar/ChunkViewerController.java index d5095c83..6bc0d6c6 100644 --- a/src/kintsugi3d/builder/javafx/controllers/menubar/ChunkViewerController.java +++ b/src/kintsugi3d/builder/javafx/controllers/menubar/ChunkViewerController.java @@ -289,7 +289,9 @@ public void submitChunk(){ // If no chunk is chosen somehow, prompt user to select a chunk. if (metashapeObjectChunk == null) { // Create a popup telling user to choose a chunk. - Alert alert = new Alert(Alert.AlertType.NONE); + ButtonType ok = new ButtonType("OK", ButtonBar.ButtonData.CANCEL_CLOSE); + + Alert alert = new Alert(Alert.AlertType.NONE, "", ok); alert.setTitle("Error"); alert.setHeaderText("No chunk selected"); alert.setContentText("Please choose a chunk to continue."); diff --git a/src/kintsugi3d/builder/javafx/controllers/menubar/createnewproject/MetashapeImportController.java b/src/kintsugi3d/builder/javafx/controllers/menubar/createnewproject/MetashapeImportController.java index c1de7d7f..38b6b5c9 100644 --- a/src/kintsugi3d/builder/javafx/controllers/menubar/createnewproject/MetashapeImportController.java +++ b/src/kintsugi3d/builder/javafx/controllers/menubar/createnewproject/MetashapeImportController.java @@ -247,7 +247,7 @@ private void showNoModelsAlert() { alertShown = true; Platform.runLater(() -> { - ButtonType ok = new ButtonType("OK", ButtonBar.ButtonData.OK_DONE); + ButtonType ok = new ButtonType("OK", ButtonBar.ButtonData.CANCEL_CLOSE); ButtonType openCustomProj = new ButtonType("Create Custom Project", ButtonBar.ButtonData.YES); Alert alert = new Alert(Alert.AlertType.NONE,"Please select another chunk or create a custom project.", ok, openCustomProj); diff --git a/src/kintsugi3d/builder/javafx/controllers/menubar/systemsettings/SystemMemoryController.java b/src/kintsugi3d/builder/javafx/controllers/menubar/systemsettings/SystemMemoryController.java index e08ae1fb..12688b64 100644 --- a/src/kintsugi3d/builder/javafx/controllers/menubar/systemsettings/SystemMemoryController.java +++ b/src/kintsugi3d/builder/javafx/controllers/menubar/systemsettings/SystemMemoryController.java @@ -60,6 +60,7 @@ public void button_Apply() configuration.setEnableMaxMemory(maxMemCheckbox.isSelected()); configuration.setMaxMemoryMb((Integer)maxMemSpinner.getValue()); + ButtonType ok = new ButtonType("OK", ButtonBar.ButtonData.CANCEL_CLOSE); try { try @@ -76,14 +77,14 @@ public void button_Apply() catch (IOException e) { log.error("Failed to write to launch4j configuration file", e); - Alert alert = new Alert(Alert.AlertType.NONE); + Alert alert = new Alert(Alert.AlertType.NONE, "", ok); alert.setTitle("Kintsugi 3D Builder"); alert.setHeaderText("Writing failed"); alert.setContentText("Kintsugi 3D Builder failed to write to the configuration file. Try restarting Kintsugi 3D Builder as administrator and try again."); alert.show(); } - Alert alert = new Alert(Alert.AlertType.INFORMATION); + Alert alert = new Alert(Alert.AlertType.INFORMATION, "", ok); alert.setTitle("Kintsugi 3D Builder"); alert.setHeaderText("Restart Required"); alert.setContentText("A restart of Kintsugi 3D Builder is needed for changes to take effect.");