From ae2db6e2045b52ac454a354d26a6871f78797d7d Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 17 Feb 2021 10:24:21 +0200 Subject: [PATCH] improve script type descriptions and help text --- drongo | 2 +- .../sparrow/wallet/SettingsController.java | 13 +++++++++++++ .../com/sparrowwallet/sparrow/wallet/settings.fxml | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drongo b/drongo index 3882a4b4..79216fac 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 3882a4b4bd9a738329bfffcaff72b477bb3a2d2f +Subproject commit 79216fac912724e7b06b3ffe15e38ddf005e665f diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java index 6ef1130e..71e8fd68 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java @@ -24,6 +24,7 @@ import javafx.fxml.FXMLLoader; import javafx.fxml.Initializable; import javafx.scene.control.*; import javafx.scene.layout.StackPane; +import javafx.util.StringConverter; import org.controlsfx.control.RangeSlider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -105,6 +106,18 @@ public class SettingsController extends WalletFormController implements Initiali } }); + scriptType.setConverter(new StringConverter<>() { + @Override + public String toString(ScriptType scriptType) { + return scriptType.getDescription(); + } + + @Override + public ScriptType fromString(String string) { + return ScriptType.fromDescriptor(string); + } + }); + scriptType.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, scriptType) -> { if(scriptType != null) { walletForm.getWallet().setScriptType(scriptType); diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml index 3834ac47..bcf7b8e8 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml @@ -57,7 +57,7 @@ - +