From 1d179544f6df43a49aad1d2db9779ef5e97bad01 Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Tue, 9 Oct 2018 00:14:43 -0700 Subject: [PATCH] Hide the forgot password button in the SeedWordsView --- .../account/content/seedwords/SeedWordsView.java | 2 +- .../overlays/windows/WalletPasswordWindow.java | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/seedwords/SeedWordsView.java b/desktop/src/main/java/bisq/desktop/main/account/content/seedwords/SeedWordsView.java index 663a545575..08c824a12c 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/seedwords/SeedWordsView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/seedwords/SeedWordsView.java @@ -203,7 +203,7 @@ public class SeedWordsView extends ActivatableView { 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) { diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java index 7a475e7067..08db0cdbe8 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java @@ -104,6 +104,7 @@ public class WalletPasswordWindow extends Overlay { private ChangeListener wordsTextAreaChangeListener; private ChangeListener seedWordsValidChangeListener; private LocalDate walletCreationDate; + private boolean hideForgotPasswordButton = false; /////////////////////////////////////////////////////////////////////////////////////////// @@ -152,6 +153,11 @@ public class WalletPasswordWindow extends Overlay { 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 { 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);