improve bip39 keystore import labelling to indicate generation and import options

This commit is contained in:
Craig Raw 2022-03-02 17:01:13 +02:00
parent b640ffea44
commit 1a9c6f8f80
4 changed files with 12 additions and 6 deletions

View file

@ -44,7 +44,7 @@ public class MnemonicKeystoreImportPane extends MnemonicKeystorePane {
private List<String> generatedMnemonicCode;
public MnemonicKeystoreImportPane(Wallet wallet, KeystoreMnemonicImport importer) {
super(importer.getName(), "Seed import", importer.getKeystoreImportDescription(), "image/" + importer.getWalletModel().getType() + ".png");
super(importer.getName(), "Seed generation or import", importer.getKeystoreImportDescription(), "image/" + importer.getWalletModel().getType() + ".png");
this.wallet = wallet;
this.importer = importer;

View file

@ -55,17 +55,17 @@ public class MnemonicKeystorePane extends TitledDescriptionPane {
private void createEnterMnemonicButton() {
enterMnemonicButton = new SplitMenuButton();
enterMnemonicButton.setAlignment(Pos.CENTER_RIGHT);
enterMnemonicButton.setText("Enter 24 Words");
enterMnemonicButton.setText("Use 24 Words");
defaultWordSizeProperty = new SimpleIntegerProperty(24);
defaultWordSizeProperty.addListener((observable, oldValue, newValue) -> {
enterMnemonicButton.setText("Enter " + newValue + " Words");
enterMnemonicButton.setText("Use " + newValue + " Words");
});
enterMnemonicButton.setOnAction(event -> {
enterMnemonic(defaultWordSizeProperty.get());
});
int[] numberWords = new int[] {24, 21, 18, 15, 12};
for(int i = 0; i < numberWords.length; i++) {
MenuItem item = new MenuItem("Enter " + numberWords[i] + " Words");
MenuItem item = new MenuItem("Use " + numberWords[i] + " Words");
final int words = numberWords[i];
item.setOnAction(event -> {
defaultWordSizeProperty.set(words);
@ -77,7 +77,7 @@ public class MnemonicKeystorePane extends TitledDescriptionPane {
}
protected void enterMnemonic(int numWords) {
setDescription("Enter mnemonic word list");
setDescription("Generate or enter words");
showHideLink.setVisible(false);
setContent(getMnemonicWordsEntry(numWords));
setExpanded(true);

View file

@ -43,6 +43,12 @@ public class MnemonicWalletKeystoreImportPane extends MnemonicKeystorePane {
this.importer = importer;
}
@Override
protected void enterMnemonic(int numWords) {
super.enterMnemonic(numWords);
setDescription("Enter word list");
}
@Override
protected List<Node> createRightButtons() {
discoverButton = new Button("Discover Wallet");

View file

@ -18,7 +18,7 @@ public class Bip39 implements KeystoreMnemonicImport {
@Override
public String getKeystoreImportDescription() {
return "Import or generate your 12 to 24 word mnemonic and optional passphrase.";
return "Generate or import your 12 to 24 word mnemonic and optional passphrase.";
}
@Override