Commit 29aa2286 authored by Luna Riegel's avatar Luna Riegel
Browse files

Style: Show a popup that CD is waiting on Schematron

parent 71731362
...@@ -180,6 +180,7 @@ public class CheckDialog { ...@@ -180,6 +180,7 @@ public class CheckDialog {
private CityDoctorController controller; private CityDoctorController controller;
private FilterPane filterPane; private FilterPane filterPane;
private MainWindow window; private MainWindow window;
private IndeterminateSpinnerDialog waitingDialog;
public CheckDialog(MainWindow window, Window parent, CityDoctorController controller) throws IOException { public CheckDialog(MainWindow window, Window parent, CityDoctorController controller) throws IOException {
this.window = window; this.window = window;
...@@ -327,6 +328,11 @@ public class CheckDialog { ...@@ -327,6 +328,11 @@ public class CheckDialog {
homepageHyperlink.setText("[Hyperlink missing/invalid]"); homepageHyperlink.setText("[Hyperlink missing/invalid]");
} }
try{
waitingDialog = new IndeterminateSpinnerDialog(window.getMainStage(),"Schematron still running, please wait");
} catch (IOException e) {
logger.error("Failed to load IndeterminateSpinnerDialog");
}
} }
...@@ -534,7 +540,12 @@ public class CheckDialog { ...@@ -534,7 +540,12 @@ public class CheckDialog {
ProgressListener l = new ProgressListener() { ProgressListener l = new ProgressListener() {
@Override @Override
public void updateProgress(float state) { public void updateProgress(float state) {
Platform.runLater(() -> progress.setProgress(state)); Platform.runLater(() -> {
progress.setProgress(state);
if (state < 0 ){
waitingDialog.show();
}
});
} }
}; };
controller.startChecks(config, l); controller.startChecks(config, l);
...@@ -556,6 +567,7 @@ public class CheckDialog { ...@@ -556,6 +567,7 @@ public class CheckDialog {
Platform.runLater(() -> { Platform.runLater(() -> {
checkBtn.setDisable(false); checkBtn.setDisable(false);
cancelBtn.setDisable(false); cancelBtn.setDisable(false);
waitingDialog.hide();
stage.setOnCloseRequest(null); stage.setOnCloseRequest(null);
stage.close(); stage.close();
}); });
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment