clarify and improve wallet password and keystore passphrase entry

This commit is contained in:
Craig Raw 2021-09-27 12:49:46 +02:00
parent a934ffa76c
commit 56e3a54ae0
3 changed files with 15 additions and 3 deletions

View file

@ -7,6 +7,7 @@ import javafx.application.Platform;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.control.Dialog; import javafx.scene.control.Dialog;
import javafx.scene.control.DialogPane; import javafx.scene.control.DialogPane;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
import org.controlsfx.control.textfield.CustomPasswordField; import org.controlsfx.control.textfield.CustomPasswordField;
import org.controlsfx.control.textfield.TextFields; import org.controlsfx.control.textfield.TextFields;
@ -24,7 +25,7 @@ public class KeystorePassphraseDialog extends Dialog<String> {
final DialogPane dialogPane = getDialogPane(); final DialogPane dialogPane = getDialogPane();
setTitle("Keystore Passphrase" + (walletName != null ? " - " + walletName : "")); 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()); dialogPane.getStylesheets().add(AppServices.class.getResource("general.css").toExternalForm());
AppServices.setStageIcon(dialogPane.getScene().getWindow()); AppServices.setStageIcon(dialogPane.getScene().getWindow());
dialogPane.getButtonTypes().addAll(ButtonType.CANCEL, ButtonType.OK); dialogPane.getButtonTypes().addAll(ButtonType.CANCEL, ButtonType.OK);
@ -40,6 +41,13 @@ public class KeystorePassphraseDialog extends Dialog<String> {
content.setPrefHeight(50); content.setPrefHeight(50);
content.getChildren().add(passphrase); 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); dialogPane.setContent(content);
Platform.runLater(passphrase::requestFocus); Platform.runLater(passphrase::requestFocus);

View file

@ -131,10 +131,10 @@ public class WalletPasswordDialog extends Dialog<SecureString> {
} }
public enum PasswordRequirement { 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_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_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"); UPDATE_CHANGE("Enter the new wallet password.\nLeave empty for no password:", "No Password");
private final String description; private final String description;

View file

@ -164,6 +164,10 @@
-fx-text-fill: rgb(202, 18, 67); -fx-text-fill: rgb(202, 18, 67);
} }
.warn-icon {
-fx-text-fill: rgb(238, 210, 2);
}
.root .header-panel { .root .header-panel {
-fx-background-color: -fx-box-border, derive(-fx-background, 10%); -fx-background-color: -fx-box-border, derive(-fx-background, 10%);
} }