Skip to content

Commit

Permalink
Merge pull request #8 from ripcurlx/create-offer-improvements
Browse files Browse the repository at this point in the history
Improve restrictions settings in create offer
  • Loading branch information
ManfredKarrer authored Apr 30, 2019
2 parents 74344a8 + 961870a commit 649c28a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
9 changes: 7 additions & 2 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,14 @@ createOffer.warning.buyAboveMarketPrice=You will always pay {0}% more than the c
createOffer.tradeFee.descriptionBTCOnly=Trade fee
createOffer.tradeFee.descriptionBSQEnabled=Select trade fee currency
createOffer.tradeFee.fiatAndPercent=≈ {0} / {1} of trade amount
createOffer.takerRestriction.canSign=Require taker who can attest trade
createOffer.takerRestriction.canSign=Require taker who can attest trade (level silver or higher)
createOffer.takerRestriction.canSign.seller=Require seller who can attest trade (level silver or higher)
createOffer.takerRestriction.canSign.buyer=Require buyer who can attest trade (level silver or higher)
createOffer.takerRestriction.canSign.info=Having your payment account attested by an already attested account, removes your payout delay and other restrictions after four weeks and increases your account level to silver.
createOffer.takerRestriction.delay=Tolerate payout delay
createOffer.takerRestriction=Restriction for taker
createOffer.takerRestriction=Restrictions for taker
createOffer.takerRestriction.seller=Restrictions for seller
createOffer.takerRestriction.buyer=Restrictions for buyer

# new entries
createOffer.placeOfferButton=Review: Place offer to {0} bitcoin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,18 @@ public InfoAutoTooltipLabel(String text, GlyphIcons icon, ContentDisplay content
addIcon(contentDisplay, info, 300);
}


public InfoAutoTooltipLabel(String text, AwesomeIcon icon, ContentDisplay contentDisplay, String info, double width) {
super(text);

textIcon = getIcon(icon);
addIcon(contentDisplay, info, width);
}

public InfoAutoTooltipLabel(String text, AwesomeIcon icon, ContentDisplay contentDisplay, String info) {
this(text, icon, contentDisplay, info, 300);
}

private void addIcon(ContentDisplay contentDisplay, String info, double width) {
textIcon.setOpacity(0.4);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import bisq.desktop.components.BalanceTextField;
import bisq.desktop.components.BusyAnimation;
import bisq.desktop.components.FundsTextField;
import bisq.desktop.components.InfoAutoTooltipLabel;
import bisq.desktop.components.InfoInputTextField;
import bisq.desktop.components.InputTextField;
import bisq.desktop.components.NewBadge;
Expand Down Expand Up @@ -72,11 +73,13 @@
import net.glxn.qrgen.QRCode;
import net.glxn.qrgen.image.ImageType;

import de.jensd.fx.fontawesome.AwesomeIcon;
import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon;

import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Separator;
Expand Down Expand Up @@ -318,16 +321,21 @@ public void initWithData(OfferPayload.Direction direction, TradeCurrency tradeCu
placeOfferButton.setId("buy-button-big");
placeOfferButton.updateText(Res.get("createOffer.placeOfferButton", Res.get("shared.buy")));
percentagePriceDescription.setText(Res.get("shared.belowInPercent"));
takerRestrictionsLabel.setText(Res.get("createOffer.takerRestriction.seller"));
requireAuthorizedBuyerLabel.setText(Res.get("createOffer.takerRestriction.canSign.seller"));
} else {
placeOfferButton.setId("sell-button-big");
placeOfferButton.updateText(Res.get("createOffer.placeOfferButton", Res.get("shared.sell")));
percentagePriceDescription.setText(Res.get("shared.aboveInPercent"));
takerRestrictionsLabel.setText(Res.get("createOffer.takerRestriction.buyer"));
requireAuthorizedBuyerLabel.setText(Res.get("createOffer.takerRestriction.canSign.buyer"));
}

updatePriceToggle();

if (!model.getDataModel().isMakerFeeValid() && model.getDataModel().getMakerFee() != null)
showInsufficientBsqFundsForBtcFeePaymentPopup();

}

// called form parent as the view does not get notified when the tab is closed
Expand Down Expand Up @@ -867,6 +875,7 @@ private void createListeners() {
};

requireAuthorizedTakerToggleListener = (observable, oldValue, newValue) -> {
requireAuthorizedTakerToggle.setText(newValue ? Res.get("shared.yes") : Res.get("shared.no"));
model.getDataModel().setRequireAuthorizedTaker(newValue);
};

Expand Down Expand Up @@ -1492,12 +1501,14 @@ private VBox getTradeFeeFieldsBox() {
}

private VBox getTakerRestrictionFieldsBox() {
requireAuthorizedBuyerLabel = new Label(Res.get("createOffer.takerRestriction.canSign"));
requireAuthorizedBuyerLabel.setMouseTransparent(true);
requireAuthorizedBuyerLabel = new InfoAutoTooltipLabel(Res.get("createOffer.takerRestriction.canSign"),
AwesomeIcon.QUESTION_SIGN,
ContentDisplay.RIGHT,
Res.get("createOffer.takerRestriction.canSign.info"));
requireAuthorizedBuyerLabel.setId("trade-fee-textfield");

requireAuthorizedTakerToggle = new AutoTooltipSlideToggleButton();
requireAuthorizedTakerToggle.setText(Res.get("shared.yes"));
requireAuthorizedTakerToggle.setText(Res.get("shared.no"));
requireAuthorizedTakerToggle.setPadding(new Insets(-8, 5, -10, 5));

HBox hBox = new HBox();
Expand All @@ -1507,6 +1518,7 @@ private VBox getTakerRestrictionFieldsBox() {

final Tuple2<Label, VBox> tuple = getTradeInputBox(hBox, Res.get("createOffer.takerRestriction"));
takerRestrictionsLabel = tuple.first;
tuple.second.setSpacing(15);
return tuple.second;
}

Expand Down

0 comments on commit 649c28a

Please sign in to comment.