File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
ui/src/main/java/edu/wpi/grip/ui Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 44import edu .wpi .grip .core .Pipeline ;
55import edu .wpi .grip .core .PipelineRunner ;
66import edu .wpi .grip .core .events .ProjectSettingsChangedEvent ;
7+ import edu .wpi .grip .core .events .UnexpectedThrowableEvent ;
78import edu .wpi .grip .core .serialization .Project ;
89import edu .wpi .grip .core .settings .ProjectSettings ;
910import edu .wpi .grip .core .settings .SettingsProvider ;
@@ -153,7 +154,7 @@ public void newProject() {
153154 * pipeline, an "are you sure?" dialog is shown. (TODO)
154155 */
155156 @ FXML
156- public void openProject () throws IOException {
157+ public void openProject () {
157158 if (showConfirmationDialogAndWait ()) {
158159 final FileChooser fileChooser = new FileChooser ();
159160 fileChooser .setTitle ("Open Project" );
@@ -165,7 +166,15 @@ public void openProject() throws IOException {
165166
166167 final File file = fileChooser .showOpenDialog (root .getScene ().getWindow ());
167168 if (file != null ) {
168- project .open (file );
169+ Thread fileOpenThread = new Thread (() -> {
170+ try {
171+ project .open (file );
172+ } catch (IOException e ) {
173+ eventBus .post (new UnexpectedThrowableEvent (e , "Failed to load save file" ));
174+ }
175+ }, "Project Open Thread" );
176+ fileOpenThread .setDaemon (true );
177+ fileOpenThread .start ();
169178 }
170179 }
171180 }
You can’t perform that action at this time.
0 commit comments