improve script type descriptions and help text

This commit is contained in:
Craig Raw
2021-02-17 10:24:21 +02:00
parent 5abea8c594
commit ae2db6e204
3 changed files with 15 additions and 2 deletions
@@ -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);