indicate number of utxos selected in utxos tab

This commit is contained in:
Craig Raw 2022-07-14 14:49:25 +02:00
parent 486027f153
commit 0be73efdc1
3 changed files with 9 additions and 3 deletions

2
drongo

@ -1 +1 @@
Subproject commit 6d0d5b7f62781c15f16d4ce0b6e27d2298122d1e Subproject commit 377843a4a5a3b00fc6267e8aaeeff86e6899ce46

View file

@ -1634,7 +1634,7 @@ public class SendController extends WalletFormController implements Initializabl
} }
private class PrivacyAnalysisTooltip extends VBox { private class PrivacyAnalysisTooltip extends VBox {
private List<Label> analysisLabels = new ArrayList<>(); private final List<Label> analysisLabels = new ArrayList<>();
public PrivacyAnalysisTooltip(WalletTransaction walletTransaction) { public PrivacyAnalysisTooltip(WalletTransaction walletTransaction) {
List<Payment> payments = walletTransaction.getPayments(); List<Payment> payments = walletTransaction.getPayments();

View file

@ -190,16 +190,22 @@ public class UtxosController extends WalletFormController implements Initializab
List<Entry> selectedEntries = utxosTable.getSelectionModel().getSelectedCells().stream().filter(tp -> tp.getTreeItem() != null).map(tp -> tp.getTreeItem().getValue()).collect(Collectors.toList()); List<Entry> selectedEntries = utxosTable.getSelectionModel().getSelectedCells().stream().filter(tp -> tp.getTreeItem() != null).map(tp -> tp.getTreeItem().getValue()).collect(Collectors.toList());
utxosChart.select(selectedEntries); utxosChart.select(selectedEntries);
updateButtons(Config.get().getBitcoinUnit()); updateButtons(Config.get().getBitcoinUnit());
updateUtxoCount(getWalletForm().getWalletUtxosEntry());
}); });
} }
private void updateFields(WalletUtxosEntry walletUtxosEntry) { private void updateFields(WalletUtxosEntry walletUtxosEntry) {
balance.setValue(walletUtxosEntry.getBalance()); balance.setValue(walletUtxosEntry.getBalance());
mempoolBalance.setValue(walletUtxosEntry.getMempoolBalance()); mempoolBalance.setValue(walletUtxosEntry.getMempoolBalance());
utxoCount.setText(walletUtxosEntry.getChildren() != null ? Integer.toString(walletUtxosEntry.getChildren().size()) : "0"); updateUtxoCount(walletUtxosEntry);
selectAll.setDisable(walletUtxosEntry.getChildren() == null || walletUtxosEntry.getChildren().size() == 0); selectAll.setDisable(walletUtxosEntry.getChildren() == null || walletUtxosEntry.getChildren().size() == 0);
} }
private void updateUtxoCount(WalletUtxosEntry walletUtxosEntry) {
int selectedCount = utxosTable.getSelectionModel().getSelectedCells().size();
utxoCount.setText((selectedCount > 0 ? selectedCount + "/" : "") + (walletUtxosEntry.getChildren() != null ? Integer.toString(walletUtxosEntry.getChildren().size()) : "0"));
}
private boolean canWalletMix() { private boolean canWalletMix() {
return WhirlpoolServices.canWalletMix(getWalletForm().getWallet()); return WhirlpoolServices.canWalletMix(getWalletForm().getWallet());
} }