File tree 1 file changed +11
-2
lines changed
ui/src/main/java/edu/wpi/grip/ui
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 4
4
import edu .wpi .grip .core .Pipeline ;
5
5
import edu .wpi .grip .core .PipelineRunner ;
6
6
import edu .wpi .grip .core .events .ProjectSettingsChangedEvent ;
7
+ import edu .wpi .grip .core .events .UnexpectedThrowableEvent ;
7
8
import edu .wpi .grip .core .serialization .Project ;
8
9
import edu .wpi .grip .core .settings .ProjectSettings ;
9
10
import edu .wpi .grip .core .settings .SettingsProvider ;
@@ -153,7 +154,7 @@ public void newProject() {
153
154
* pipeline, an "are you sure?" dialog is shown. (TODO)
154
155
*/
155
156
@ FXML
156
- public void openProject () throws IOException {
157
+ public void openProject () {
157
158
if (showConfirmationDialogAndWait ()) {
158
159
final FileChooser fileChooser = new FileChooser ();
159
160
fileChooser .setTitle ("Open Project" );
@@ -165,7 +166,15 @@ public void openProject() throws IOException {
165
166
166
167
final File file = fileChooser .showOpenDialog (root .getScene ().getWindow ());
167
168
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 ();
169
178
}
170
179
}
171
180
}
You can’t perform that action at this time.
0 commit comments