mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
improve bip39 keystore import labelling to indicate generation and import options
This commit is contained in:
parent
b640ffea44
commit
1a9c6f8f80
4 changed files with 12 additions and 6 deletions
|
@ -44,7 +44,7 @@ public class MnemonicKeystoreImportPane extends MnemonicKeystorePane {
|
||||||
private List<String> generatedMnemonicCode;
|
private List<String> generatedMnemonicCode;
|
||||||
|
|
||||||
public MnemonicKeystoreImportPane(Wallet wallet, KeystoreMnemonicImport importer) {
|
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.wallet = wallet;
|
||||||
this.importer = importer;
|
this.importer = importer;
|
||||||
|
|
||||||
|
|
|
@ -55,17 +55,17 @@ public class MnemonicKeystorePane extends TitledDescriptionPane {
|
||||||
private void createEnterMnemonicButton() {
|
private void createEnterMnemonicButton() {
|
||||||
enterMnemonicButton = new SplitMenuButton();
|
enterMnemonicButton = new SplitMenuButton();
|
||||||
enterMnemonicButton.setAlignment(Pos.CENTER_RIGHT);
|
enterMnemonicButton.setAlignment(Pos.CENTER_RIGHT);
|
||||||
enterMnemonicButton.setText("Enter 24 Words");
|
enterMnemonicButton.setText("Use 24 Words");
|
||||||
defaultWordSizeProperty = new SimpleIntegerProperty(24);
|
defaultWordSizeProperty = new SimpleIntegerProperty(24);
|
||||||
defaultWordSizeProperty.addListener((observable, oldValue, newValue) -> {
|
defaultWordSizeProperty.addListener((observable, oldValue, newValue) -> {
|
||||||
enterMnemonicButton.setText("Enter " + newValue + " Words");
|
enterMnemonicButton.setText("Use " + newValue + " Words");
|
||||||
});
|
});
|
||||||
enterMnemonicButton.setOnAction(event -> {
|
enterMnemonicButton.setOnAction(event -> {
|
||||||
enterMnemonic(defaultWordSizeProperty.get());
|
enterMnemonic(defaultWordSizeProperty.get());
|
||||||
});
|
});
|
||||||
int[] numberWords = new int[] {24, 21, 18, 15, 12};
|
int[] numberWords = new int[] {24, 21, 18, 15, 12};
|
||||||
for(int i = 0; i < numberWords.length; i++) {
|
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];
|
final int words = numberWords[i];
|
||||||
item.setOnAction(event -> {
|
item.setOnAction(event -> {
|
||||||
defaultWordSizeProperty.set(words);
|
defaultWordSizeProperty.set(words);
|
||||||
|
@ -77,7 +77,7 @@ public class MnemonicKeystorePane extends TitledDescriptionPane {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void enterMnemonic(int numWords) {
|
protected void enterMnemonic(int numWords) {
|
||||||
setDescription("Enter mnemonic word list");
|
setDescription("Generate or enter words");
|
||||||
showHideLink.setVisible(false);
|
showHideLink.setVisible(false);
|
||||||
setContent(getMnemonicWordsEntry(numWords));
|
setContent(getMnemonicWordsEntry(numWords));
|
||||||
setExpanded(true);
|
setExpanded(true);
|
||||||
|
|
|
@ -43,6 +43,12 @@ public class MnemonicWalletKeystoreImportPane extends MnemonicKeystorePane {
|
||||||
this.importer = importer;
|
this.importer = importer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void enterMnemonic(int numWords) {
|
||||||
|
super.enterMnemonic(numWords);
|
||||||
|
setDescription("Enter word list");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<Node> createRightButtons() {
|
protected List<Node> createRightButtons() {
|
||||||
discoverButton = new Button("Discover Wallet");
|
discoverButton = new Button("Discover Wallet");
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class Bip39 implements KeystoreMnemonicImport {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getKeystoreImportDescription() {
|
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
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue