diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java index e7271383..92df0031 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 selectAll; + @FXML private Button clear; @@ -194,6 +197,7 @@ public class UtxosController extends WalletFormController implements Initializab balance.setValue(walletUtxosEntry.getBalance()); mempoolBalance.setValue(walletUtxosEntry.getMempoolBalance()); utxoCount.setText(walletUtxosEntry.getChildren() != null ? Integer.toString(walletUtxosEntry.getChildren().size()) : "0"); + selectAll.setDisable(walletUtxosEntry.getChildren() == null || walletUtxosEntry.getChildren().size() == 0); } private boolean canWalletMix() { @@ -203,6 +207,7 @@ public class UtxosController extends WalletFormController implements Initializab private void updateButtons(BitcoinUnit unit) { List selectedEntries = getSelectedEntries(); + selectAll.setDisable(utxosTable.getRoot().getChildren().size() == utxosTable.getSelectionModel().getSelectedCells().size()); clear.setDisable(selectedEntries.isEmpty()); sendSelected.setDisable(selectedEntries.isEmpty()); mixSelected.setDisable(selectedEntries.isEmpty() || !AppServices.isConnected()); @@ -374,6 +379,10 @@ public class UtxosController extends WalletFormController implements Initializab .collect(Collectors.toList()); } + public void selectAll(ActionEvent event) { + utxosTable.getSelectionModel().selectAll(); + } + public void clear(ActionEvent event) { utxosTable.getSelectionModel().clearSelection(); } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java index 8ba450d3..16ab1bf3 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletForm.java @@ -213,7 +213,7 @@ public class WalletForm { private void updateWallets(Integer blockHeight, Wallet previousWallet) { List nestedHistoryChangedNodes = new ArrayList<>(); - for(Wallet childWallet : wallet.getChildWallets()) { + for(Wallet childWallet : new ArrayList<>(wallet.getChildWallets())) { if(childWallet.isNested()) { Wallet previousChildWallet = previousWallet.getChildWallet(childWallet.getName()); if(previousChildWallet != null) { diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/utxos.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/utxos.fxml index e607df05..c74f9f89 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/utxos.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/utxos.fxml @@ -83,6 +83,7 @@ +