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

View file

@ -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());

View file

@ -83,7 +83,7 @@
</HBox>
<Region HBox.hgrow="ALWAYS" />
<HBox styleClass="utxos-buttons-box" spacing="20" alignment="BOTTOM_RIGHT">
<Button text="Clear" onAction="#clear"/>
<Button fx:id="clear" text="Clear" onAction="#clear"/>
<Button fx:id="mixSelected" text="Mix Selected" graphicTextGap="5" onAction="#mixSelected">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" icon="RANDOM" fontSize="12" />