From 1a9c6f8f8091eb38863df6a308e81bcd57435512 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 2 Mar 2022 17:01:13 +0200 Subject: [PATCH] improve bip39 keystore import labelling to indicate generation and import options --- .../sparrow/control/MnemonicKeystoreImportPane.java | 2 +- .../sparrow/control/MnemonicKeystorePane.java | 8 ++++---- .../sparrow/control/MnemonicWalletKeystoreImportPane.java | 6 ++++++ src/main/java/com/sparrowwallet/sparrow/io/Bip39.java | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/MnemonicKeystoreImportPane.java b/src/main/java/com/sparrowwallet/sparrow/control/MnemonicKeystoreImportPane.java index 19809f9d..66755ae8 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/MnemonicKeystoreImportPane.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/MnemonicKeystoreImportPane.java @@ -44,7 +44,7 @@ public class MnemonicKeystoreImportPane extends MnemonicKeystorePane { private List 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; diff --git a/src/main/java/com/sparrowwallet/sparrow/control/MnemonicKeystorePane.java b/src/main/java/com/sparrowwallet/sparrow/control/MnemonicKeystorePane.java index 85f557cc..79b514f2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/MnemonicKeystorePane.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/MnemonicKeystorePane.java @@ -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); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/MnemonicWalletKeystoreImportPane.java b/src/main/java/com/sparrowwallet/sparrow/control/MnemonicWalletKeystoreImportPane.java index 392bf21b..692cb360 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/MnemonicWalletKeystoreImportPane.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/MnemonicWalletKeystoreImportPane.java @@ -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 createRightButtons() { discoverButton = new Button("Discover Wallet"); diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Bip39.java b/src/main/java/com/sparrowwallet/sparrow/io/Bip39.java index e8b43f2c..9b679b4a 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Bip39.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Bip39.java @@ -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