From 6aa3bb2ff33c54d33990396e457900d1e7136892 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 26 Apr 2022 16:03:49 +0200 Subject: [PATCH] disable clear button when no utxos are selected --- .../com/sparrowwallet/sparrow/wallet/UtxosController.java | 5 +++++ .../resources/com/sparrowwallet/sparrow/wallet/utxos.fxml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java index bac139a7..e7271383 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java @@ -83,6 +83,9 @@ public class UtxosController extends WalletFormController implements Initializab @FXML private Button mixTo; + @FXML + private Button clear; + @FXML private Button sendSelected; @@ -172,6 +175,7 @@ public class UtxosController extends WalletFormController implements Initializab } } + clear.setDisable(true); sendSelected.setDisable(true); sendSelected.setTooltip(new Tooltip("Send selected UTXOs. Use " + (org.controlsfx.tools.Platform.getCurrent() == org.controlsfx.tools.Platform.OSX ? "Cmd" : "Ctrl") + "+click to select multiple." )); mixSelected.managedProperty().bind(mixSelected.visibleProperty()); @@ -199,6 +203,7 @@ public class UtxosController extends WalletFormController implements Initializab private void updateButtons(BitcoinUnit unit) { List selectedEntries = getSelectedEntries(); + clear.setDisable(selectedEntries.isEmpty()); sendSelected.setDisable(selectedEntries.isEmpty()); mixSelected.setDisable(selectedEntries.isEmpty() || !AppServices.isConnected()); diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/utxos.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/utxos.fxml index a11fdb92..e607df05 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/utxos.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/utxos.fxml @@ -83,7 +83,7 @@ -