mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-06-22 05:44:31 -04:00
Use altcoin name when setting up the address for the cryptocurrency account
This commit is contained in:
parent
71a7d8c910
commit
007a71cc29
1 changed files with 16 additions and 2 deletions
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package io.bitsquare.gui.components.paymentmethods;
|
package io.bitsquare.gui.components.paymentmethods;
|
||||||
|
|
||||||
|
import io.bitsquare.common.util.Tuple2;
|
||||||
import io.bitsquare.gui.components.InputTextField;
|
import io.bitsquare.gui.components.InputTextField;
|
||||||
import io.bitsquare.gui.util.BSFormatter;
|
import io.bitsquare.gui.util.BSFormatter;
|
||||||
import io.bitsquare.gui.util.Layout;
|
import io.bitsquare.gui.util.Layout;
|
||||||
|
@ -31,6 +32,7 @@ import io.bitsquare.payment.PaymentAccount;
|
||||||
import io.bitsquare.payment.PaymentAccountContractData;
|
import io.bitsquare.payment.PaymentAccountContractData;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.scene.control.ComboBox;
|
import javafx.scene.control.ComboBox;
|
||||||
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.TextField;
|
import javafx.scene.control.TextField;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.util.StringConverter;
|
import javafx.util.StringConverter;
|
||||||
|
@ -48,6 +50,7 @@ public class BlockChainForm extends PaymentMethodForm {
|
||||||
private InputTextField addressInputTextField;
|
private InputTextField addressInputTextField;
|
||||||
|
|
||||||
private ComboBox<TradeCurrency> currencyComboBox;
|
private ComboBox<TradeCurrency> currencyComboBox;
|
||||||
|
private Label addressLabel;
|
||||||
|
|
||||||
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountContractData paymentAccountContractData) {
|
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountContractData paymentAccountContractData) {
|
||||||
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, "Cryptocurrency address:", ((CryptoCurrencyAccountContractData) paymentAccountContractData).getAddress());
|
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, "Cryptocurrency address:", ((CryptoCurrencyAccountContractData) paymentAccountContractData).getAddress());
|
||||||
|
@ -70,7 +73,9 @@ public class BlockChainForm extends PaymentMethodForm {
|
||||||
|
|
||||||
addTradeCurrencyComboBox();
|
addTradeCurrencyComboBox();
|
||||||
currencyComboBox.setPrefWidth(250);
|
currencyComboBox.setPrefWidth(250);
|
||||||
addressInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Cryptocurrency address:").second;
|
Tuple2<Label, InputTextField> tuple2 = addLabelInputTextField(gridPane, ++gridRow, "Cryptocurrency address:");
|
||||||
|
addressLabel = tuple2.first;
|
||||||
|
addressInputTextField = tuple2.second;
|
||||||
addressInputTextField.setValidator(altCoinAddressValidator);
|
addressInputTextField.setValidator(altCoinAddressValidator);
|
||||||
|
|
||||||
addressInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
addressInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||||
|
@ -82,6 +87,13 @@ public class BlockChainForm extends PaymentMethodForm {
|
||||||
addAccountNameTextFieldWithAutoFillCheckBox();
|
addAccountNameTextFieldWithAutoFillCheckBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFromInputs() {
|
||||||
|
if (addressLabel != null && cryptoCurrencyAccount.getSingleTradeCurrency() != null)
|
||||||
|
addressLabel.setText(cryptoCurrencyAccount.getSingleTradeCurrency().getName() + " address:");
|
||||||
|
super.updateFromInputs();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void autoFillNameTextField() {
|
protected void autoFillNameTextField() {
|
||||||
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
|
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
|
||||||
|
@ -98,7 +110,9 @@ public class BlockChainForm extends PaymentMethodForm {
|
||||||
gridRowFrom = gridRow;
|
gridRowFrom = gridRow;
|
||||||
addLabelTextField(gridPane, gridRow, "Account name:", cryptoCurrencyAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
|
addLabelTextField(gridPane, gridRow, "Account name:", cryptoCurrencyAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
|
||||||
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(cryptoCurrencyAccount.getPaymentMethod().getId()));
|
addLabelTextField(gridPane, ++gridRow, "Payment method:", BSResources.get(cryptoCurrencyAccount.getPaymentMethod().getId()));
|
||||||
TextField field = addLabelTextField(gridPane, ++gridRow, "Cryptocurrency address:", cryptoCurrencyAccount.getAddress()).second;
|
Tuple2<Label, TextField> tuple2 = addLabelTextField(gridPane, ++gridRow, "Cryptocurrency address:", cryptoCurrencyAccount.getAddress());
|
||||||
|
addressLabel = tuple2.first;
|
||||||
|
TextField field = tuple2.second;
|
||||||
field.setMouseTransparent(false);
|
field.setMouseTransparent(false);
|
||||||
addLabelTextField(gridPane, ++gridRow, "Cryptocurrency:", cryptoCurrencyAccount.getSingleTradeCurrency().getNameAndCode());
|
addLabelTextField(gridPane, ++gridRow, "Cryptocurrency:", cryptoCurrencyAccount.getSingleTradeCurrency().getNameAndCode());
|
||||||
addAllowedPeriod();
|
addAllowedPeriod();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue