Skip to content

Commit

Permalink
Rename the delete and call it for freecad files at start
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Harrington committed Jul 9, 2024
1 parent d3fb9af commit b85b318
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand All @@ -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;
Expand All @@ -361,7 +361,7 @@ private void convertResults(String fileType) throws Exception {
}
}

public static boolean DeleteExisting(String name) {
public static boolean askToDeleteFile(String name) {
CompletableFuture<Boolean> future = new CompletableFuture<>();

Platform.runLater(() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b85b318

Please sign in to comment.