mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-22 20:51:27 +00:00
cr mentioned changes
This commit is contained in:
@@ -43,7 +43,11 @@ public class SupporterCertificateController implements FxController {
|
||||
supporterCertificateField.setText(licenseHolder.getLicenseKey().orElse(null));
|
||||
supporterCertificateField.textProperty().addListener(this::registrationKeyChanged);
|
||||
supporterCertificateField.setTextFormatter(new TextFormatter<>(this::removeWhitespaces));
|
||||
settings.licenseKey.addListener(this::licenseKeySettingsChanged);
|
||||
settings.licenseKey.addListener((_, _, newValue) -> {
|
||||
if (newValue == null) {
|
||||
supporterCertificateField.setText(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private TextFormatter.Change removeWhitespaces(TextFormatter.Change change) {
|
||||
@@ -54,11 +58,6 @@ public class SupporterCertificateController implements FxController {
|
||||
return change;
|
||||
}
|
||||
|
||||
private void licenseKeySettingsChanged(@SuppressWarnings("unused") ObservableValue<? extends String> observable, @SuppressWarnings("unused") String oldValue, String newValue){
|
||||
if(newValue == null)
|
||||
supporterCertificateField.setText(null);
|
||||
}
|
||||
|
||||
private void registrationKeyChanged(@SuppressWarnings("unused") ObservableValue<? extends String> observable, @SuppressWarnings("unused") String oldValue, String newValue) {
|
||||
licenseHolder.validateAndStoreLicense(newValue);
|
||||
if (!licenseHolder.isValidLicense()) {
|
||||
|
||||
Reference in New Issue
Block a user