Browse Source

disable receive address field once used

terminal
Craig Raw 4 years ago
parent
commit
164742387f
  1. 3
      src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java
  2. 1
      src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml

3
src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java

@ -126,6 +126,7 @@ public class ReceiveController extends WalletFormController implements Initializ
lastUsed.setText("Never"); lastUsed.setText("Never");
lastUsed.setGraphic(getUnusedGlyph()); lastUsed.setGraphic(getUnusedGlyph());
address.getStyleClass().remove("error"); address.getStyleClass().remove("error");
address.setDisable(false);
} else if(!currentOutputs.isEmpty()) { } else if(!currentOutputs.isEmpty()) {
long count = currentOutputs.size(); long count = currentOutputs.size();
BlockTransactionHashIndex lastUsedReference = currentOutputs.stream().skip(count - 1).findFirst().get(); BlockTransactionHashIndex lastUsedReference = currentOutputs.stream().skip(count - 1).findFirst().get();
@ -133,11 +134,13 @@ public class ReceiveController extends WalletFormController implements Initializ
lastUsed.setGraphic(getWarningGlyph()); lastUsed.setGraphic(getWarningGlyph());
if(!address.getStyleClass().contains("error")) { if(!address.getStyleClass().contains("error")) {
address.getStyleClass().add("error"); address.getStyleClass().add("error");
address.setDisable(true);
} }
} else { } else {
lastUsed.setText("Unknown"); lastUsed.setText("Unknown");
lastUsed.setGraphic(null); lastUsed.setGraphic(null);
address.getStyleClass().remove("error"); address.getStyleClass().remove("error");
address.setDisable(false);
} }
} }

1
src/main/resources/com/sparrowwallet/sparrow/wallet/send.fxml

@ -9,7 +9,6 @@
<?import tornadofx.control.Fieldset?> <?import tornadofx.control.Fieldset?>
<?import tornadofx.control.Form?> <?import tornadofx.control.Form?>
<?import tornadofx.control.Field?> <?import tornadofx.control.Field?>
<?import com.sparrowwallet.sparrow.control.CopyableTextField?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import com.sparrowwallet.sparrow.control.CopyableLabel?> <?import com.sparrowwallet.sparrow.control.CopyableLabel?>

Loading…
Cancel
Save