diff --git a/main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java b/main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java index 778d2b4ed..2f68190be 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java +++ b/main/ui/src/main/java/org/cryptomator/ui/fxapp/UpdateChecker.java @@ -2,6 +2,7 @@ package org.cryptomator.ui.fxapp; import javafx.beans.binding.BooleanBinding; import javafx.beans.property.ReadOnlyStringProperty; +import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import javafx.concurrent.ScheduledService; import javafx.concurrent.Worker; @@ -24,6 +25,7 @@ public class UpdateChecker { private final Settings settings; private final Optional applicationVersion; + private final StringProperty currentVersionProperty; private final StringProperty latestVersionProperty; private final Comparator semVerComparator; private final ScheduledService updateCheckerService; @@ -35,6 +37,7 @@ public class UpdateChecker { this.latestVersionProperty = latestVersionProperty; this.semVerComparator = semVerComparator; this.updateCheckerService = updateCheckerService; + this.currentVersionProperty = new SimpleStringProperty(applicationVersion.orElse("SNAPSHOT")); } public void automaticallyCheckForUpdatesIfEnabled() { @@ -87,4 +90,8 @@ public class UpdateChecker { return latestVersionProperty; } + public ReadOnlyStringProperty currentVersionProperty() { + return currentVersionProperty; + } + } diff --git a/main/ui/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java b/main/ui/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java index aa21eebf3..6433d1ea7 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/preferences/UpdatesPreferencesController.java @@ -7,7 +7,6 @@ import javafx.beans.property.ReadOnlyStringProperty; import javafx.fxml.FXML; import javafx.scene.control.CheckBox; import javafx.scene.control.ContentDisplay; -import javafx.util.Duration; import org.cryptomator.common.settings.Settings; import org.cryptomator.ui.common.FxController; import org.cryptomator.ui.fxapp.UpdateChecker; @@ -21,6 +20,7 @@ public class UpdatesPreferencesController implements FxController { private final UpdateChecker updateChecker; private final ObjectBinding checkForUpdatesButtonState; private final ReadOnlyStringProperty latestVersion; + private final ReadOnlyStringProperty currentVersion; private final BooleanBinding updateAvailable; public CheckBox checkForUpdatesCheckbox; @@ -31,6 +31,7 @@ public class UpdatesPreferencesController implements FxController { this.checkForUpdatesButtonState = Bindings.when(updateChecker.checkingForUpdatesProperty()).then(ContentDisplay.LEFT).otherwise(ContentDisplay.TEXT_ONLY); this.latestVersion = updateChecker.latestVersionProperty(); this.updateAvailable = latestVersion.isNotNull(); + this.currentVersion = updateChecker.currentVersionProperty(); } public void initialize() { @@ -60,6 +61,14 @@ public class UpdatesPreferencesController implements FxController { return latestVersion.get(); } + public ReadOnlyStringProperty currentVersionProperty() { + return currentVersion; + } + + public String getCurrentVersion() { + return currentVersion.get(); + } + public BooleanBinding updateAvailableProperty() { return updateAvailable; } diff --git a/main/ui/src/main/resources/fxml/preferences_updates.fxml b/main/ui/src/main/resources/fxml/preferences_updates.fxml index 85b92d944..8ac357be0 100644 --- a/main/ui/src/main/resources/fxml/preferences_updates.fxml +++ b/main/ui/src/main/resources/fxml/preferences_updates.fxml @@ -14,6 +14,8 @@ + + diff --git a/main/ui/src/main/resources/i18n/strings.properties b/main/ui/src/main/resources/i18n/strings.properties index b6d698385..b2e489d06 100644 --- a/main/ui/src/main/resources/i18n/strings.properties +++ b/main/ui/src/main/resources/i18n/strings.properties @@ -107,6 +107,7 @@ preferences.volume.webdav.port=WebDAV Port preferences.volume.webdav.scheme=WebDAV Scheme ## Updates preferences.updates=Updates +preferences.updates.currentVersion=Current Version: %s preferences.updates.autoUpdateCheck=Check for updates automatically preferences.updates.checkNowBtn=Check Now preferences.updates.updateAvailable=Update to version %s available. diff --git a/main/ui/src/main/resources/i18n/strings_de.properties b/main/ui/src/main/resources/i18n/strings_de.properties index a862effe3..430b7cbd3 100644 --- a/main/ui/src/main/resources/i18n/strings_de.properties +++ b/main/ui/src/main/resources/i18n/strings_de.properties @@ -95,6 +95,7 @@ preferences.volume.webdav.port=WebDAV-Port preferences.volume.webdav.scheme=WebDAV-Schema ## Updates preferences.updates=Updates +preferences.updates.currentVersion=Aktuelle Version: %s preferences.updates.autoUpdateCheck=Automatisch nach Updates suchen preferences.updates.checkNowBtn=Jetzt prüfen preferences.updates.updateAvailable=Update auf Version %s verfügbar.