From 56e3a54ae0bc0d42859cb7920795f466ff2020d7 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 27 Sep 2021 12:49:46 +0200 Subject: [PATCH] clarify and improve wallet password and keystore passphrase entry --- .../sparrow/control/KeystorePassphraseDialog.java | 10 +++++++++- .../sparrow/control/WalletPasswordDialog.java | 4 ++-- .../resources/com/sparrowwallet/sparrow/general.css | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/KeystorePassphraseDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/KeystorePassphraseDialog.java index 1d29916a..5a90143b 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/KeystorePassphraseDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/KeystorePassphraseDialog.java @@ -7,6 +7,7 @@ import javafx.application.Platform; import javafx.scene.control.ButtonType; import javafx.scene.control.Dialog; import javafx.scene.control.DialogPane; +import javafx.scene.control.Label; import javafx.scene.layout.VBox; import org.controlsfx.control.textfield.CustomPasswordField; import org.controlsfx.control.textfield.TextFields; @@ -24,7 +25,7 @@ public class KeystorePassphraseDialog extends Dialog { final DialogPane dialogPane = getDialogPane(); setTitle("Keystore Passphrase" + (walletName != null ? " - " + walletName : "")); - dialogPane.setHeaderText("Please enter the passphrase for keystore: \n" + keystore.getLabel()); + dialogPane.setHeaderText("Enter the BIP39 passphrase\nfor keystore: " + keystore.getLabel()); dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm()); AppServices.setStageIcon(dialogPane.getScene().getWindow()); dialogPane.getButtonTypes().addAll(ButtonType.CANCEL, ButtonType.OK); @@ -40,6 +41,13 @@ public class KeystorePassphraseDialog extends Dialog { content.setPrefHeight(50); content.getChildren().add(passphrase); + Glyph warnGlyph = new Glyph(FontAwesome5.FONT_NAME, FontAwesome5.Glyph.EXCLAMATION_TRIANGLE); + warnGlyph.getStyleClass().add("warn-icon"); + warnGlyph.setFontSize(12); + Label warnLabel = new Label("A BIP39 passphrase is not a wallet password!", warnGlyph); + warnLabel.setGraphicTextGap(5); + content.getChildren().add(warnLabel); + dialogPane.setContent(content); Platform.runLater(passphrase::requestFocus); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/WalletPasswordDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/WalletPasswordDialog.java index fd8a78b8..88d02f68 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/WalletPasswordDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/WalletPasswordDialog.java @@ -131,10 +131,10 @@ public class WalletPasswordDialog extends Dialog { } public enum PasswordRequirement { - LOAD("Please enter the wallet password:", "Unlock"), + LOAD("Enter the wallet password:", "Unlock"), UPDATE_NEW("Add a password to the wallet?\nLeave empty for no password:", "No Password"), UPDATE_EMPTY("This wallet has no password.\nAdd a password to the wallet?\nLeave empty for no password:", "No Password"), - UPDATE_SET("Please re-enter the wallet password:", "Verify Password"), + UPDATE_SET("Re-enter the wallet password:", "Verify Password"), UPDATE_CHANGE("Enter the new wallet password.\nLeave empty for no password:", "No Password"); private final String description; diff --git a/src/main/resources/com/sparrowwallet/sparrow/general.css b/src/main/resources/com/sparrowwallet/sparrow/general.css index 930469ce..ec6f7125 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/general.css +++ b/src/main/resources/com/sparrowwallet/sparrow/general.css @@ -164,6 +164,10 @@ -fx-text-fill: rgb(202, 18, 67); } +.warn-icon { + -fx-text-fill: rgb(238, 210, 2); +} + .root .header-panel { -fx-background-color: -fx-box-border, derive(-fx-background, 10%); }