@@ -141,6 +141,7 @@ private boolean showConfirmationDialogAndWait() {
141
141
dialog .setTitle ("Save Project?" );
142
142
dialog .setHeaderText ("Save the current project first?" );
143
143
dialog .getDialogPane ().getButtonTypes ().setAll (save , dontSave , cancel );
144
+ dialog .initOwner (root .getScene ().getWindow ());
144
145
145
146
if (!dialog .showAndWait ().isPresent ()) { // NOPMD
146
147
return false ;
@@ -186,7 +187,11 @@ public void openProject() {
186
187
new ExtensionFilter ("GRIP File" , "*.grip" ),
187
188
new ExtensionFilter ("All Files" , "*" , "*.*" ));
188
189
189
- project .getFile ().ifPresent (file -> fileChooser .setInitialDirectory (file .getParentFile ()));
190
+ if (project .getFile ().isPresent ()) {
191
+ fileChooser .setInitialDirectory (project .getFile ().get ().getParentFile ());
192
+ } else {
193
+ fileChooser .setInitialDirectory (new File (System .getProperty ("user.home" ) + "/GRIP" ));
194
+ }
190
195
191
196
final File file = fileChooser .showOpenDialog (root .getScene ().getWindow ());
192
197
if (file != null ) {
@@ -250,6 +255,7 @@ protected void showProjectSettingsEditor() {
250
255
251
256
ProjectSettingsEditor projectSettingsEditor
252
257
= new ProjectSettingsEditor (root , projectSettings , appSettings );
258
+ projectSettingsEditor .initOwner (root .getScene ().getWindow ());
253
259
projectSettingsEditor .showAndWait ().ifPresent (buttonType -> {
254
260
if (buttonType == ButtonType .OK ) {
255
261
eventBus .post (new ProjectSettingsChangedEvent (projectSettings ));
@@ -262,8 +268,11 @@ protected void showProjectSettingsEditor() {
262
268
protected void showProjectAboutDialog () throws IOException {
263
269
if (aboutDialogStage == null ) {
264
270
aboutDialogStage = new Stage ();
265
- aboutDialogStage .setScene (new Scene (aboutPane ));
266
- aboutDialogStage .initStyle (StageStyle .UTILITY );
271
+ Scene scene = new Scene (aboutPane );
272
+ scene .getStylesheets ().setAll (root .getStylesheets ());
273
+ aboutDialogStage .setScene (scene );
274
+ aboutDialogStage .initStyle (StageStyle .UNDECORATED );
275
+ aboutDialogStage .initOwner (root .getScene ().getWindow ());
267
276
aboutDialogStage .focusedProperty ().addListener ((observable , oldvalue , newvalue ) -> {
268
277
if (oldvalue ) {
269
278
aboutDialogStage .hide ();
@@ -323,6 +332,8 @@ protected void generate() {
323
332
return ;
324
333
}
325
334
Dialog <CodeGenerationSettings > optionsDialog = new CodeGenerationSettingsDialog (codegenPane );
335
+ optionsDialog .getDialogPane ().getStylesheets ().setAll (root .getStylesheets ());
336
+ optionsDialog .initOwner (root .getScene ().getWindow ());
326
337
optionsDialog .showAndWait ().ifPresent (settings -> {
327
338
eventBus .post (new CodeGenerationSettingsChangedEvent (settings ));
328
339
Exporter exporter = new Exporter (pipeline .getSteps (), settings );
@@ -361,6 +372,7 @@ protected void deploy() {
361
372
Dialog <ButtonType > dialog = new Dialog <>();
362
373
dialog .setTitle ("Deploy" );
363
374
dialog .setHeaderText ("Deploy" );
375
+ dialog .initOwner (root .getScene ().getWindow ());
364
376
dialog .setGraphic (graphic );
365
377
dialog .getDialogPane ().getButtonTypes ().setAll (ButtonType .CLOSE );
366
378
dialog .getDialogPane ().styleProperty ().bind (root .styleProperty ());
@@ -381,6 +393,8 @@ public void onWarningEvent(WarningEvent e) {
381
393
382
394
private void showWarningAlert (WarningEvent e ) {
383
395
Alert alert = new WarningAlert (e .getHeader (), e .getBody (), root .getScene ().getWindow ());
396
+ alert .getDialogPane ().getStylesheets ().setAll (root .getStylesheets ());
397
+ alert .initOwner (root .getScene ().getWindow ());
384
398
alert .showAndWait ();
385
399
}
386
400
@@ -405,6 +419,7 @@ private void showAnalysis() {
405
419
if (analysisStage == null ) {
406
420
analysisStage = new Stage ();
407
421
analysisStage .setScene (new Scene (analysisPane ));
422
+ analysisPane .getStylesheets ().setAll (root .getStylesheets ());
408
423
analysisStage .initOwner (root .getScene ().getWindow ());
409
424
analysisStage .setTitle ("Pipeline Analysis" );
410
425
analysisStage .getIcons ().add (new Image ("/edu/wpi/grip/ui/icons/grip.png" ));
0 commit comments