From d8b7938a630993989ea88b88a04a7523f38fa985 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 19 Nov 2020 12:54:12 +0200 Subject: [PATCH] show returned errors on hwi enumerate --- .../com/sparrowwallet/sparrow/control/DevicePane.java | 7 ++++++- src/main/java/com/sparrowwallet/sparrow/io/Device.java | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java b/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java index 411a07f6..7a95080d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/DevicePane.java @@ -73,7 +73,12 @@ public class DevicePane extends TitledDescriptionPane { createSetPassphraseButton(); createImportButton(); - if (device.getNeedsPinSent() != null && device.getNeedsPinSent()) { + if(device.getError() != null) { + setError("Error", device.getError()); + Platform.runLater(() -> { + setExpanded(true); + }); + } else if(device.getNeedsPinSent() != null && device.getNeedsPinSent()) { unlockButton.setVisible(true); } else if(device.getNeedsPassphraseSent() != null && device.getNeedsPassphraseSent()) { setPassphraseButton.setVisible(true); diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Device.java b/src/main/java/com/sparrowwallet/sparrow/io/Device.java index ba6c4480..e9ec17bb 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Device.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Device.java @@ -11,6 +11,7 @@ public class Device { private Boolean needsPinSent; private Boolean needsPassphraseSent; private String fingerprint; + private String error; public String getType() { return type; @@ -60,6 +61,14 @@ public class Device { this.fingerprint = fingerprint; } + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + public String toString() { return getModel() + ":" + getPath(); }