change naming
Some checks failed
Build / Compile and Test (push) Has been cancelled

* revert to checkForUpdates
* rename to lastUpdateCheckReminder
This commit is contained in:
Armin Schrenk 2024-11-11 19:16:53 +01:00
parent 9c2e6f7b03
commit bf79762613
No known key found for this signature in database
6 changed files with 15 additions and 15 deletions

View File

@ -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<Instant> lastReminderForUpdateCheck;
public final BooleanProperty checkForUpdates;
public final ObjectProperty<Instant> lastUpdateCheckReminder;
public final ObjectProperty<Instant> lastSuccessfulUpdateCheck;
private Consumer<Settings> 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;
}

View File

@ -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();
}

View File

@ -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);
}
}

View File

@ -62,7 +62,7 @@ public abstract class UpdateCheckerModule {
@Named("checkForUpdatesInterval")
@FxApplicationScoped
static ObjectBinding<Duration> 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

View File

@ -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) {

View File

@ -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();
}