Skip to content

Commit

Permalink
add new listener to log webapp status messages
Browse files Browse the repository at this point in the history
  • Loading branch information
akberenz committed Oct 2, 2023
1 parent 35e29e7 commit 12a4b6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/qz/printer/action/html/WebApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ public void handle(long l) {
//listens for load progress
private static ChangeListener<Number> workDoneListener = (ov, oldWork, newWork) -> log.trace("Done: {} > {}", oldWork, newWork);

private static ChangeListener<String> msgListener = (ov, oldMsg, newMsg) -> log.trace("New status: {}", newMsg);

//listens for failures
private static ChangeListener<Throwable> exceptListener = (obs, oldExc, newExc) -> {
if (newExc != null) { unlatch(newExc); }
Expand Down Expand Up @@ -247,6 +249,7 @@ public void start(Stage st) throws Exception {
worker.stateProperty().addListener(stateListener);
worker.workDoneProperty().addListener(workDoneListener);
worker.exceptionProperty().addListener(exceptListener);
worker.messageProperty().addListener(msgListener);

//prevents JavaFX from shutting down when hiding window
Platform.setImplicitExit(false);
Expand Down

0 comments on commit 12a4b6d

Please sign in to comment.