From b2f99addd190d97078a9e4f12710a8ea1072d356 Mon Sep 17 00:00:00 2001 From: Thibstars Date: Mon, 20 Nov 2023 22:31:22 +0100 Subject: [PATCH] Force auto refresh on current time --- .../thibstars/btsd/desktop/liveboard/LiveBoardPanel.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/thibstars/btsd/desktop/liveboard/LiveBoardPanel.java b/src/main/java/com/github/thibstars/btsd/desktop/liveboard/LiveBoardPanel.java index 8f050d1..a47f4f2 100644 --- a/src/main/java/com/github/thibstars/btsd/desktop/liveboard/LiveBoardPanel.java +++ b/src/main/java/com/github/thibstars/btsd/desktop/liveboard/LiveBoardPanel.java @@ -75,7 +75,11 @@ public LiveBoardPanel(LiveBoardController liveBoardController, LiveBoard liveBoa timePicker.setTime(LocalTime.now()); timePicker.addTimeChangeListener(event -> liveBoardController.refreshLiveBoard(this, liveBoard.stationInfo().id(), event.getNewTime())); timePicker.setToolTipText(liveBoardController.getMessage("live.board.time.picker.tooltip")); - pnlRefresh.addRefreshListener(actionEvent -> liveBoardController.refreshLiveBoard(this, liveBoard.stationInfo().id(), timePicker.getTime())); + pnlRefresh.addRefreshListener(actionEvent -> { + LocalTime rightNow = LocalTime.now(); + timePicker.setTime(rightNow); + liveBoardController.refreshLiveBoard(this, liveBoard.stationInfo().id(), rightNow); + }); JPanel pnlContent = new JPanel(new BorderLayout()); Departures departures = liveBoard.departures();