Skip to content

Commit

Permalink
Merge pull request #1765 from devinbileck/cancel-wallet-password-prompt
Browse files Browse the repository at this point in the history
Show cancel button in wallet password prompt
  • Loading branch information
ManfredKarrer authored Oct 10, 2018
2 parents d87bbf9 + 1d17954 commit 56965c1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion desktop/src/main/java/bisq/desktop/main/MainViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package bisq.desktop.main;

import bisq.desktop.app.BisqApp;
import bisq.desktop.common.model.ViewModel;
import bisq.desktop.components.BalanceWithConfirmationTextField;
import bisq.desktop.components.TxIdTextField;
Expand Down Expand Up @@ -291,7 +292,7 @@ private void setupHandlers() {
bisqSetup.setShowFirstPopupIfResyncSPVRequestedHandler(this::showFirstPopupIfResyncSPVRequested);
bisqSetup.setRequestWalletPasswordHandler(aesKeyHandler -> walletPasswordWindow
.onAesKey(aesKeyHandler::accept)
.hideCloseButton()
.onClose(() -> BisqApp.getShutDownHandler().run())
.show());

bisqSetup.setDisplayUpdateHandler((alert, key) -> new DisplayUpdateDownloadWindow(alert)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private void askForPassword() {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;


///////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -152,6 +153,11 @@ public WalletPasswordWindow onAesKey(AesKeyHandler aesKeyHandler) {
return this;
}

public WalletPasswordWindow hideForgotPasswordButton() {
this.hideForgotPasswordButton = true;
return this;
}

@Override
protected void cleanup() {
if (passwordTextField != null)
Expand Down Expand Up @@ -255,10 +261,12 @@ private void addButtons() {
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, cancelButton);
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);


Expand Down

0 comments on commit 56965c1

Please sign in to comment.