mirror of
https://github.com/bisq-network/bisq.git
synced 2025-03-01 01:32:17 +01:00
OfferBookChartView: Show ARS blue rate popup if selected
This commit is contained in:
parent
d0f4b46a5b
commit
10bf153263
2 changed files with 23 additions and 4 deletions
|
@ -5,6 +5,7 @@ import bisq.desktop.main.overlays.popups.Popup;
|
||||||
import bisq.core.locale.FiatCurrency;
|
import bisq.core.locale.FiatCurrency;
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
import bisq.core.locale.TradeCurrency;
|
import bisq.core.locale.TradeCurrency;
|
||||||
|
import bisq.core.user.DontShowAgainLookup;
|
||||||
|
|
||||||
public class ArsBlueRatePopup {
|
public class ArsBlueRatePopup {
|
||||||
public static boolean isTradeCurrencyArgentinePesos(TradeCurrency tradeCurrency) {
|
public static boolean isTradeCurrencyArgentinePesos(TradeCurrency tradeCurrency) {
|
||||||
|
@ -13,11 +14,22 @@ public class ArsBlueRatePopup {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void show() {
|
public static void show() {
|
||||||
new Popup()
|
createPopup().show();
|
||||||
.headLine(Res.get("popup.arsBlueMarket.title"))
|
}
|
||||||
.information(Res.get("popup.arsBlueMarket.info"))
|
|
||||||
.actionButtonText(Res.get("shared.iUnderstand"))
|
public static void showMaybe() {
|
||||||
.hideCloseButton()
|
String key = "arsBlueMarketNotificationPopup";
|
||||||
|
if (DontShowAgainLookup.showAgain(key)) {
|
||||||
|
createPopup().dontShowAgainId(key)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Popup createPopup() {
|
||||||
|
return new Popup()
|
||||||
|
.headLine(Res.get("popup.arsBlueMarket.title"))
|
||||||
|
.information(Res.get("popup.arsBlueMarket.info"))
|
||||||
|
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||||
|
.hideCloseButton();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import bisq.desktop.components.AutoTooltipTableColumn;
|
||||||
import bisq.desktop.components.AutocompleteComboBox;
|
import bisq.desktop.components.AutocompleteComboBox;
|
||||||
import bisq.desktop.components.ColoredDecimalPlacesWithZerosText;
|
import bisq.desktop.components.ColoredDecimalPlacesWithZerosText;
|
||||||
import bisq.desktop.components.PeerInfoIconSmall;
|
import bisq.desktop.components.PeerInfoIconSmall;
|
||||||
|
import bisq.desktop.components.paymentmethods.ArsBlueRatePopup;
|
||||||
import bisq.desktop.main.offer.offerbook.OfferBookListItem;
|
import bisq.desktop.main.offer.offerbook.OfferBookListItem;
|
||||||
import bisq.desktop.util.CurrencyListItem;
|
import bisq.desktop.util.CurrencyListItem;
|
||||||
import bisq.desktop.util.DisplayUtils;
|
import bisq.desktop.util.DisplayUtils;
|
||||||
|
@ -32,6 +33,7 @@ import bisq.desktop.util.GUIUtil;
|
||||||
|
|
||||||
import bisq.core.locale.CurrencyUtil;
|
import bisq.core.locale.CurrencyUtil;
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
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;
|
||||||
import bisq.core.util.FormattingUtils;
|
import bisq.core.util.FormattingUtils;
|
||||||
|
@ -203,8 +205,13 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
|
||||||
currencyComboBox.setOnChangeConfirmed(e -> {
|
currencyComboBox.setOnChangeConfirmed(e -> {
|
||||||
CurrencyListItem selectedItem = currencyComboBox.getSelectionModel().getSelectedItem();
|
CurrencyListItem selectedItem = currencyComboBox.getSelectionModel().getSelectedItem();
|
||||||
if (selectedItem != null) {
|
if (selectedItem != null) {
|
||||||
model.onSetTradeCurrency(selectedItem.tradeCurrency);
|
TradeCurrency selectedCurrency = selectedItem.tradeCurrency;
|
||||||
|
model.onSetTradeCurrency(selectedCurrency);
|
||||||
updateChartData();
|
updateChartData();
|
||||||
|
|
||||||
|
if (ArsBlueRatePopup.isTradeCurrencyArgentinePesos(selectedCurrency)) {
|
||||||
|
ArsBlueRatePopup.showMaybe();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue