disable clear button when no utxos are selected

This commit is contained in:
Craig Raw
2022-04-26 16:03:49 +02:00
parent 516ee26ba0
commit 6aa3bb2ff3
2 changed files with 6 additions and 1 deletions
@@ -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<Entry> selectedEntries = getSelectedEntries();
clear.setDisable(selectedEntries.isEmpty());
sendSelected.setDisable(selectedEntries.isEmpty());
mixSelected.setDisable(selectedEntries.isEmpty() || !AppServices.isConnected());