diff --git a/src/main/java/org/cryptomator/common/settings/Settings.java b/src/main/java/org/cryptomator/common/settings/Settings.java index 4dc56a531..907d99885 100644 --- a/src/main/java/org/cryptomator/common/settings/Settings.java +++ b/src/main/java/org/cryptomator/common/settings/Settings.java @@ -72,8 +72,8 @@ public class Settings { public final IntegerProperty windowHeight; public final StringProperty language; public final StringProperty mountService; - public final BooleanProperty checkForUpdatesEnabled; - public final ObjectProperty lastReminderForUpdateCheck; + public final BooleanProperty checkForUpdates; + public final ObjectProperty lastUpdateCheckReminder; public final ObjectProperty lastSuccessfulUpdateCheck; private Consumer saveCmd; @@ -111,8 +111,8 @@ public class Settings { this.language = new SimpleStringProperty(this, "language", json.language); this.mountService = new SimpleStringProperty(this, "mountService", json.mountService); this.quickAccessService = new SimpleStringProperty(this, "quickAccessService", json.quickAccessService); - this.checkForUpdatesEnabled = new SimpleBooleanProperty(this, "checkForUpdatesEnabled", json.checkForUpdatesEnabled); - this.lastReminderForUpdateCheck = new SimpleObjectProperty<>(this, "lastReminderForUpdateCheck", json.lastReminderForUpdateCheck); + this.checkForUpdates = new SimpleBooleanProperty(this, "checkForUpdates", json.checkForUpdatesEnabled); + this.lastUpdateCheckReminder = new SimpleObjectProperty<>(this, "lastUpdateCheckReminder", json.lastReminderForUpdateCheck); this.lastSuccessfulUpdateCheck = new SimpleObjectProperty<>(this, "lastSuccessfulUpdateCheck", json.lastSuccessfulUpdateCheck); this.directories.addAll(json.directories.stream().map(VaultSettings::new).toList()); @@ -140,8 +140,8 @@ public class Settings { language.addListener(this::somethingChanged); mountService.addListener(this::somethingChanged); quickAccessService.addListener(this::somethingChanged); - checkForUpdatesEnabled.addListener(this::somethingChanged); - lastReminderForUpdateCheck.addListener(this::somethingChanged); + checkForUpdates.addListener(this::somethingChanged); + lastUpdateCheckReminder.addListener(this::somethingChanged); lastSuccessfulUpdateCheck.addListener(this::somethingChanged); } @@ -196,8 +196,8 @@ public class Settings { json.language = language.get(); json.mountService = mountService.get(); json.quickAccessService = quickAccessService.get(); - json.checkForUpdatesEnabled = checkForUpdatesEnabled.get(); - json.lastReminderForUpdateCheck = lastReminderForUpdateCheck.get(); + json.checkForUpdatesEnabled = checkForUpdates.get(); + json.lastReminderForUpdateCheck = lastUpdateCheckReminder.get(); json.lastSuccessfulUpdateCheck = lastSuccessfulUpdateCheck.get(); return json; } diff --git a/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java b/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java index 6be03dddd..fd480033c 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java +++ b/src/main/java/org/cryptomator/ui/fxapp/FxApplication.java @@ -76,9 +76,9 @@ public class FxApplication { var time14DaysAgo = Instant.now().minus(Duration.ofDays(14)); if (!environment.disableUpdateCheck() // - && !settings.checkForUpdatesEnabled.getValue() // + && !settings.checkForUpdates.getValue() // && settings.lastSuccessfulUpdateCheck.get().isBefore(time14DaysAgo) // - && settings.lastReminderForUpdateCheck.get().isBefore(time14DaysAgo)) { + && settings.lastUpdateCheckReminder.get().isBefore(time14DaysAgo)) { appWindows.showUpdateReminderWindow(); } diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index f60ae157d..b857adcae 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -50,7 +50,7 @@ public class UpdateChecker { } public void automaticallyCheckForUpdatesIfEnabled() { - if (!env.disableUpdateCheck() && settings.checkForUpdatesEnabled.get()) { + if (!env.disableUpdateCheck() && settings.checkForUpdates.get()) { startCheckingForUpdates(AUTO_CHECK_DELAY); } } diff --git a/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java b/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java index ddb39bd4f..585180662 100644 --- a/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java +++ b/src/main/java/org/cryptomator/ui/fxapp/UpdateCheckerModule.java @@ -62,7 +62,7 @@ public abstract class UpdateCheckerModule { @Named("checkForUpdatesInterval") @FxApplicationScoped static ObjectBinding provideCheckForUpdateInterval(Settings settings) { - return Bindings.when(settings.checkForUpdatesEnabled).then(UPDATE_CHECK_INTERVAL).otherwise(DISABLED_UPDATE_CHECK_INTERVAL); + return Bindings.when(settings.checkForUpdates).then(UPDATE_CHECK_INTERVAL).otherwise(DISABLED_UPDATE_CHECK_INTERVAL); } @Provides diff --git a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index 8f74f34e7..afa05cc8c 100644 --- a/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -74,7 +74,7 @@ public class UpdatesPreferencesController implements FxController { } public void initialize() { - checkForUpdatesCheckbox.selectedProperty().bindBidirectional(settings.checkForUpdatesEnabled); + checkForUpdatesCheckbox.selectedProperty().bindBidirectional(settings.checkForUpdates); upToDate.addListener((_, _, newVal) -> { if (newVal) { diff --git a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java index 87262da9d..a6fce0b79 100644 --- a/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java +++ b/src/main/java/org/cryptomator/ui/updatereminder/UpdateReminderController.java @@ -26,7 +26,7 @@ public class UpdateReminderController implements FxController { @FXML public void initialize() { - settings.lastReminderForUpdateCheck.set(Instant.now()); + settings.lastUpdateCheckReminder.set(Instant.now()); } @FXML @@ -43,7 +43,7 @@ public class UpdateReminderController implements FxController { @FXML public void automatically() { updateChecker.checkForUpdatesNow(); - settings.checkForUpdatesEnabled.set(true); + settings.checkForUpdates.set(true); window.close(); }