Merge pull request #1765 from devinbileck/cancel-wallet-password-prompt

Show cancel button in wallet password prompt
This commit is contained in:
Manfred Karrer 2018-10-10 00:42:59 -05:00 committed by GitHub
commit 56965c1904
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View file

@ -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;
@ -291,7 +292,7 @@ public class MainViewModel implements ViewModel, BisqSetup.BisqSetupCompleteList
bisqSetup.setShowFirstPopupIfResyncSPVRequestedHandler(this::showFirstPopupIfResyncSPVRequested);
bisqSetup.setRequestWalletPasswordHandler(aesKeyHandler -> walletPasswordWindow
.onAesKey(aesKeyHandler::accept)
.hideCloseButton()
.onClose(() -> BisqApp.getShutDownHandler().run())
.show());
bisqSetup.setDisplayUpdateHandler((alert, key) -> new DisplayUpdateDownloadWindow(alert)

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, 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);