mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-05 05:46:44 +00:00
fix bug with trezor/keepkey keystore import, show hwi errors on all related dialogs
This commit is contained in:
parent
6ef5e79b39
commit
54680a5692
2 changed files with 17 additions and 29 deletions
|
@ -89,6 +89,8 @@ public abstract class DeviceDialog<R> extends Dialog<R> {
|
||||||
|
|
||||||
dialogPane.setPrefWidth(500);
|
dialogPane.setPrefWidth(500);
|
||||||
dialogPane.setPrefHeight(360);
|
dialogPane.setPrefHeight(360);
|
||||||
|
|
||||||
|
setResultConverter(dialogButton -> dialogButton == cancelButtonType ? null : getResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scan() {
|
private void scan() {
|
||||||
|
|
|
@ -73,18 +73,7 @@ public class DevicePane extends TitledDescriptionPane {
|
||||||
createSetPassphraseButton();
|
createSetPassphraseButton();
|
||||||
createImportButton();
|
createImportButton();
|
||||||
|
|
||||||
if(device.getError() != null) {
|
initialise(device);
|
||||||
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);
|
|
||||||
} else {
|
|
||||||
showOperationButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
buttonBox.getChildren().addAll(setPassphraseButton, importButton);
|
buttonBox.getChildren().addAll(setPassphraseButton, importButton);
|
||||||
}
|
}
|
||||||
|
@ -104,13 +93,7 @@ public class DevicePane extends TitledDescriptionPane {
|
||||||
createSetPassphraseButton();
|
createSetPassphraseButton();
|
||||||
createSignButton();
|
createSignButton();
|
||||||
|
|
||||||
if (device.getNeedsPinSent() != null && device.getNeedsPinSent()) {
|
initialise(device);
|
||||||
unlockButton.setVisible(true);
|
|
||||||
} else if(device.getNeedsPassphraseSent() != null && device.getNeedsPassphraseSent()) {
|
|
||||||
setPassphraseButton.setVisible(true);
|
|
||||||
} else {
|
|
||||||
showOperationButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
buttonBox.getChildren().addAll(setPassphraseButton, signButton);
|
buttonBox.getChildren().addAll(setPassphraseButton, signButton);
|
||||||
}
|
}
|
||||||
|
@ -130,13 +113,7 @@ public class DevicePane extends TitledDescriptionPane {
|
||||||
createSetPassphraseButton();
|
createSetPassphraseButton();
|
||||||
createDisplayAddressButton();
|
createDisplayAddressButton();
|
||||||
|
|
||||||
if (device.getNeedsPinSent() != null && device.getNeedsPinSent()) {
|
initialise(device);
|
||||||
unlockButton.setVisible(true);
|
|
||||||
} else if(device.getNeedsPassphraseSent() != null && device.getNeedsPassphraseSent()) {
|
|
||||||
setPassphraseButton.setVisible(true);
|
|
||||||
} else {
|
|
||||||
showOperationButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
buttonBox.getChildren().addAll(setPassphraseButton, displayAddressButton);
|
buttonBox.getChildren().addAll(setPassphraseButton, displayAddressButton);
|
||||||
}
|
}
|
||||||
|
@ -156,15 +133,24 @@ public class DevicePane extends TitledDescriptionPane {
|
||||||
createSetPassphraseButton();
|
createSetPassphraseButton();
|
||||||
createSignMessageButton();
|
createSignMessageButton();
|
||||||
|
|
||||||
|
initialise(device);
|
||||||
|
|
||||||
|
buttonBox.getChildren().addAll(setPassphraseButton, signMessageButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initialise(Device device) {
|
||||||
if(device.getNeedsPinSent() != null && device.getNeedsPinSent()) {
|
if(device.getNeedsPinSent() != null && device.getNeedsPinSent()) {
|
||||||
unlockButton.setVisible(true);
|
unlockButton.setVisible(true);
|
||||||
} else if(device.getNeedsPassphraseSent() != null && device.getNeedsPassphraseSent()) {
|
} else if(device.getNeedsPassphraseSent() != null && device.getNeedsPassphraseSent()) {
|
||||||
setPassphraseButton.setVisible(true);
|
setPassphraseButton.setVisible(true);
|
||||||
|
} else if(device.getError() != null) {
|
||||||
|
setError("Error", device.getError());
|
||||||
|
Platform.runLater(() -> {
|
||||||
|
setExpanded(true);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
showOperationButton();
|
showOperationButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
buttonBox.getChildren().addAll(setPassphraseButton, signMessageButton);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue