Hide the forgot password button in the SeedWordsView

This commit is contained in:
Devin Bileck 2018-10-09 00:14:43 -07:00
parent c76fd598cd
commit 1d179544f6
No known key found for this signature in database
GPG key ID: C86D829C2399D073
2 changed files with 13 additions and 5 deletions

View file

@ -203,7 +203,7 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
walletPasswordWindow.headLine(Res.get("account.seed.enterPw")).onAesKey(aesKey -> {
initSeedWords(walletsManager.getDecryptedSeed(aesKey, btcWalletService.getKeyChainSeed(), btcWalletService.getKeyCrypter()));
showSeedScreen();
}).show();
}).hideForgotPasswordButton().show();
}
private void initSeedWords(DeterministicSeed seed) {

View file

@ -104,6 +104,7 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
private ChangeListener<String> wordsTextAreaChangeListener;
private ChangeListener<Boolean> seedWordsValidChangeListener;
private LocalDate walletCreationDate;
private boolean hideForgotPasswordButton = false;
///////////////////////////////////////////////////////////////////////////////////////////
@ -152,6 +153,11 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
return this;
}
public WalletPasswordWindow hideForgotPasswordButton() {
this.hideForgotPasswordButton = true;
return this;
}
@Override
protected void cleanup() {
if (passwordTextField != null)
@ -255,10 +261,12 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
GridPane.setRowIndex(hBox, ++rowIndex);
GridPane.setColumnIndex(hBox, 1);
hBox.setAlignment(Pos.CENTER_LEFT);
if (hideCloseButton)
hBox.getChildren().addAll(unlockButton, forgotPasswordButton, busyAnimation, deriveStatusLabel);
else
hBox.getChildren().addAll(unlockButton, forgotPasswordButton, cancelButton, busyAnimation, deriveStatusLabel);
hBox.getChildren().add(unlockButton);
if (!hideForgotPasswordButton)
hBox.getChildren().add(forgotPasswordButton);
if (!hideCloseButton)
hBox.getChildren().add(cancelButton);
hBox.getChildren().addAll(busyAnimation, deriveStatusLabel);
gridPane.getChildren().add(hBox);