Skip to content

Commit

Permalink
Gave popups an owner to close #297
Browse files Browse the repository at this point in the history
  • Loading branch information
phrack committed Nov 22, 2015
1 parent 84ad01a commit fc9d779
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/java/com/shootoff/camera/CameraManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ private void showMissingCameraError() {
cameraAlert.setHeaderText("Cannot Communicate with Camera!");
cameraAlert.setResizable(true);
cameraAlert.setContentText(message);
cameraAlert.initOwner(controller.getStage());
cameraAlert.show();
});
}
Expand All @@ -622,6 +623,7 @@ private void showFPSWarning(double fps) {
cameraAlert.setHeaderText("Webcam FPS is too low!");
cameraAlert.setResizable(true);
cameraAlert.setContentText(message);
cameraAlert.initOwner(controller.getStage());
cameraAlert.show();
});
}
Expand Down Expand Up @@ -664,7 +666,7 @@ public void run() {
return;
shownBrightnessWarning = true;
Platform.runLater(() -> {
Alert cameraAlert = new Alert(AlertType.WARNING);
Alert brightnessAlert = new Alert(AlertType.WARNING);

Optional<String> cameraName = config.getWebcamsUserName(webcam.get());
String messageFormat = "The camera %s is streaming frames that are very bright. "
Expand All @@ -680,11 +682,12 @@ public void run() {
message = String.format(messageFormat, webcam.get().getName());
}

cameraAlert.setTitle("Conditions Very Bright");
cameraAlert.setHeaderText("Webcam detected very bright conditions!");
cameraAlert.setResizable(true);
cameraAlert.setContentText(message);
cameraAlert.show();
brightnessAlert.setTitle("Conditions Very Bright");
brightnessAlert.setHeaderText("Webcam detected very bright conditions!");
brightnessAlert.setResizable(true);
brightnessAlert.setContentText(message);
brightnessAlert.initOwner(controller.getStage());
brightnessAlert.show();
});
}

Expand Down

0 comments on commit fc9d779

Please sign in to comment.