Browse Source

dont allow double click to receive on whirlpool wallet

terminal
Craig Raw 3 years ago
parent
commit
4ebee8a8f3
  1. 26
      src/main/java/com/sparrowwallet/sparrow/control/AddressTreeTable.java

26
src/main/java/com/sparrowwallet/sparrow/control/AddressTreeTable.java

@ -68,21 +68,23 @@ public class AddressTreeTable extends CoinTreeTable {
} }
} }
setOnMouseClicked(mouseEvent -> { if(!rootEntry.getWallet().isWhirlpoolChildWallet()) {
if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){ setOnMouseClicked(mouseEvent -> {
if(mouseEvent.getClickCount() == 2) { if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){
TreeItem<Entry> treeItem = getSelectionModel().getSelectedItem(); if(mouseEvent.getClickCount() == 2) {
if(treeItem != null && treeItem.getChildren().isEmpty()) { TreeItem<Entry> treeItem = getSelectionModel().getSelectedItem();
Entry entry = getSelectionModel().getSelectedItem().getValue(); if(treeItem != null && treeItem.getChildren().isEmpty()) {
if(entry instanceof NodeEntry) { Entry entry = getSelectionModel().getSelectedItem().getValue();
NodeEntry nodeEntry = (NodeEntry)entry; if(entry instanceof NodeEntry) {
EventManager.get().post(new ReceiveActionEvent(nodeEntry)); NodeEntry nodeEntry = (NodeEntry)entry;
Platform.runLater(() -> EventManager.get().post(new ReceiveToEvent(nodeEntry))); EventManager.get().post(new ReceiveActionEvent(nodeEntry));
Platform.runLater(() -> EventManager.get().post(new ReceiveToEvent(nodeEntry)));
}
} }
} }
} }
} });
}); }
rootEntry.getChildren().addListener((ListChangeListener<Entry>) c -> { rootEntry.getChildren().addListener((ListChangeListener<Entry>) c -> {
this.refresh(); this.refresh();

Loading…
Cancel
Save