From b85b31884acb72d9d779f122657ccd7bc2504b91 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Tue, 9 Jul 2024 18:20:24 -0400 Subject: [PATCH] Rename the delete and call it for freecad files at start --- .../bowlerstudio/scripting/ScriptingFileWidget.java | 8 ++++---- .../scripting/external/BlenderExternalEditor.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/scripting/ScriptingFileWidget.java b/src/main/java/com/neuronrobotics/bowlerstudio/scripting/ScriptingFileWidget.java index d4b2e088d..dd7e6abd8 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/scripting/ScriptingFileWidget.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/scripting/ScriptingFileWidget.java @@ -317,8 +317,8 @@ private void convertResults(String fileType) throws Exception { if(freecad) { String file = fileNameBox.getText()+"."+fileType; File newFile = ScriptingEngine.fileFromGit(url, file); - if(newFile.exists() && !freecad) { - if(DeleteExisting(file)) { + if(newFile.exists() ) { + if(askToDeleteFile(file)) { newFile.delete(); } } @@ -337,7 +337,7 @@ private void convertResults(String fileType) throws Exception { try { File newFile = ScriptingEngine.fileFromGit(url, file); if(newFile.exists() && !freecad) { - if(DeleteExisting(file)) { + if(askToDeleteFile(file)) { newFile.delete(); }else continue; @@ -361,7 +361,7 @@ private void convertResults(String fileType) throws Exception { } } - public static boolean DeleteExisting(String name) { + public static boolean askToDeleteFile(String name) { CompletableFuture future = new CompletableFuture<>(); Platform.runLater(() -> { diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/scripting/external/BlenderExternalEditor.java b/src/main/java/com/neuronrobotics/bowlerstudio/scripting/external/BlenderExternalEditor.java index d7d52256e..980c87008 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/scripting/external/BlenderExternalEditor.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/scripting/external/BlenderExternalEditor.java @@ -46,7 +46,7 @@ public void launch(File file, Button advanced) { if(filename.toLowerCase().endsWith(".stl")) { File blenderfile = new File(dir.getAbsolutePath()+delim()+file.getName()+".blend"); - if(ScriptingFileWidget.DeleteExisting(blenderfile.getName())) { + if(ScriptingFileWidget.askToDeleteFile(blenderfile.getName())) { blenderfile.delete(); } BlenderLoader.toBlenderFile(file, blenderfile);