mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Adapt navigation labels back to currency code
and fix lots of minor issues
This commit is contained in:
parent
497158ad13
commit
33725c2b4e
16 changed files with 69 additions and 55 deletions
|
@ -198,6 +198,7 @@ shared.openURL=Open {0}
|
||||||
shared.fiat=Fiat
|
shared.fiat=Fiat
|
||||||
shared.crypto=Crypto
|
shared.crypto=Crypto
|
||||||
shared.otherAssets=other assets
|
shared.otherAssets=other assets
|
||||||
|
shared.other=Other
|
||||||
shared.all=All
|
shared.all=All
|
||||||
shared.edit=Edit
|
shared.edit=Edit
|
||||||
shared.advancedOptions=Advanced options
|
shared.advancedOptions=Advanced options
|
||||||
|
@ -383,7 +384,6 @@ offerbook.createNewOffer=Create new offer to {0} {1}
|
||||||
offerbook.createOfferDisabled.tooltip=You can only create one offer at a time
|
offerbook.createOfferDisabled.tooltip=You can only create one offer at a time
|
||||||
|
|
||||||
offerbook.takeOfferButton.tooltip=Take offer for {0}
|
offerbook.takeOfferButton.tooltip=Take offer for {0}
|
||||||
offerbook.yesCreateOffer=Yes, create offer
|
|
||||||
offerbook.setupNewAccount=Set up a new trading account
|
offerbook.setupNewAccount=Set up a new trading account
|
||||||
offerbook.removeOffer.success=Remove offer was successful.
|
offerbook.removeOffer.success=Remove offer was successful.
|
||||||
offerbook.removeOffer.failed=Remove offer failed:\n{0}
|
offerbook.removeOffer.failed=Remove offer failed:\n{0}
|
||||||
|
|
|
@ -22,7 +22,6 @@ import bisq.desktop.common.view.FxmlView;
|
||||||
import bisq.desktop.common.view.ViewLoader;
|
import bisq.desktop.common.view.ViewLoader;
|
||||||
|
|
||||||
import bisq.core.offer.OfferDirection;
|
import bisq.core.offer.OfferDirection;
|
||||||
import bisq.core.support.dispute.arbitration.arbitrator.ArbitratorManager;
|
|
||||||
import bisq.core.user.Preferences;
|
import bisq.core.user.Preferences;
|
||||||
import bisq.core.user.User;
|
import bisq.core.user.User;
|
||||||
|
|
||||||
|
@ -37,7 +36,6 @@ public class BuyOfferView extends OfferView {
|
||||||
public BuyOfferView(ViewLoader viewLoader,
|
public BuyOfferView(ViewLoader viewLoader,
|
||||||
Navigation navigation,
|
Navigation navigation,
|
||||||
Preferences preferences,
|
Preferences preferences,
|
||||||
ArbitratorManager arbitratorManager,
|
|
||||||
User user,
|
User user,
|
||||||
P2PService p2PService) {
|
P2PService p2PService) {
|
||||||
super(viewLoader,
|
super(viewLoader,
|
||||||
|
|
|
@ -22,6 +22,7 @@ import bisq.desktop.common.view.ActivatableView;
|
||||||
import bisq.desktop.common.view.View;
|
import bisq.desktop.common.view.View;
|
||||||
import bisq.desktop.common.view.ViewLoader;
|
import bisq.desktop.common.view.ViewLoader;
|
||||||
import bisq.desktop.main.MainView;
|
import bisq.desktop.main.MainView;
|
||||||
|
import bisq.desktop.main.offer.bisq_v1.OfferViewUtil;
|
||||||
import bisq.desktop.main.offer.bisq_v1.createoffer.CreateOfferView;
|
import bisq.desktop.main.offer.bisq_v1.createoffer.CreateOfferView;
|
||||||
import bisq.desktop.main.offer.bisq_v1.takeoffer.TakeOfferView;
|
import bisq.desktop.main.offer.bisq_v1.takeoffer.TakeOfferView;
|
||||||
import bisq.desktop.main.offer.bsq_swap.create_offer.BsqSwapCreateOfferView;
|
import bisq.desktop.main.offer.bsq_swap.create_offer.BsqSwapCreateOfferView;
|
||||||
|
@ -31,13 +32,13 @@ import bisq.desktop.main.offer.offerbook.BsqOfferBookViewModel;
|
||||||
import bisq.desktop.main.offer.offerbook.BtcOfferBookView;
|
import bisq.desktop.main.offer.offerbook.BtcOfferBookView;
|
||||||
import bisq.desktop.main.offer.offerbook.OfferBookView;
|
import bisq.desktop.main.offer.offerbook.OfferBookView;
|
||||||
import bisq.desktop.main.offer.offerbook.OtherOfferBookView;
|
import bisq.desktop.main.offer.offerbook.OtherOfferBookView;
|
||||||
import bisq.desktop.main.offer.offerbook.OtherOfferBookViewModel;
|
|
||||||
import bisq.desktop.main.offer.offerbook.TopAltcoinOfferBookView;
|
import bisq.desktop.main.offer.offerbook.TopAltcoinOfferBookView;
|
||||||
import bisq.desktop.main.offer.offerbook.TopAltcoinOfferBookViewModel;
|
import bisq.desktop.main.offer.offerbook.TopAltcoinOfferBookViewModel;
|
||||||
import bisq.desktop.util.GUIUtil;
|
import bisq.desktop.util.GUIUtil;
|
||||||
|
|
||||||
import bisq.core.locale.CurrencyUtil;
|
import bisq.core.locale.CurrencyUtil;
|
||||||
import bisq.core.locale.GlobalSettings;
|
import bisq.core.locale.GlobalSettings;
|
||||||
|
import bisq.core.locale.Res;
|
||||||
import bisq.core.locale.TradeCurrency;
|
import bisq.core.locale.TradeCurrency;
|
||||||
import bisq.core.offer.Offer;
|
import bisq.core.offer.Offer;
|
||||||
import bisq.core.offer.OfferDirection;
|
import bisq.core.offer.OfferDirection;
|
||||||
|
@ -205,6 +206,7 @@ public abstract class OfferView extends ActivatableView<TabPane, Void> {
|
||||||
} else if (data instanceof BsqSwapOfferPayload) {
|
} else if (data instanceof BsqSwapOfferPayload) {
|
||||||
loadCreateViewClass(bsqOfferBookView, viewClass, childViewClass, bsqOfferBookTab, PaymentMethod.BSQ_SWAP, (BsqSwapOfferPayload) data);
|
loadCreateViewClass(bsqOfferBookView, viewClass, childViewClass, bsqOfferBookTab, PaymentMethod.BSQ_SWAP, (BsqSwapOfferPayload) data);
|
||||||
} else {
|
} else {
|
||||||
|
tradeCurrency = BsqOfferBookViewModel.BSQ;
|
||||||
loadCreateViewClass(bsqOfferBookView, viewClass, childViewClass, bsqOfferBookTab, (PaymentMethod) data, null);
|
loadCreateViewClass(bsqOfferBookView, viewClass, childViewClass, bsqOfferBookTab, (PaymentMethod) data, null);
|
||||||
}
|
}
|
||||||
tabPane.getSelectionModel().select(bsqOfferBookTab);
|
tabPane.getSelectionModel().select(bsqOfferBookTab);
|
||||||
|
@ -214,6 +216,7 @@ public abstract class OfferView extends ActivatableView<TabPane, Void> {
|
||||||
} else if (childViewClass == TakeOfferView.class) {
|
} else if (childViewClass == TakeOfferView.class) {
|
||||||
loadTakeViewClass(viewClass, childViewClass, topAltcoinOfferBookTab);
|
loadTakeViewClass(viewClass, childViewClass, topAltcoinOfferBookTab);
|
||||||
} else {
|
} else {
|
||||||
|
tradeCurrency = TopAltcoinOfferBookViewModel.TOP_ALTCOIN;
|
||||||
loadCreateViewClass(topAltcoinOfferBookView, viewClass, childViewClass, topAltcoinOfferBookTab, (PaymentMethod) data, null);
|
loadCreateViewClass(topAltcoinOfferBookView, viewClass, childViewClass, topAltcoinOfferBookTab, (PaymentMethod) data, null);
|
||||||
}
|
}
|
||||||
tabPane.getSelectionModel().select(topAltcoinOfferBookTab);
|
tabPane.getSelectionModel().select(topAltcoinOfferBookTab);
|
||||||
|
@ -228,21 +231,20 @@ public abstract class OfferView extends ActivatableView<TabPane, Void> {
|
||||||
Optional<TradeCurrency> tradeCurrencyOptional = (this.direction == OfferDirection.SELL) ?
|
Optional<TradeCurrency> tradeCurrencyOptional = (this.direction == OfferDirection.SELL) ?
|
||||||
CurrencyUtil.getTradeCurrency(preferences.getSellScreenCryptoCurrencyCode()) :
|
CurrencyUtil.getTradeCurrency(preferences.getSellScreenCryptoCurrencyCode()) :
|
||||||
CurrencyUtil.getTradeCurrency(preferences.getBuyScreenCryptoCurrencyCode());
|
CurrencyUtil.getTradeCurrency(preferences.getBuyScreenCryptoCurrencyCode());
|
||||||
tradeCurrency = tradeCurrencyOptional.isEmpty() ? OtherOfferBookViewModel.DEFAULT_ALTCOIN : tradeCurrencyOptional.get();
|
tradeCurrency = tradeCurrencyOptional.isEmpty() ? OfferViewUtil.getAnyOfMainCryptoCurrencies() : tradeCurrencyOptional.get();
|
||||||
}
|
}
|
||||||
loadCreateViewClass(otherOfferBookView, viewClass, childViewClass, otherOfferBookTab, (PaymentMethod) data, null);
|
loadCreateViewClass(otherOfferBookView, viewClass, childViewClass, otherOfferBookTab, (PaymentMethod) data, null);
|
||||||
}
|
}
|
||||||
tabPane.getSelectionModel().select(otherOfferBookTab);
|
tabPane.getSelectionModel().select(otherOfferBookTab);
|
||||||
} else {
|
} else {
|
||||||
if (btcOfferBookTab == null) {
|
if (btcOfferBookTab == null) {
|
||||||
//TODO: use naming from currencies or from translations
|
btcOfferBookTab = new Tab(Res.getBaseCurrencyName().toUpperCase());
|
||||||
btcOfferBookTab = new Tab("BITCOIN");
|
|
||||||
btcOfferBookTab.setClosable(false);
|
btcOfferBookTab.setClosable(false);
|
||||||
bsqOfferBookTab = new Tab("BSQ");
|
bsqOfferBookTab = new Tab(BsqOfferBookViewModel.BSQ.getCode());
|
||||||
bsqOfferBookTab.setClosable(false);
|
bsqOfferBookTab.setClosable(false);
|
||||||
topAltcoinOfferBookTab = new Tab("MONERO");
|
topAltcoinOfferBookTab = new Tab(TopAltcoinOfferBookViewModel.TOP_ALTCOIN.getCode());
|
||||||
topAltcoinOfferBookTab.setClosable(false);
|
topAltcoinOfferBookTab.setClosable(false);
|
||||||
otherOfferBookTab = new Tab("OTHER");
|
otherOfferBookTab = new Tab(Res.get("shared.other").toUpperCase());
|
||||||
otherOfferBookTab.setClosable(false);
|
otherOfferBookTab.setClosable(false);
|
||||||
|
|
||||||
tabPane.getTabs().addAll(btcOfferBookTab, bsqOfferBookTab, topAltcoinOfferBookTab, otherOfferBookTab);
|
tabPane.getTabs().addAll(btcOfferBookTab, bsqOfferBookTab, topAltcoinOfferBookTab, otherOfferBookTab);
|
||||||
|
|
|
@ -337,7 +337,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
|
||||||
if (CurrencyUtil.isFiatCurrency(tradeCurrency.getCode())) {
|
if (CurrencyUtil.isFiatCurrency(tradeCurrency.getCode())) {
|
||||||
placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.buy"));
|
placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.buy"));
|
||||||
} else {
|
} else {
|
||||||
placeOfferButtonLabel = Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.buy"), tradeCurrency.getName());
|
placeOfferButtonLabel = Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.buy"), tradeCurrency.getCode());
|
||||||
}
|
}
|
||||||
placeOfferButton.updateText(placeOfferButtonLabel);
|
placeOfferButton.updateText(placeOfferButtonLabel);
|
||||||
nextButton.setId("buy-button");
|
nextButton.setId("buy-button");
|
||||||
|
@ -347,7 +347,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
|
||||||
if (CurrencyUtil.isFiatCurrency(tradeCurrency.getCode())) {
|
if (CurrencyUtil.isFiatCurrency(tradeCurrency.getCode())) {
|
||||||
placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.sell"));
|
placeOfferButtonLabel = Res.get("createOffer.placeOfferButton", Res.get("shared.sell"));
|
||||||
} else {
|
} else {
|
||||||
placeOfferButtonLabel = Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.sell"), tradeCurrency.getName());
|
placeOfferButtonLabel = Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.sell"), tradeCurrency.getCode());
|
||||||
}
|
}
|
||||||
nextButton.setId("sell-button");
|
nextButton.setId("sell-button");
|
||||||
fundFromSavingsWalletButton.setId("sell-button");
|
fundFromSavingsWalletButton.setId("sell-button");
|
||||||
|
@ -793,10 +793,10 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
|
||||||
if (!CurrencyUtil.isFiatCurrency(newValue)) {
|
if (!CurrencyUtil.isFiatCurrency(newValue)) {
|
||||||
if (model.isShownAsBuyOffer()) {
|
if (model.isShownAsBuyOffer()) {
|
||||||
placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.buy"),
|
placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.buy"),
|
||||||
model.getTradeCurrency().getName()));
|
model.getTradeCurrency().getCode()));
|
||||||
} else {
|
} else {
|
||||||
placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.sell"),
|
placeOfferButton.updateText(Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.sell"),
|
||||||
model.getTradeCurrency().getName()));
|
model.getTradeCurrency().getCode()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,6 +24,8 @@ import bisq.desktop.components.HyperlinkWithIcon;
|
||||||
import bisq.desktop.main.MainView;
|
import bisq.desktop.main.MainView;
|
||||||
import bisq.desktop.main.offer.SellOfferView;
|
import bisq.desktop.main.offer.SellOfferView;
|
||||||
import bisq.desktop.main.offer.offerbook.BsqOfferBookView;
|
import bisq.desktop.main.offer.offerbook.BsqOfferBookView;
|
||||||
|
import bisq.desktop.main.offer.offerbook.BsqOfferBookViewModel;
|
||||||
|
import bisq.desktop.main.offer.offerbook.TopAltcoinOfferBookViewModel;
|
||||||
import bisq.desktop.main.overlays.popups.Popup;
|
import bisq.desktop.main.overlays.popups.Popup;
|
||||||
|
|
||||||
import bisq.core.locale.CurrencyUtil;
|
import bisq.core.locale.CurrencyUtil;
|
||||||
|
@ -46,6 +48,7 @@ import javafx.geometry.Pos;
|
||||||
import javafx.geometry.VPos;
|
import javafx.geometry.VPos;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
// Shared utils for Views
|
// Shared utils for Views
|
||||||
|
@ -133,4 +136,10 @@ public class OfferViewUtil {
|
||||||
public static boolean isShownAsBuyOffer(OfferDirection direction, TradeCurrency tradeCurrency) {
|
public static boolean isShownAsBuyOffer(OfferDirection direction, TradeCurrency tradeCurrency) {
|
||||||
return !isShownAsSellOffer(tradeCurrency.getCode(), direction);
|
return !isShownAsSellOffer(tradeCurrency.getCode(), direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TradeCurrency getAnyOfMainCryptoCurrencies() {
|
||||||
|
return CurrencyUtil.getMainCryptoCurrencies().stream().filter(cryptoCurrency ->
|
||||||
|
!Objects.equals(cryptoCurrency.getCode(), TopAltcoinOfferBookViewModel.TOP_ALTCOIN.getCode()) &&
|
||||||
|
!Objects.equals(cryptoCurrency.getCode(), BsqOfferBookViewModel.BSQ.getCode())).findAny().get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1351,7 +1351,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
Res.get("takeOffer.takeOfferButton", direction) :
|
Res.get("takeOffer.takeOfferButton", direction) :
|
||||||
Res.get("takeOffer.takeOfferButtonAltcoin",
|
Res.get("takeOffer.takeOfferButtonAltcoin",
|
||||||
direction,
|
direction,
|
||||||
CurrencyUtil.getNameByCode(offer.getCurrencyCode()));
|
offer.getCurrencyCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,9 @@ import bisq.desktop.components.TitledGroupBg;
|
||||||
import bisq.desktop.main.MainView;
|
import bisq.desktop.main.MainView;
|
||||||
import bisq.desktop.main.offer.OfferView;
|
import bisq.desktop.main.offer.OfferView;
|
||||||
import bisq.desktop.main.offer.SelectableView;
|
import bisq.desktop.main.offer.SelectableView;
|
||||||
|
import bisq.desktop.main.offer.bisq_v1.OfferViewUtil;
|
||||||
import bisq.desktop.main.offer.bsq_swap.BsqSwapOfferView;
|
import bisq.desktop.main.offer.bsq_swap.BsqSwapOfferView;
|
||||||
|
import bisq.desktop.main.offer.offerbook.BsqOfferBookViewModel;
|
||||||
import bisq.desktop.main.overlays.popups.Popup;
|
import bisq.desktop.main.overlays.popups.Popup;
|
||||||
import bisq.desktop.main.overlays.windows.BsqSwapOfferDetailsWindow;
|
import bisq.desktop.main.overlays.windows.BsqSwapOfferDetailsWindow;
|
||||||
import bisq.desktop.main.portfolio.PortfolioView;
|
import bisq.desktop.main.portfolio.PortfolioView;
|
||||||
|
@ -168,16 +170,21 @@ public class BsqSwapCreateOfferView extends BsqSwapOfferView<BsqSwapCreateOfferV
|
||||||
@Nullable BsqSwapOfferPayload offerPayload) {
|
@Nullable BsqSwapOfferPayload offerPayload) {
|
||||||
this.offerActionHandler = offerActionHandler;
|
this.offerActionHandler = offerActionHandler;
|
||||||
|
|
||||||
model.initWithData(offerPayload != null ? offerPayload.getDirection() : direction, offerPayload);
|
// Invert direction for non-Fiat trade currencies -> BUY BSQ is to SELL Bitcoin
|
||||||
|
OfferDirection offerDirection = direction == OfferDirection.BUY ? OfferDirection.SELL : OfferDirection.BUY;
|
||||||
|
|
||||||
if (model.dataModel.isBuyOffer()) {
|
model.initWithData(offerPayload != null ? offerPayload.getDirection() : offerDirection, offerPayload);
|
||||||
|
|
||||||
|
if (OfferViewUtil.isShownAsBuyOffer(offerDirection, BsqOfferBookViewModel.BSQ)) {
|
||||||
actionButton.setId("buy-button-big");
|
actionButton.setId("buy-button-big");
|
||||||
actionButton.updateText(Res.get("createOffer.placeOfferButton", Res.get("shared.buy")));
|
actionButton.updateText(Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.buy"), BSQ));
|
||||||
volumeDescriptionLabel.setText(Res.get("createOffer.amountPriceBox.buy.volumeDescription", BSQ));
|
nextButton.setId("buy-button");
|
||||||
|
volumeDescriptionLabel.setText(Res.get("createOffer.amountPriceBox.sell.volumeDescription", BSQ));
|
||||||
} else {
|
} else {
|
||||||
actionButton.setId("sell-button-big");
|
actionButton.setId("sell-button-big");
|
||||||
actionButton.updateText(Res.get("createOffer.placeOfferButton", Res.get("shared.sell")));
|
actionButton.updateText(Res.get("createOffer.placeOfferButtonAltcoin", Res.get("shared.sell"), BSQ));
|
||||||
volumeDescriptionLabel.setText(Res.get("createOffer.amountPriceBox.sell.volumeDescription", BSQ));
|
nextButton.setId("sell-button");
|
||||||
|
volumeDescriptionLabel.setText(Res.get("createOffer.amountPriceBox.buy.volumeDescription", BSQ));
|
||||||
}
|
}
|
||||||
|
|
||||||
String amountDescription = Res.get("createOffer.amountPriceBox.amountDescription",
|
String amountDescription = Res.get("createOffer.amountPriceBox.amountDescription",
|
||||||
|
|
|
@ -163,8 +163,8 @@ public class BsqSwapTakeOfferView extends BsqSwapOfferView<BsqSwapTakeOfferViewM
|
||||||
amountDescriptionLabel.setText(Res.get("takeOffer.amountPriceBox.sell.amountDescription"));
|
amountDescriptionLabel.setText(Res.get("takeOffer.amountPriceBox.sell.amountDescription"));
|
||||||
} else {
|
} else {
|
||||||
actionButton.setId("sell-button-big");
|
actionButton.setId("sell-button-big");
|
||||||
nextButton.setId("sell-button");
|
|
||||||
actionButton.updateText(Res.get("takeOffer.takeOfferButtonAltcoin", Res.get("shared.sell"), BSQ));
|
actionButton.updateText(Res.get("takeOffer.takeOfferButtonAltcoin", Res.get("shared.sell"), BSQ));
|
||||||
|
nextButton.setId("sell-button");
|
||||||
volumeDescriptionLabel.setText(Res.get("createOffer.amountPriceBox.sell.volumeDescription", BSQ));
|
volumeDescriptionLabel.setText(Res.get("createOffer.amountPriceBox.sell.volumeDescription", BSQ));
|
||||||
amountDescriptionLabel.setText(Res.get("takeOffer.amountPriceBox.buy.amountDescription"));
|
amountDescriptionLabel.setText(Res.get("takeOffer.amountPriceBox.buy.amountDescription"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,8 +58,8 @@ public class BsqOfferBookView extends OfferBookView<GridPane, BsqOfferBookViewMo
|
||||||
@Override
|
@Override
|
||||||
protected String getMarketTitle() {
|
protected String getMarketTitle() {
|
||||||
return model.getDirection().equals(OfferDirection.BUY) ?
|
return model.getDirection().equals(OfferDirection.BUY) ?
|
||||||
Res.get("offerbook.availableOffersToBuy", BsqOfferBookViewModel.BSQ.getCode(), Res.getBaseCurrencyName()) :
|
Res.get("offerbook.availableOffersToBuy", BsqOfferBookViewModel.BSQ.getCode(), Res.getBaseCurrencyCode()) :
|
||||||
Res.get("offerbook.availableOffersToSell", BsqOfferBookViewModel.BSQ.getCode(), Res.getBaseCurrencyName());
|
Res.get("offerbook.availableOffersToSell", BsqOfferBookViewModel.BSQ.getCode(), Res.getBaseCurrencyCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -73,7 +73,7 @@ public class BsqOfferBookView extends OfferBookView<GridPane, BsqOfferBookViewMo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String getCreateOfferButtonLabel() {
|
String getTradeCurrencyCode() {
|
||||||
return BsqOfferBookViewModel.BSQ.getCode();
|
return BsqOfferBookViewModel.BSQ.getCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,14 +56,14 @@ public class BtcOfferBookView extends OfferBookView<GridPane, BtcOfferBookViewMo
|
||||||
@Override
|
@Override
|
||||||
protected String getMarketTitle() {
|
protected String getMarketTitle() {
|
||||||
return model.getDirection().equals(OfferDirection.BUY) ?
|
return model.getDirection().equals(OfferDirection.BUY) ?
|
||||||
Res.get("offerbook.availableOffersToBuy", Res.getBaseCurrencyName(), Res.get("shared.fiat")) :
|
Res.get("offerbook.availableOffersToBuy", Res.getBaseCurrencyCode(), Res.get("shared.fiat")) :
|
||||||
Res.get("offerbook.availableOffersToSell", Res.getBaseCurrencyName(), Res.get("shared.fiat"));
|
Res.get("offerbook.availableOffersToSell", Res.getBaseCurrencyCode(), Res.get("shared.fiat"));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String getCreateOfferButtonLabel() {
|
String getTradeCurrencyCode() {
|
||||||
return Res.getBaseCurrencyName().toUpperCase();
|
return Res.getBaseCurrencyCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -289,7 +289,7 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
||||||
if (price2 == null || price1 == null) {
|
if (price2 == null || price1 == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (model.getDirection() == OfferDirection.SELL) {
|
if (OfferViewUtil.isShownAsSellOffer(model.getSelectedTradeCurrency().getCode(), model.getDirection())) {
|
||||||
return price1.compareTo(price2);
|
return price1.compareTo(price2);
|
||||||
} else {
|
} else {
|
||||||
return price2.compareTo(price1);
|
return price2.compareTo(price1);
|
||||||
|
@ -1292,8 +1292,8 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
||||||
private void updateCreateOfferButton() {
|
private void updateCreateOfferButton() {
|
||||||
createOfferButton.setText(Res.get("offerbook.createNewOffer",
|
createOfferButton.setText(Res.get("offerbook.createNewOffer",
|
||||||
model.getDirection() == OfferDirection.BUY ? Res.get("shared.buy") : Res.get("shared.sell"),
|
model.getDirection() == OfferDirection.BUY ? Res.get("shared.buy") : Res.get("shared.sell"),
|
||||||
getCreateOfferButtonLabel()).toUpperCase());
|
getTradeCurrencyCode()).toUpperCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract String getCreateOfferButtonLabel();
|
abstract String getTradeCurrencyCode();
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,12 +56,12 @@ public class OtherOfferBookView extends OfferBookView<GridPane, OtherOfferBookVi
|
||||||
@Override
|
@Override
|
||||||
protected String getMarketTitle() {
|
protected String getMarketTitle() {
|
||||||
return model.getDirection().equals(OfferDirection.BUY) ?
|
return model.getDirection().equals(OfferDirection.BUY) ?
|
||||||
Res.get("offerbook.availableOffersToBuy", Res.get("shared.otherAssets"), Res.getBaseCurrencyName()) :
|
Res.get("offerbook.availableOffersToBuy", Res.get("shared.otherAssets"), Res.getBaseCurrencyCode()) :
|
||||||
Res.get("offerbook.availableOffersToSell", Res.get("shared.otherAssets"), Res.getBaseCurrencyName());
|
Res.get("offerbook.availableOffersToSell", Res.get("shared.otherAssets"), Res.getBaseCurrencyCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String getCreateOfferButtonLabel() {
|
String getTradeCurrencyCode() {
|
||||||
return model.showAllTradeCurrenciesProperty.get() ? "" : model.getSelectedTradeCurrency().getName();
|
return model.showAllTradeCurrenciesProperty.get() ? "" : model.getSelectedTradeCurrency().getCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
package bisq.desktop.main.offer.offerbook;
|
package bisq.desktop.main.offer.offerbook;
|
||||||
|
|
||||||
import bisq.desktop.Navigation;
|
import bisq.desktop.Navigation;
|
||||||
|
import bisq.desktop.main.offer.bisq_v1.OfferViewUtil;
|
||||||
import bisq.desktop.util.GUIUtil;
|
import bisq.desktop.util.GUIUtil;
|
||||||
|
|
||||||
import bisq.core.account.witness.AccountAgeWitnessService;
|
import bisq.core.account.witness.AccountAgeWitnessService;
|
||||||
|
@ -58,8 +59,6 @@ import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class OtherOfferBookViewModel extends OfferBookViewModel {
|
public class OtherOfferBookViewModel extends OfferBookViewModel {
|
||||||
|
|
||||||
public static final TradeCurrency DEFAULT_ALTCOIN = CurrencyUtil.getTradeCurrency("ETH").get();
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public OtherOfferBookViewModel(User user,
|
public OtherOfferBookViewModel(User user,
|
||||||
OpenOfferManager openOfferManager,
|
OpenOfferManager openOfferManager,
|
||||||
|
@ -133,9 +132,9 @@ public class OtherOfferBookViewModel extends OfferBookViewModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
TradeCurrency getDefaultTradeCurrency() {
|
TradeCurrency getDefaultTradeCurrency() {
|
||||||
// select first currency in list, otherwise if view is not initialized add Ether as default one
|
// select first currency in list, otherwise if view is not initialized any of the main crypto currencies
|
||||||
return !getTradeCurrencies().isEmpty() ? getTradeCurrencies().get(1) :
|
return !getTradeCurrencies().isEmpty() ? getTradeCurrencies().get(1) :
|
||||||
DEFAULT_ALTCOIN;
|
OfferViewUtil.getAnyOfMainCryptoCurrencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -56,8 +56,8 @@ public class TopAltcoinOfferBookView extends OfferBookView<GridPane, TopAltcoinO
|
||||||
@Override
|
@Override
|
||||||
protected String getMarketTitle() {
|
protected String getMarketTitle() {
|
||||||
return model.getDirection().equals(OfferDirection.BUY) ?
|
return model.getDirection().equals(OfferDirection.BUY) ?
|
||||||
Res.get("offerbook.availableOffersToBuy", TopAltcoinOfferBookViewModel.TOP_ALTCOIN.getName(), Res.getBaseCurrencyName()) :
|
Res.get("offerbook.availableOffersToBuy", TopAltcoinOfferBookViewModel.TOP_ALTCOIN.getCode(), Res.getBaseCurrencyCode()) :
|
||||||
Res.get("offerbook.availableOffersToSell", TopAltcoinOfferBookViewModel.TOP_ALTCOIN.getName(), Res.getBaseCurrencyName());
|
Res.get("offerbook.availableOffersToSell", TopAltcoinOfferBookViewModel.TOP_ALTCOIN.getCode(), Res.getBaseCurrencyCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -71,7 +71,7 @@ public class TopAltcoinOfferBookView extends OfferBookView<GridPane, TopAltcoinO
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
String getCreateOfferButtonLabel() {
|
String getTradeCurrencyCode() {
|
||||||
return TopAltcoinOfferBookViewModel.TOP_ALTCOIN.getName();
|
return TopAltcoinOfferBookViewModel.TOP_ALTCOIN.getCode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ import bisq.desktop.main.overlays.Overlay;
|
||||||
import bisq.desktop.util.DisplayUtils;
|
import bisq.desktop.util.DisplayUtils;
|
||||||
import bisq.desktop.util.Layout;
|
import bisq.desktop.util.Layout;
|
||||||
|
|
||||||
import bisq.core.locale.CurrencyUtil;
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
import bisq.core.monetary.Price;
|
import bisq.core.monetary.Price;
|
||||||
import bisq.core.monetary.Volume;
|
import bisq.core.monetary.Volume;
|
||||||
|
@ -268,13 +267,13 @@ public class BsqSwapOfferDetailsWindow extends Overlay<BsqSwapOfferDetailsWindow
|
||||||
private void addConfirmAndCancelButtons(boolean isPlaceOffer) {
|
private void addConfirmAndCancelButtons(boolean isPlaceOffer) {
|
||||||
boolean isBuyOffer = OfferViewUtil.isShownAsBuyOffer(offer);
|
boolean isBuyOffer = OfferViewUtil.isShownAsBuyOffer(offer);
|
||||||
boolean isBuyerRole = isPlaceOffer == isBuyOffer;
|
boolean isBuyerRole = isPlaceOffer == isBuyOffer;
|
||||||
String tradeCurrencyByName = CurrencyUtil.getNameByCode(offer.getCurrencyCode());
|
String tradeCurrencyByCode = offer.getCurrencyCode();
|
||||||
String placeOfferButtonText = isBuyerRole ?
|
String placeOfferButtonText = isBuyerRole ?
|
||||||
Res.get("offerDetailsWindow.confirm.makerAltcoin", Res.get("shared.buy"), tradeCurrencyByName) :
|
Res.get("offerDetailsWindow.confirm.makerAltcoin", Res.get("shared.buy"), tradeCurrencyByCode) :
|
||||||
Res.get("offerDetailsWindow.confirm.makerAltcoin", Res.get("shared.sell"), tradeCurrencyByName);
|
Res.get("offerDetailsWindow.confirm.makerAltcoin", Res.get("shared.sell"), tradeCurrencyByCode);
|
||||||
String takeOfferButtonText = isBuyerRole ?
|
String takeOfferButtonText = isBuyerRole ?
|
||||||
Res.get("offerDetailsWindow.confirm.takerAltcoin", Res.get("shared.buy"), tradeCurrencyByName) :
|
Res.get("offerDetailsWindow.confirm.takerAltcoin", Res.get("shared.buy"), tradeCurrencyByCode) :
|
||||||
Res.get("offerDetailsWindow.confirm.takerAltcoin", Res.get("shared.sell"), tradeCurrencyByName);
|
Res.get("offerDetailsWindow.confirm.takerAltcoin", Res.get("shared.sell"), tradeCurrencyByCode);
|
||||||
|
|
||||||
ImageView iconView = new ImageView();
|
ImageView iconView = new ImageView();
|
||||||
iconView.setId(isBuyerRole ? "image-buy-white" : "image-sell-white");
|
iconView.setId(isBuyerRole ? "image-buy-white" : "image-sell-white");
|
||||||
|
|
|
@ -390,25 +390,25 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
|
||||||
private void addConfirmAndCancelButtons(boolean isPlaceOffer) {
|
private void addConfirmAndCancelButtons(boolean isPlaceOffer) {
|
||||||
boolean isBuyOffer = OfferViewUtil.isShownAsBuyOffer(offer);
|
boolean isBuyOffer = OfferViewUtil.isShownAsBuyOffer(offer);
|
||||||
boolean isBuyerRole = isPlaceOffer == isBuyOffer;
|
boolean isBuyerRole = isPlaceOffer == isBuyOffer;
|
||||||
String tradeCurrencyByName = CurrencyUtil.getNameByCode(offer.getCurrencyCode());
|
String tradeCurrencyByCode = offer.getCurrencyCode();
|
||||||
String placeOfferButtonText = isBuyerRole ?
|
String placeOfferButtonText = isBuyerRole ?
|
||||||
CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
|
CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
|
||||||
Res.get("offerDetailsWindow.confirm.maker", Res.get("shared.buy")) :
|
Res.get("offerDetailsWindow.confirm.maker", Res.get("shared.buy")) :
|
||||||
Res.get("offerDetailsWindow.confirm.makerAltcoin", Res.get("shared.buy"),
|
Res.get("offerDetailsWindow.confirm.makerAltcoin", Res.get("shared.buy"),
|
||||||
tradeCurrencyByName) :
|
tradeCurrencyByCode) :
|
||||||
CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
|
CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
|
||||||
Res.get("offerDetailsWindow.confirm.maker", Res.get("shared.sell")) :
|
Res.get("offerDetailsWindow.confirm.maker", Res.get("shared.sell")) :
|
||||||
Res.get("offerDetailsWindow.confirm.makerAltcoin", Res.get("shared.sell"),
|
Res.get("offerDetailsWindow.confirm.makerAltcoin", Res.get("shared.sell"),
|
||||||
tradeCurrencyByName);
|
tradeCurrencyByCode);
|
||||||
String takeOfferButtonText = isBuyerRole ?
|
String takeOfferButtonText = isBuyerRole ?
|
||||||
CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
|
CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
|
||||||
Res.get("offerDetailsWindow.confirm.taker", Res.get("shared.buy")) :
|
Res.get("offerDetailsWindow.confirm.taker", Res.get("shared.buy")) :
|
||||||
Res.get("offerDetailsWindow.confirm.takerAltcoin", Res.get("shared.buy"),
|
Res.get("offerDetailsWindow.confirm.takerAltcoin", Res.get("shared.buy"),
|
||||||
tradeCurrencyByName) :
|
tradeCurrencyByCode) :
|
||||||
CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
|
CurrencyUtil.isFiatCurrency(offer.getCurrencyCode()) ?
|
||||||
Res.get("offerDetailsWindow.confirm.taker", Res.get("shared.sell")) :
|
Res.get("offerDetailsWindow.confirm.taker", Res.get("shared.sell")) :
|
||||||
Res.get("offerDetailsWindow.confirm.takerAltcoin", Res.get("shared.sell"),
|
Res.get("offerDetailsWindow.confirm.takerAltcoin", Res.get("shared.sell"),
|
||||||
tradeCurrencyByName);
|
tradeCurrencyByCode);
|
||||||
|
|
||||||
ImageView iconView = new ImageView();
|
ImageView iconView = new ImageView();
|
||||||
iconView.setId(isBuyerRole ? "image-buy-white" : "image-sell-white");
|
iconView.setId(isBuyerRole ? "image-buy-white" : "image-sell-white");
|
||||||
|
|
Loading…
Add table
Reference in a new issue