From 31346e2afa304893b72e6fac059fbf917141acc6 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 18 Apr 2024 13:22:50 +0200 Subject: [PATCH] add mix selected button to the postmix account in desktop and terminal --- drongo | 2 +- .../sparrow/terminal/wallet/UtxosDialog.java | 9 ++++++++- .../sparrowwallet/sparrow/wallet/UtxosController.java | 5 +++++ .../sparrowwallet/sparrow/wallet/WalletUtxosEntry.java | 4 +++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/drongo b/drongo index 42de5702..3f4ee7af 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 42de57026c2c2d8f0feaa2e7a9db33e4decc617f +Subproject commit 3f4ee7af747b80976cda8ebd3c687b6a4ba5ea3f diff --git a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/UtxosDialog.java b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/UtxosDialog.java index 69da47c3..c6c4ac36 100644 --- a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/UtxosDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/UtxosDialog.java @@ -166,7 +166,14 @@ public class UtxosDialog extends WalletDialog { AppServices.onlineProperty().addListener(new WeakChangeListener<>(mixingOnlineListener)); - buttonPanel.addComponent(new EmptySpace(new TerminalSize(15, 1))); + if(WhirlpoolServices.canWalletMix(getWalletForm().getWallet())) { + mixSelected = new Button("Mix Selected", this::mixSelected); + mixSelected.setEnabled(false); + buttonPanel.addComponent(mixSelected); + } else { + buttonPanel.addComponent(new EmptySpace(new TerminalSize(15, 1))); + } + buttonPanel.addComponent(new Button("Back", () -> onBack(Function.UTXOS))); buttonPanel.addComponent(new Button("Refresh", this::onRefresh)); } else { diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java index 40716505..cd90aa71 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/UtxosController.java @@ -179,6 +179,11 @@ public class UtxosController extends WalletFormController implements Initializab } } + selectAll.managedProperty().bind(selectAll.visibleProperty()); + selectAll.setVisible(getWalletForm().getWallet().getStandardAccountType() != StandardAccount.WHIRLPOOL_POSTMIX); + clear.managedProperty().bind(clear.visibleProperty()); + clear.setVisible(getWalletForm().getWallet().getStandardAccountType() != StandardAccount.WHIRLPOOL_POSTMIX); + 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." )); diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletUtxosEntry.java b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletUtxosEntry.java index 4b6f4ca0..1e480e23 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/WalletUtxosEntry.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/WalletUtxosEntry.java @@ -18,7 +18,9 @@ public class WalletUtxosEntry extends Entry { super(wallet, wallet.getName(), wallet.getWalletUtxos().entrySet().stream().map(entry -> new UtxoEntry(entry.getValue().getWallet(), entry.getKey(), HashIndexEntry.Type.OUTPUT, entry.getValue())).collect(Collectors.toList())); calculateDuplicates(); calculateDust(); - updateMixProgress(); + if(wallet.isWhirlpoolMixWallet()) { + updateMixProgress(); + } } @Override