fix(studio): keep project directory checks behind core services
This commit is contained in:
+1
-2
@@ -18,7 +18,6 @@ import p.studio.ui.javafx2.components.*;
|
||||
import p.studio.ui.javafx2.play.PlaybackViewport;
|
||||
import p.studio.ui.javafx2.shell.MinimalShell;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Files;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.function.*;
|
||||
@@ -141,7 +140,7 @@ public final class StudioWindowCoordinator2 implements AutoCloseable {
|
||||
}
|
||||
private void reloadProjects(Path selection){
|
||||
chooser.busy(true);
|
||||
background(()->{var root=catalog.projectsRoot();return new ProjectList(known.listKnownProjects(),Files.isDirectory(root)?root:null);},(result,failure)->{
|
||||
background(()->new ProjectList(known.listKnownProjects(),catalog.existingProjectsRoot().orElse(null)),(result,failure)->{
|
||||
if(project!=null)return;
|
||||
chooser.busy(busy||opening.busy());if(failure!=null){error(failure);return;}
|
||||
initialDirectory=result.root();chooser.projects(result.projects(),selection);
|
||||
|
||||
+1
@@ -39,6 +39,7 @@ class ProjectOpeningTest {
|
||||
Fixture(){
|
||||
ProjectCatalog catalog=new ProjectCatalog(){
|
||||
public Path projectsRoot(){return ROOT;}
|
||||
public Optional<Path> existingProjectsRoot(){return Optional.of(ROOT);}
|
||||
public List<ProjectReference> listProjects(){return List.of(REF);}
|
||||
public ProjectReference openProject(Path path){fail("catalog");return REF;}
|
||||
public ProjectReference openProjectManifest(Path path){return openProject(path);}
|
||||
|
||||
Reference in New Issue
Block a user