Search in sources :

Example 1 with InputTextField

use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.

the class USPostalMoneyOrderForm method addFormForAddAccount.

@Override
public void addFormForAddAccount() {
    gridRowFrom = gridRow + 1;
    InputTextField holderNameInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Account holder name:").second;
    holderNameInputTextField.setValidator(inputValidator);
    holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        usPostalMoneyOrderAccount.setHolderName(newValue);
        updateFromInputs();
    });
    postalAddressTextArea = addLabelTextArea(gridPane, ++gridRow, "Postal address:", "").second;
    postalAddressTextArea.setPrefHeight(60);
    //postalAddressTextArea.setValidator(usPostalMoneyOrderValidator);
    postalAddressTextArea.textProperty().addListener((ov, oldValue, newValue) -> {
        usPostalMoneyOrderAccount.setPostalAddress(newValue);
        updateFromInputs();
    });
    addLabelTextField(gridPane, ++gridRow, "Currency:", usPostalMoneyOrderAccount.getSingleTradeCurrency().getNameAndCode());
    addAllowedPeriod();
    addAccountNameTextFieldWithAutoFillCheckBox();
}
Also used : InputTextField(io.bitsquare.gui.components.InputTextField)

Example 2 with InputTextField

use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.

the class InteracETransferForm method addFormForAddAccount.

@Override
public void addFormForAddAccount() {
    gridRowFrom = gridRow + 1;
    InputTextField holderNameInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Account holder name:").second;
    holderNameInputTextField.setValidator(inputValidator);
    holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        interacETransferAccount.setHolderName(newValue);
        updateFromInputs();
    });
    mobileNrInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Email or mobile nr:").second;
    mobileNrInputTextField.setValidator(interacETransferValidator);
    mobileNrInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        interacETransferAccount.setEmail(newValue);
        updateFromInputs();
    });
    questionInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Secret question:").second;
    questionInputTextField.setValidator(inputValidator);
    questionInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        interacETransferAccount.setQuestion(newValue);
        updateFromInputs();
    });
    answerInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Answer:").second;
    answerInputTextField.setValidator(inputValidator);
    answerInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        interacETransferAccount.setAnswer(newValue);
        updateFromInputs();
    });
    addLabelTextField(gridPane, ++gridRow, "Currency:", interacETransferAccount.getSingleTradeCurrency().getNameAndCode());
    addAllowedPeriod();
    addAccountNameTextFieldWithAutoFillCheckBox();
}
Also used : FormBuilder.addLabelInputTextField(io.bitsquare.gui.util.FormBuilder.addLabelInputTextField) InputTextField(io.bitsquare.gui.components.InputTextField)

Example 3 with InputTextField

use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.

the class SwishForm method addFormForAddAccount.

@Override
public void addFormForAddAccount() {
    gridRowFrom = gridRow + 1;
    InputTextField holderNameInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Account holder name:").second;
    holderNameInputTextField.setValidator(inputValidator);
    holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        swishAccount.setHolderName(newValue);
        updateFromInputs();
    });
    mobileNrInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Mobile no.:").second;
    mobileNrInputTextField.setValidator(swishValidator);
    mobileNrInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
        swishAccount.setMobileNr(newValue);
        updateFromInputs();
    });
    addLabelTextField(gridPane, ++gridRow, "Currency:", swishAccount.getSingleTradeCurrency().getNameAndCode());
    addAllowedPeriod();
    addAccountNameTextFieldWithAutoFillCheckBox();
}
Also used : FormBuilder.addLabelInputTextField(io.bitsquare.gui.util.FormBuilder.addLabelInputTextField) InputTextField(io.bitsquare.gui.components.InputTextField)

Example 4 with InputTextField

use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.

the class AddBitcoinNodesWindow method addContent.

