diff --git a/drongo b/drongo index 6135338d..687e235c 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 6135338df24589ce77584c57d470f2d8d44fa995 +Subproject commit 687e235c94ef181a8de6ee1fb9cf812d6e16c672 diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java index f7d5fdf8..c2f5453e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java @@ -31,6 +31,9 @@ public class KeystoreController extends WalletFormController implements Initiali @FXML private StackPane selectSourcePane; + @FXML + private ToggleGroup keystoreSourceToggleGroup; + @FXML private Label type; @@ -71,6 +74,8 @@ public class KeystoreController extends WalletFormController implements Initiali label.setText(keystore.getLabel()); + derivation.setPromptText(getWalletForm().getWallet().getScriptType().getDefaultDerivationPath()); + if(keystore.getExtendedPublicKey() != null) { xpub.setText(keystore.getExtendedPublicKey().toString()); } @@ -105,6 +110,7 @@ public class KeystoreController extends WalletFormController implements Initiali } public void selectSource(ActionEvent event) { + keystoreSourceToggleGroup.selectToggle(null); ToggleButton sourceButton = (ToggleButton)event.getSource(); KeystoreSource keystoreSource = (KeystoreSource)sourceButton.getUserData(); if(keystoreSource != KeystoreSource.SW_WATCH) { @@ -200,10 +206,13 @@ public class KeystoreController extends WalletFormController implements Initiali @Subscribe public void update(SettingsChangedEvent event) { - if(walletForm.getWallet().equals(event.getWallet()) && event.getType().equals(SettingsChangedEvent.Type.SCRIPT_TYPE) && !derivation.getText().isEmpty()) { - String derivationPath = derivation.getText(); - derivation.setText(derivationPath + " "); - derivation.setText(derivationPath); + if(walletForm.getWallet().equals(event.getWallet()) && event.getType().equals(SettingsChangedEvent.Type.SCRIPT_TYPE)) { + derivation.setPromptText(event.getWallet().getScriptType().getDefaultDerivationPath()); + if(!derivation.getText().isEmpty()) { + String derivationPath = derivation.getText(); + derivation.setText(derivationPath + " "); + derivation.setText(derivationPath); + } } } } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java index d4708590..e7a44c67 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SettingsController.java @@ -89,8 +89,8 @@ public class SettingsController extends WalletFormController implements Initiali policyType.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, policyType) -> { walletForm.getWallet().setPolicyType(policyType); - scriptType.setItems(FXCollections.observableArrayList(ScriptType.getScriptTypesForPolicyType(policyType))); - if(!ScriptType.getScriptTypesForPolicyType(policyType).contains(walletForm.getWallet().getScriptType())) { + scriptType.setItems(FXCollections.observableArrayList(ScriptType.getAddressableScriptTypes(policyType))); + if(!ScriptType.getAddressableScriptTypes(policyType).contains(walletForm.getWallet().getScriptType())) { scriptType.getSelectionModel().select(policyType.getDefaultScriptType()); } diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/keystore.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/keystore.fxml index d1cbe8d0..8b1494dd 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/keystore.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/keystore.fxml @@ -28,7 +28,7 @@ - + diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml index 31b1e686..3ac93dbe 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/settings.fxml @@ -42,7 +42,7 @@ - +