Show buyer/seller in terms of BTC

This commit is contained in:
jmacxx 2022-02-15 18:17:53 -06:00
parent d671b6805a
commit d5cccfaa66
No known key found for this signature in database
GPG Key ID: 155297BABFE94A1B
3 changed files with 7 additions and 13 deletions

View File

@ -157,7 +157,7 @@ public class ContractWindow extends Overlay<ContractWindow> {
DisplayUtils.formatDateTime(offer.getDate()) + " / " + DisplayUtils.formatDateTime(dispute.getTradeDate()));
String currencyCode = offer.getCurrencyCode();
addConfirmationLabelTextField(gridPane, ++rowIndex, Res.get("shared.offerType"),
DisplayUtils.getDirectionBothSides(offer.getDirection(), currencyCode));
DisplayUtils.getDirectionBothSides(offer.getDirection()));
addConfirmationLabelTextField(gridPane, ++rowIndex, Res.get("shared.tradePrice"),
FormattingUtils.formatPrice(contract.getTradePrice()));
addConfirmationLabelTextField(gridPane, ++rowIndex, Res.get("shared.tradeAmount"),

View File

@ -203,7 +203,7 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
btcDirectionInfo = direction == OfferDirection.BUY ? toReceive : toSpend;
} else {
addConfirmationLabelLabel(gridPane, rowIndex, offerTypeLabel,
DisplayUtils.getDirectionBothSides(direction, currencyCode), firstRowDistance);
DisplayUtils.getDirectionBothSides(direction), firstRowDistance);
}
String btcAmount = Res.get("shared.btcAmount");
if (takeOfferHandlerOptional.isPresent()) {

View File

@ -97,17 +97,11 @@ public class DisplayUtils {
return (direction == OfferDirection.SELL) ? Res.get("shared.buyCurrency", currencyCode) : Res.get("shared.sellCurrency", currencyCode);
}
public static String getDirectionBothSides(OfferDirection direction, String currencyCode) {
if (CurrencyUtil.isFiatCurrency(currencyCode)) {
currencyCode = Res.getBaseCurrencyCode();
return direction == OfferDirection.BUY ?
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.buyer"), currencyCode, Res.get("shared.seller")) :
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.seller"), currencyCode, Res.get("shared.buyer"));
} else {
return direction == OfferDirection.SELL ?
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.buyer"), currencyCode, Res.get("shared.seller")) :
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.seller"), currencyCode, Res.get("shared.buyer"));
}
public static String getDirectionBothSides(OfferDirection direction) {
String currencyCode = Res.getBaseCurrencyCode();
return direction == OfferDirection.BUY ?
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.buyer"), currencyCode, Res.get("shared.seller")) :
Res.get("formatter.makerTaker", currencyCode, Res.get("shared.seller"), currencyCode, Res.get("shared.buyer"));
}
public static String getDirectionForBuyer(boolean isMyOffer, String currencyCode) {