private void addContent() {
    Label label = addLabel(gridPane, ++rowIndex, "For the best protection of your privacy is it recommended that you run your own Bitcoin core node.\n" + "You can run it locally (127.0.0.1) or hosted on a VPS.\n" + "You can edit that settings in \"Settings/Network info\".\n\n" + "If you prefer to use the public Bitcoin network your Bitcoin transactions might get de-anonymized by chain analysis companies operating full nodes to spy on Bitcoin users.\n\n" + "To learn more about that topic please read our FAQ on Bitsquare.io.");
    label.setWrapText(true);
    GridPane.setColumnSpan(label, 2);
    GridPane.setHalignment(label, HPos.LEFT);
    HyperlinkWithIcon hyperlinkWithIcon = new HyperlinkWithIcon("Open Bitsquare FAQ", AwesomeIcon.EXTERNAL_LINK);
    hyperlinkWithIcon.setOnAction(e -> GUIUtil.openWebPage("https://bitsquare.io/faq/#privacy_btc"));
    GridPane.setRowIndex(hyperlinkWithIcon, ++rowIndex);
    GridPane.setColumnIndex(hyperlinkWithIcon, 0);
    GridPane.setMargin(hyperlinkWithIcon, new Insets(0, 0, 0, -4));
    GridPane.setHalignment(hyperlinkWithIcon, HPos.LEFT);
    gridPane.getChildren().add(hyperlinkWithIcon);
    Tuple2<Label, InputTextField> labelInputTextFieldTuple2 = addLabelInputTextField(gridPane, ++rowIndex, "Add custom Bitcoin nodes:", 20);
    InputTextField input = labelInputTextFieldTuple2.second;
    input.setPromptText("Add comma separated IP addresses");
    if (!preferences.getBitcoinNodes().isEmpty())
        input.setText(preferences.getBitcoinNodes());
    Tuple2<Button, Button> tuple = add2Buttons(gridPane, ++rowIndex, "Save", "Ignore and use public Bitcoin network nodes");
    saveButton = tuple.first;
    saveButton.setOnAction(e -> {
        preferences.setBitcoinNodes(input.getText());
        hide();
        closeHandlerOptional.ifPresent(Runnable::run);
    });
    closeButton = tuple.second;
    closeButton.setOnAction(e -> {
        preferences.setBitcoinNodes("");
        hide();
        closeHandlerOptional.ifPresent(Runnable::run);
    });
    // Add some space
    ++rowIndex;
}
Also used : Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) InputTextField(io.bitsquare.gui.components.InputTextField) Label(javafx.scene.control.Label) HyperlinkWithIcon(io.bitsquare.gui.components.HyperlinkWithIcon)

Example 5 with InputTextField

use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.

the class SpendFromDepositTxWindow method addContent.

