From edbeea55024fd23950b4b5d4686c562e675f6f19 Mon Sep 17 00:00:00 2001 From: Jan-Peter Klein Date: Tue, 2 Jul 2024 15:31:28 +0200 Subject: [PATCH] fixed update check on start and bindings --- .../cryptomator/ui/mainwindow/MainWindowController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java b/src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java index ee16205f3..6ca29b73b 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/MainWindowController.java @@ -34,6 +34,7 @@ public class MainWindowController implements FxController { private final ReadOnlyObjectProperty selectedVault; private final Settings settings; private final FxApplicationWindows appWindows; + private final UpdateChecker updateChecker; private final BooleanBinding updateAvailable; private final LicenseHolder licenseHolder; private final BooleanProperty hideSupportNotificationClicked = new SimpleBooleanProperty(false); @@ -54,6 +55,7 @@ public class MainWindowController implements FxController { this.selectedVault = selectedVault; this.settings = settings; this.appWindows = appWindows; + this.updateChecker = updateChecker; this.updateAvailable = updateChecker.updateAvailableProperty(); this.licenseHolder = licenseHolder; } @@ -61,6 +63,8 @@ public class MainWindowController implements FxController { @FXML public void initialize() { LOG.trace("init MainWindowController"); + updateChecker.automaticallyCheckForUpdatesIfEnabled(); + if (SystemUtils.IS_OS_WINDOWS) { root.getStyleClass().add("os-windows"); } @@ -77,8 +81,8 @@ public class MainWindowController implements FxController { window.xProperty().addListener((_, _, _) -> savePositionalSettings()); window.yProperty().addListener((_, _, _) -> savePositionalSettings()); - supportNotificationHidden.bind(Bindings.createBooleanBinding(() -> !licenseHolder.isValidLicense() && !hideSupportNotificationClicked.get(), hideSupportNotificationClicked)); - updateNotificationHidden.bind(Bindings.createBooleanBinding(() -> updateAvailable.get() && !hideUpdateNotificationClicked.get(), hideUpdateNotificationClicked)); + supportNotificationHidden.bind(Bindings.createBooleanBinding(() -> !licenseHolder.isValidLicense() && !hideSupportNotificationClicked.get(), hideSupportNotificationClicked, licenseHolder.validLicenseProperty())); + updateNotificationHidden.bind(Bindings.createBooleanBinding(() -> updateAvailable.get() && !hideUpdateNotificationClicked.get(), hideUpdateNotificationClicked, updateAvailable)); } private boolean neverTouched() {