From 60686664152ffa20b48b979e9206298e99ab5ce8 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 1 Mar 2021 15:48:47 +0200 Subject: [PATCH] prompt to retry on invalid password --- src/main/java/com/sparrowwallet/sparrow/AppController.java | 5 ++++- src/main/resources/com/sparrowwallet/sparrow/general.css | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 94339d1f..41fa6ce2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -627,7 +627,10 @@ public class AppController implements Initializable { EventManager.get().post(new StorageEvent(storage.getWalletFile(), TimedEvent.Action.END, "Failed")); Throwable exception = loadWalletService.getException(); if(exception instanceof InvalidPasswordException) { - showErrorDialog("Invalid Password", "The wallet password was invalid."); + Optional optResponse = showErrorDialog("Invalid Password", "The wallet password was invalid. Try again?", ButtonType.CANCEL, ButtonType.OK); + if(optResponse.isPresent() && optResponse.get().equals(ButtonType.OK)) { + Platform.runLater(() -> openWalletFile(file, forceSameWindow)); + } } else { if(!attemptImportWallet(file, password)) { log.error("Error Opening Wallet", exception); diff --git a/src/main/resources/com/sparrowwallet/sparrow/general.css b/src/main/resources/com/sparrowwallet/sparrow/general.css index 34d9f17d..ecf8fbba 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/general.css +++ b/src/main/resources/com/sparrowwallet/sparrow/general.css @@ -163,4 +163,8 @@ .box-overlay { -fx-background-color: -fx-box-border, derive(-fx-background, 10%); -fx-effect: dropshadow(three-pass-box, #a0a1a7, 14, 0, 0, 0); +} + +.alert .content.label { + -fx-padding: 20px 20px 20px 20px; } \ No newline at end of file