Log navigation to catch bugs
This commit is contained in:
@@ -30,6 +30,7 @@ import javafx.scene.layout.StackPane;
|
|||||||
import org.jackhuang.hmcl.ui.FXUtils;
|
import org.jackhuang.hmcl.ui.FXUtils;
|
||||||
import org.jackhuang.hmcl.ui.animation.ContainerAnimations;
|
import org.jackhuang.hmcl.ui.animation.ContainerAnimations;
|
||||||
import org.jackhuang.hmcl.ui.animation.TransitionHandler;
|
import org.jackhuang.hmcl.ui.animation.TransitionHandler;
|
||||||
|
import org.jackhuang.hmcl.util.Logging;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
@@ -56,6 +57,8 @@ public class Navigator extends StackPane {
|
|||||||
if (from == node)
|
if (from == node)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Logging.LOG.info("Navigate to " + node);
|
||||||
|
|
||||||
stack.push(node);
|
stack.push(node);
|
||||||
fireEvent(new NavigationEvent(this, from, NavigationEvent.NAVIGATING));
|
fireEvent(new NavigationEvent(this, from, NavigationEvent.NAVIGATING));
|
||||||
setContent(node);
|
setContent(node);
|
||||||
@@ -79,6 +82,8 @@ public class Navigator extends StackPane {
|
|||||||
public void close(Node from) {
|
public void close(Node from) {
|
||||||
FXUtils.checkFxUserThread();
|
FXUtils.checkFxUserThread();
|
||||||
|
|
||||||
|
Logging.LOG.info("Closed page " + from);
|
||||||
|
|
||||||
if (stack.peek() != from)
|
if (stack.peek() != from)
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
stack.pop();
|
stack.pop();
|
||||||
|
|||||||
Reference in New Issue
Block a user