diff --git a/gui/src/main/java/io/bitsquare/gui/components/TextFieldWithCopyIcon.java b/gui/src/main/java/io/bitsquare/gui/components/TextFieldWithCopyIcon.java index ff6f5946d7..1a3c485965 100644 --- a/gui/src/main/java/io/bitsquare/gui/components/TextFieldWithCopyIcon.java +++ b/gui/src/main/java/io/bitsquare/gui/components/TextFieldWithCopyIcon.java @@ -27,9 +27,13 @@ import javafx.scene.control.TextField; import javafx.scene.control.Tooltip; import javafx.scene.layout.AnchorPane; +import java.util.function.Consumer; + public class TextFieldWithCopyIcon extends AnchorPane { private final StringProperty text = new SimpleStringProperty(); + private final TextField textField; + private Consumer handler; /////////////////////////////////////////////////////////////////////////////////////////// @@ -44,20 +48,26 @@ public class TextFieldWithCopyIcon extends AnchorPane { AwesomeDude.setIcon(copyIcon, AwesomeIcon.COPY); AnchorPane.setRightAnchor(copyIcon, 0.0); copyIcon.setOnMouseClicked(e -> { - if (getText() != null && getText().length() > 0) + if (getText() != null && getText().length() > 0) { Utilities.copyToClipboard(getText()); + if (handler != null) + handler.accept(getText()); + } }); - TextField txIdLabel = new TextField(); - txIdLabel.setEditable(false); - txIdLabel.textProperty().bindBidirectional(text); - AnchorPane.setRightAnchor(txIdLabel, 30.0); - AnchorPane.setLeftAnchor(txIdLabel, 0.0); - txIdLabel.focusTraversableProperty().set(focusTraversableProperty().get()); - focusedProperty().addListener((ov, oldValue, newValue) -> txIdLabel.requestFocus()); + textField = new TextField(); + textField.setEditable(false); + textField.textProperty().bindBidirectional(text); + AnchorPane.setRightAnchor(textField, 30.0); + AnchorPane.setLeftAnchor(textField, 0.0); + textField.focusTraversableProperty().set(focusTraversableProperty().get()); + focusedProperty().addListener((ov, oldValue, newValue) -> textField.requestFocus()); - getChildren().addAll(txIdLabel, copyIcon); + getChildren().addAll(textField, copyIcon); } + public void setPromptText(String value) { + textField.setPromptText(value); + } /////////////////////////////////////////////////////////////////////////////////////////// // Getter/Setter @@ -75,4 +85,7 @@ public class TextFieldWithCopyIcon extends AnchorPane { this.text.set(text); } + public void setHandler(Consumer handler) { + this.handler = handler; + } } diff --git a/gui/src/main/java/io/bitsquare/gui/main/offer/takeoffer/TakeOfferView.java b/gui/src/main/java/io/bitsquare/gui/main/offer/takeoffer/TakeOfferView.java index b441f077f5..78b05ed2db 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/offer/takeoffer/TakeOfferView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/offer/takeoffer/TakeOfferView.java @@ -22,13 +22,11 @@ import de.jensd.fx.fontawesome.AwesomeIcon; import io.bitsquare.app.BitsquareApp; import io.bitsquare.common.util.Tuple2; import io.bitsquare.common.util.Tuple3; +import io.bitsquare.common.util.Utilities; import io.bitsquare.gui.Navigation; import io.bitsquare.gui.common.view.ActivatableViewAndModel; import io.bitsquare.gui.common.view.FxmlView; -import io.bitsquare.gui.components.AddressTextField; -import io.bitsquare.gui.components.BalanceTextField; -import io.bitsquare.gui.components.InputTextField; -import io.bitsquare.gui.components.TitledGroupBg; +import io.bitsquare.gui.components.*; import io.bitsquare.gui.main.MainView; import io.bitsquare.gui.main.account.AccountView; import io.bitsquare.gui.main.account.content.arbitratorselection.ArbitratorSelectionView; @@ -79,11 +77,11 @@ public class TakeOfferView extends ActivatableViewAndModel amountFocusedListener; @@ -483,11 +481,15 @@ public class TakeOfferView extends ActivatableViewAndModel { + String[] strings = value.split(" "); + if (strings.length > 1) + Utilities.copyToClipboard(strings[0]); // exclude the BTC postfix + }); GridPane.setRowIndex(totalToPayTextField, gridRow); GridPane.setColumnIndex(totalToPayTextField, 1); GridPane.setMargin(totalToPayTextField, new Insets(Layout.FIRST_ROW_AND_GROUP_DISTANCE, 0, 0, 0)); diff --git a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/SellerSubView.java b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/SellerSubView.java index 554702ce31..70862ab6b6 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/SellerSubView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/SellerSubView.java @@ -101,7 +101,7 @@ public class SellerSubView extends TradeSubView { ((WaitTxInBlockchainView) tradeStepDetailsView).setInfoLabelText(BSResources.get("Deposit transaction has at least one blockchain " + "confirmation. " + - "Waiting that other trader starts the {0} payment.", + "Waiting that the bitcoin buyer starts the {0} payment.", model.getCurrencyCode())); break; case REQUEST_CONFIRM_FIAT_PAYMENT_RECEIVED: diff --git a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/ConfirmPaymentReceivedView.java b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/ConfirmPaymentReceivedView.java index ea9a9333ae..122f72aace 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/ConfirmPaymentReceivedView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/ConfirmPaymentReceivedView.java @@ -112,7 +112,7 @@ public class ConfirmPaymentReceivedView extends TradeStepDetailsView { String key = PopupId.PAYMENT_RECEIVED; if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE) { new Popup().headLine("Confirmation") - .message("Do you have received the payment from your trading partner?\n\n" + + .message("Did you receive the payment from your trading partner?\n\n" + "Please note that as soon you have confirmed the locked bitcoin will be released.\n" + "There is no way to reverse a bitcoin payment.") .dontShowAgainId(key, preferences) diff --git a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/StartPaymentView.java b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/StartPaymentView.java index 2c1d474987..19d19cc3b1 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/StartPaymentView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/StartPaymentView.java @@ -74,7 +74,7 @@ public class StartPaymentView extends TradeStepDetailsView { new Popup().information("You need to transfer now the agreed amount to your trading partner.\n" + "Please take care that you use the exact data presented here, including the reference text\n" + "Please do not click the \"Payment started\" button before you have completed the transfer.\n" + - "Take care that you make the transfer soon to not exceed the trading period.") + "Make sure that you make the transfer soon to not exceed the trading period.") .onClose(() -> preferences.dontShowAgain(key)) .show(); } @@ -144,7 +144,7 @@ public class StartPaymentView extends TradeStepDetailsView { String key = PopupId.PAYMENT_SENT; if (preferences.showAgain(key) && !BitsquareApp.DEV_MODE) { new Popup().headLine("Confirmation") - .message("Do you have transferred the payment to your trading partner?") + .message("Did you transfer the payment to your trading partner?") .dontShowAgainId(key, preferences) .actionButtonText("Yes I have started the payment") .closeButtonText("No") diff --git a/gui/src/main/resources/i18n/displayStrings.properties b/gui/src/main/resources/i18n/displayStrings.properties index 26ef90737b..bccbcb8b78 100644 --- a/gui/src/main/resources/i18n/displayStrings.properties +++ b/gui/src/main/resources/i18n/displayStrings.properties @@ -135,8 +135,7 @@ takeOffer.advancedBox.info=These are the offer restrictions your trading partner settings are matching those constraints and you are able to trade with him. takeOffer.success.headline=Your have successfully published the deposit. -takeOffer.success.info=You need to wait now for the bitcoin buyer to transfer the money to you. \nYou will get a \ - notification when he has started the EUR payment. You can see the status of your trade in the \"Portfolio\" screen \ +takeOffer.success.info=The trade has started now.\n You can see the status of your trade in the \"Portfolio\" screen \ under \"Open trades\". takeOffer.error.message=An error occurred when taking the offer.\n\n{0}