private void addContent() {
    InputTextField depositTxHex = addLabelInputTextField(gridPane, ++rowIndex, "depositTxHex:").second;
    InputTextField buyerPayoutAmount = addLabelInputTextField(gridPane, ++rowIndex, "buyerPayoutAmount:").second;
    InputTextField sellerPayoutAmount = addLabelInputTextField(gridPane, ++rowIndex, "sellerPayoutAmount:").second;
    InputTextField arbitratorPayoutAmount = addLabelInputTextField(gridPane, ++rowIndex, "arbitratorPayoutAmount:").second;
    InputTextField buyerAddressString = addLabelInputTextField(gridPane, ++rowIndex, "buyerAddressString:").second;
    InputTextField sellerAddressString = addLabelInputTextField(gridPane, ++rowIndex, "sellerAddressString:").second;
    InputTextField arbitratorAddressString = addLabelInputTextField(gridPane, ++rowIndex, "arbitratorAddressString:").second;
    InputTextField buyerPrivateKeyAsHex = addLabelInputTextField(gridPane, ++rowIndex, "buyerPrivateKeyAsHex:").second;
    InputTextField sellerPrivateKeyAsHex = addLabelInputTextField(gridPane, ++rowIndex, "sellerPrivateKeyAsHex:").second;
    InputTextField arbitratorPrivateKeyAsHex = addLabelInputTextField(gridPane, ++rowIndex, "arbitratorPrivateKeyAsHex:").second;
    InputTextField buyerPubKeyAsHex = addLabelInputTextField(gridPane, ++rowIndex, "buyerPubKeyAsHex:").second;
    InputTextField sellerPubKeyAsHex = addLabelInputTextField(gridPane, ++rowIndex, "sellerPubKeyAsHex:").second;
    InputTextField arbitratorPubKeyAsHex = addLabelInputTextField(gridPane, ++rowIndex, "arbitratorPubKeyAsHex:").second;
    InputTextField P2SHMultiSigOutputScript = addLabelInputTextField(gridPane, ++rowIndex, "P2SHMultiSigOutputScript:").second;
    // Notes: 
    // Open with alt+g and enable DEV mode
    // Priv key is only visible if pw protection is removed (wallet details data (alt+j))
    // Take P2SHMultiSigOutputScript from depositTx in blockexplorer 
    // Take missing buyerPubKeyAsHex and sellerPubKeyAsHex from contract data!
    // Lookup sellerPrivateKeyAsHex associated with sellerPubKeyAsHex (or buyers) in wallet details data 
    // sellerPubKeys/buyerPubKeys are auto generated if used the fields below
    // Never set the priv arbitr. key here!
    depositTxHex.setText("");
    P2SHMultiSigOutputScript.setText("");
    buyerPayoutAmount.setText("1.03");
    sellerPayoutAmount.setText("0.03");
    arbitratorPayoutAmount.setText("0");
    buyerAddressString.setText("");
    buyerPubKeyAsHex.setText("");
    buyerPrivateKeyAsHex.setText("");
    sellerAddressString.setText("");
    sellerPubKeyAsHex.setText("");
    sellerPrivateKeyAsHex.setText("");
    //4.9 (pkfcmj42c6es6tjt.onion)
    // arbitratorAddressString.setText("19xdeiQM2Hn2M2wbpT5imcYWzqhiSDHPy4");
    // arbitratorPubKeyAsHex.setText("02c62e794fe67f3a2115e2de4757143ff7f27bdf38aa4ae58a3595baa6d676875b");
    // 4.2 (ntjhaj27rylxwvnp.onion)
    arbitratorAddressString.setText("1FdFzBazmHQxbUbdCUJwuCtR37DrZrEobu");
    arbitratorPubKeyAsHex.setText("030fdc2ebc297df4047442f6079f1ce3b7d1938a41f88bd11497545cc94fcfd315");
    actionButtonText("Sign and publish transaction");
    FutureCallback<Transaction> callback = new FutureCallback<Transaction>() {

        @Override
        public void onSuccess(@Nullable Transaction result) {
            log.error("onSuccess");
            UserThread.execute(() -> {
                String txId = result != null ? result.getHashAsString() : "null";
                new Popup<>().information("Transaction successful published. Transaction ID: " + txId).show();
            });
        }

        @Override
        public void onFailure(Throwable t) {
            log.error(t.toString());
            log.error("onFailure");
            UserThread.execute(() -> new Popup<>().warning(t.toString()).show());
        }
    };
    onAction(() -> {
        try {
            tradeWalletService.emergencySignAndPublishPayoutTx(depositTxHex.getText(), Coin.parseCoin(buyerPayoutAmount.getText()), Coin.parseCoin(sellerPayoutAmount.getText()), Coin.parseCoin(arbitratorPayoutAmount.getText()), buyerAddressString.getText(), sellerAddressString.getText(), arbitratorAddressString.getText(), buyerPrivateKeyAsHex.getText(), sellerPrivateKeyAsHex.getText(), arbitratorPrivateKeyAsHex.getText(), buyerPubKeyAsHex.getText(), sellerPubKeyAsHex.getText(), arbitratorPubKeyAsHex.getText(), P2SHMultiSigOutputScript.getText(), callback);
        } catch (AddressFormatException | WalletException | TransactionVerificationException e) {
            log.error(e.toString());
            e.printStackTrace();
            UserThread.execute(() -> new Popup<>().warning(e.toString()).show());
        }
    });
}
Also used : WalletException(io.bitsquare.btc.exceptions.WalletException) AddressFormatException(org.bitcoinj.core.AddressFormatException) TransactionVerificationException(io.bitsquare.btc.exceptions.TransactionVerificationException) FormBuilder.addLabelInputTextField(io.bitsquare.gui.util.FormBuilder.addLabelInputTextField) InputTextField(io.bitsquare.gui.components.InputTextField) Transaction(org.bitcoinj.core.Transaction) Popup(io.bitsquare.gui.main.overlays.popups.Popup) FutureCallback(com.google.common.util.concurrent.FutureCallback) Nullable(javax.annotation.Nullable)

Aggregations

InputTextField (io.bitsquare.gui.components.InputTextField)16 Insets (javafx.geometry.Insets)8 Popup (io.bitsquare.gui.main.overlays.popups.Popup)6 FormBuilder.addLabelInputTextField (io.bitsquare.gui.util.FormBuilder.addLabelInputTextField)6 Button (javafx.scene.control.Button)6 Label (javafx.scene.control.Label)6 HBox (javafx.scene.layout.HBox)5 TextArea (javafx.scene.control.TextArea)2 Coin (org.bitcoinj.core.Coin)2 Transaction (org.bitcoinj.core.Transaction)2 FutureCallback (com.google.common.util.concurrent.FutureCallback)1 Alert (io.bitsquare.alert.Alert)1 PrivateNotification (io.bitsquare.alert.PrivateNotification)1 Dispute (io.bitsquare.arbitration.Dispute)1 AddressEntry (io.bitsquare.btc.AddressEntry)1 TransactionVerificationException (io.bitsquare.btc.exceptions.TransactionVerificationException)1 WalletException (io.bitsquare.btc.exceptions.WalletException)1 BalanceListener (io.bitsquare.btc.listeners.BalanceListener)1 PubKeyRing (io.bitsquare.common.crypto.PubKeyRing)1 Filter (io.bitsquare.filter.Filter)1