fixed update check on start and bindings

This commit is contained in:
Jan-Peter Klein 2024-07-02 15:31:28 +02:00
parent 8ff06a3efd
commit edbeea5502
No known key found for this signature in database
GPG Key ID: 90EDA3A7C822FD0E

View File

@ -34,6 +34,7 @@ public class MainWindowController implements FxController {
private final ReadOnlyObjectProperty<Vault> 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() {