mirror of
https://github.com/cryptomator/cryptomator.git
synced 2024-11-26 21:40:29 +00:00
* revert to checkForUpdates * rename to lastUpdateCheckReminder
This commit is contained in:
parent
9c2e6f7b03
commit
bf79762613
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user