diff --git a/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java b/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java
index e454835cf..485e89304 100644
--- a/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java
+++ b/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java
@@ -17,6 +17,7 @@ public enum FontAwesome5Icon {
COGS("\uF085"), //
COPY("\uF0C5"), //
CROWN("\uF521"), //
+ DONATE("\uF4B9"), //
EDIT("\uF044"), //
EXCHANGE_ALT("\uF362"), //
EXCLAMATION("\uF12A"), //
@@ -49,6 +50,7 @@ public enum FontAwesome5Icon {
SEARCH("\uF002"), //
SHARE("\uF064"), //
SPINNER("\uF110"), //
+ SPONSORS("\uF2B5"), //
STETHOSCOPE("\uF0f1"), //
SYNC("\uF021"), //
TIMES("\uF00D"), //
diff --git a/src/main/java/org/cryptomator/ui/preferences/PreferencesComponent.java b/src/main/java/org/cryptomator/ui/preferences/PreferencesComponent.java
index 2d569970d..136479bc0 100644
--- a/src/main/java/org/cryptomator/ui/preferences/PreferencesComponent.java
+++ b/src/main/java/org/cryptomator/ui/preferences/PreferencesComponent.java
@@ -31,7 +31,7 @@ public interface PreferencesComponent {
Stage stage = window();
stage.setScene(scene().get());
stage.setMinWidth(420);
- stage.setMinHeight(300);
+ stage.setMinHeight(400);
stage.show();
stage.requestFocus();
return stage;
diff --git a/src/main/java/org/cryptomator/ui/preferences/SupporterCertificateController.java b/src/main/java/org/cryptomator/ui/preferences/SupporterCertificateController.java
index bff56bc3c..1ae037d41 100644
--- a/src/main/java/org/cryptomator/ui/preferences/SupporterCertificateController.java
+++ b/src/main/java/org/cryptomator/ui/preferences/SupporterCertificateController.java
@@ -10,24 +10,36 @@ import javax.inject.Inject;
import javafx.application.Application;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
+import javafx.scene.control.Alert;
+import javafx.scene.control.Button;
+import javafx.scene.control.ButtonType;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextFormatter;
+import java.util.ResourceBundle;
@PreferencesScoped
public class SupporterCertificateController implements FxController {
+ private static final String DONATE_URI = "https://cryptomator.org/donate";
+ private static final String SPONSORS_URI = "https://cryptomator.org/sponsors";
private static final String SUPPORTER_URI = "https://store.cryptomator.org/desktop";
private final Application application;
private final LicenseHolder licenseHolder;
private final Settings settings;
- public TextArea supporterCertificateField;
+ private final ResourceBundle resourceBundle;
+
+ @FXML
+ private TextArea supporterCertificateField;
+ @FXML
+ private Button trashButton;
@Inject
- SupporterCertificateController(Application application, LicenseHolder licenseHolder, Settings settings) {
+ SupporterCertificateController(Application application, LicenseHolder licenseHolder, Settings settings, ResourceBundle resourceBundle) {
this.application = application;
this.licenseHolder = licenseHolder;
this.settings = settings;
+ this.resourceBundle = resourceBundle;
}
@FXML
@@ -35,6 +47,20 @@ public class SupporterCertificateController implements FxController {
supporterCertificateField.setText(licenseHolder.getLicenseKey().orElse(null));
supporterCertificateField.textProperty().addListener(this::registrationKeyChanged);
supporterCertificateField.setTextFormatter(new TextFormatter<>(this::removeWhitespaces));
+
+ trashButton.setOnAction(_ -> {
+ Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
+ alert.setTitle(resourceBundle.getString("removeLicenseKeyDialog.title"));
+ alert.setHeaderText(resourceBundle.getString("removeLicenseKeyDialog.header"));
+ alert.setContentText(resourceBundle.getString("removeLicenseKeyDialog.content"));
+
+ alert.showAndWait().ifPresent(response -> {
+ if (response == ButtonType.OK) {
+ supporterCertificateField.setText(null);
+ settings.licenseKey.set(null);
+ }
+ });
+ });
}
private TextFormatter.Change removeWhitespaces(TextFormatter.Change change) {
@@ -57,6 +83,16 @@ public class SupporterCertificateController implements FxController {
application.getHostServices().showDocument(SUPPORTER_URI);
}
+ @FXML
+ public void showDonate() {
+ application.getHostServices().showDocument(DONATE_URI);
+ }
+
+ @FXML
+ public void showSponsors() {
+ application.getHostServices().showDocument(SPONSORS_URI);
+ }
+
public LicenseHolder getLicenseHolder() {
return licenseHolder;
}
diff --git a/src/main/resources/css/dark_theme.css b/src/main/resources/css/dark_theme.css
index 86d9aaa71..c78de230e 100644
--- a/src/main/resources/css/dark_theme.css
+++ b/src/main/resources/css/dark_theme.css
@@ -266,6 +266,26 @@
-fx-background-insets: 0, 0 1 0 0;
}
+/*******************************************************************************
+ * *
+ * Alert-Dialogs *
+ * *
+ ******************************************************************************/
+
+.dialog-pane {
+ -fx-padding: 12px;
+}
+
+.dialog-pane .header-panel {
+ -fx-font-family: 'Open Sans SemiBold';
+ -fx-font-size: 1.2em;
+}
+
+.dialog-pane .content {
+ -fx-font-family: 'Open Sans';
+ -fx-padding: 12 0 12 0;
+}
+
/*******************************************************************************
* *
* Vault List *
diff --git a/src/main/resources/css/light_theme.css b/src/main/resources/css/light_theme.css
index 88cf6d970..6ca831268 100644
--- a/src/main/resources/css/light_theme.css
+++ b/src/main/resources/css/light_theme.css
@@ -265,6 +265,26 @@
-fx-background-insets: 0, 0 1 0 0;
}
+/*******************************************************************************
+ * *
+ * Alert-Dialogs *
+ * *
+ ******************************************************************************/
+
+.dialog-pane {
+ -fx-padding: 12px;
+}
+
+.dialog-pane .header-panel {
+ -fx-font-family: 'Open Sans SemiBold';
+ -fx-font-size: 1.2em;
+}
+
+.dialog-pane .content {
+ -fx-font-family: 'Open Sans';
+ -fx-padding: 12 0 12 0;
+}
+
/*******************************************************************************
* *
* Vault List *
diff --git a/src/main/resources/fxml/preferences_contribute.fxml b/src/main/resources/fxml/preferences_contribute.fxml
index 55d40b495..c42d65ee0 100644
--- a/src/main/resources/fxml/preferences_contribute.fxml
+++ b/src/main/resources/fxml/preferences_contribute.fxml
@@ -10,6 +10,11 @@
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
diff --git a/src/main/resources/i18n/strings.properties b/src/main/resources/i18n/strings.properties
index b310e9c46..bde346a33 100644
--- a/src/main/resources/i18n/strings.properties
+++ b/src/main/resources/i18n/strings.properties
@@ -336,6 +336,11 @@ preferences.contribute.registeredFor=Supporter certificate registered for %s
preferences.contribute.noCertificate=Support Cryptomator and receive a supporter certificate. It's like a license key but for awesome people using free software. ;-)
preferences.contribute.getCertificate=Don't have one already? Learn how you can obtain it.
preferences.contribute.promptText=Paste supporter certificate code here
+
+### Remove License Key Dialog
+removeLicenseKeyDialog.title=Confirm Removal
+removeLicenseKeyDialog.header=Remove Certificate
+removeLicenseKeyDialog.content=Are you sure you want to remove the certificate?
#<-- Add entries for donations and code/translation/documentation contribution -->
## About
diff --git a/src/main/resources/img/supporter_cert_stemp.png b/src/main/resources/img/supporter_cert_stemp.png
new file mode 100644
index 000000000..47dc01565
Binary files /dev/null and b/src/main/resources/img/supporter_cert_stemp.png differ
diff --git a/src/main/resources/img/supporter_cert_stemp@2x.png b/src/main/resources/img/supporter_cert_stemp@2x.png
new file mode 100644
index 000000000..028ca3064
Binary files /dev/null and b/src/main/resources/img/supporter_cert_stemp@2x.png differ