From d5cccfaa664679c584acd877e1a558edcb236d23 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Tue, 15 Feb 2022 18:17:53 -0600 Subject: [PATCH] Show buyer/seller in terms of BTC --- .../main/overlays/windows/ContractWindow.java | 2 +- .../overlays/windows/OfferDetailsWindow.java | 2 +- .../java/bisq/desktop/util/DisplayUtils.java | 16 +++++----------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/ContractWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/ContractWindow.java index c1844428a05..80d37476c9d 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/ContractWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/ContractWindow.java @@ -157,7 +157,7 @@ private void addContent() { 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"), diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/OfferDetailsWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/OfferDetailsWindow.java index 55471788da6..a67be3fb433 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/OfferDetailsWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/OfferDetailsWindow.java @@ -203,7 +203,7 @@ private void addContent() { 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()) { diff --git a/desktop/src/main/java/bisq/desktop/util/DisplayUtils.java b/desktop/src/main/java/bisq/desktop/util/DisplayUtils.java index fb9674f9dd0..0542ce8fc4b 100644 --- a/desktop/src/main/java/bisq/desktop/util/DisplayUtils.java +++ b/desktop/src/main/java/bisq/desktop/util/DisplayUtils.java @@ -97,17 +97,11 @@ public static String getDirectionWithCode(OfferDirection direction, String curre 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) {