mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 13:16:44 +00:00
hide spend and freeze context menu items on address cell in utxo table
This commit is contained in:
parent
0260a12663
commit
63b27e7054
2 changed files with 4 additions and 4 deletions
|
@ -40,7 +40,7 @@ public class AddressCell extends TreeTableCell<Entry, UtxoEntry.AddressStatus> {
|
||||||
if(utxoEntry != null) {
|
if(utxoEntry != null) {
|
||||||
Address address = addressStatus.getAddress();
|
Address address = addressStatus.getAddress();
|
||||||
setText(address.toString());
|
setText(address.toString());
|
||||||
setContextMenu(new EntryCell.AddressContextMenu(address, utxoEntry.getOutputDescriptor(), new NodeEntry(utxoEntry.getWallet(), utxoEntry.getNode())));
|
setContextMenu(new EntryCell.AddressContextMenu(address, utxoEntry.getOutputDescriptor(), new NodeEntry(utxoEntry.getWallet(), utxoEntry.getNode()), false));
|
||||||
Tooltip tooltip = new Tooltip();
|
Tooltip tooltip = new Tooltip();
|
||||||
tooltip.setShowDelay(Duration.millis(250));
|
tooltip.setShowDelay(Duration.millis(250));
|
||||||
tooltip.setText(getTooltipText(utxoEntry, addressStatus.isDuplicate(), addressStatus.isDustAttack()));
|
tooltip.setText(getTooltipText(utxoEntry, addressStatus.isDuplicate(), addressStatus.isDustAttack()));
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class EntryCell extends TreeTableCell<Entry, Entry> {
|
||||||
NodeEntry nodeEntry = (NodeEntry)entry;
|
NodeEntry nodeEntry = (NodeEntry)entry;
|
||||||
Address address = nodeEntry.getAddress();
|
Address address = nodeEntry.getAddress();
|
||||||
setText(address.toString());
|
setText(address.toString());
|
||||||
setContextMenu(new AddressContextMenu(address, nodeEntry.getOutputDescriptor(), nodeEntry));
|
setContextMenu(new AddressContextMenu(address, nodeEntry.getOutputDescriptor(), nodeEntry, true));
|
||||||
Tooltip tooltip = new Tooltip();
|
Tooltip tooltip = new Tooltip();
|
||||||
tooltip.setShowDelay(Duration.millis(250));
|
tooltip.setShowDelay(Duration.millis(250));
|
||||||
tooltip.setText(nodeEntry.getNode().toString());
|
tooltip.setText(nodeEntry.getNode().toString());
|
||||||
|
@ -568,7 +568,7 @@ public class EntryCell extends TreeTableCell<Entry, Entry> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class AddressContextMenu extends ContextMenu {
|
public static class AddressContextMenu extends ContextMenu {
|
||||||
public AddressContextMenu(Address address, String outputDescriptor, NodeEntry nodeEntry) {
|
public AddressContextMenu(Address address, String outputDescriptor, NodeEntry nodeEntry, boolean addUtxoItems) {
|
||||||
if(nodeEntry == null || !nodeEntry.getWallet().isBip47()) {
|
if(nodeEntry == null || !nodeEntry.getWallet().isBip47()) {
|
||||||
MenuItem receiveToAddress = new MenuItem("Receive To");
|
MenuItem receiveToAddress = new MenuItem("Receive To");
|
||||||
receiveToAddress.setGraphic(getReceiveGlyph());
|
receiveToAddress.setGraphic(getReceiveGlyph());
|
||||||
|
@ -591,7 +591,7 @@ public class EntryCell extends TreeTableCell<Entry, Entry> {
|
||||||
getItems().add(signVerifyMessage);
|
getItems().add(signVerifyMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nodeEntry != null && !nodeEntry.getNode().getUnspentTransactionOutputs().isEmpty()) {
|
if(addUtxoItems && nodeEntry != null && !nodeEntry.getNode().getUnspentTransactionOutputs().isEmpty()) {
|
||||||
List<BlockTransactionHashIndex> utxos = nodeEntry.getNode().getUnspentTransactionOutputs().stream().collect(Collectors.toList());
|
List<BlockTransactionHashIndex> utxos = nodeEntry.getNode().getUnspentTransactionOutputs().stream().collect(Collectors.toList());
|
||||||
MenuItem spendUtxos = new MenuItem("Spend UTXOs");
|
MenuItem spendUtxos = new MenuItem("Spend UTXOs");
|
||||||
spendUtxos.setGraphic(getSendGlyph());
|
spendUtxos.setGraphic(getSendGlyph());
|
||||||
|
|
Loading…
Reference in a new issue