OfferBookChartView: Show ARS blue rate popup if selected

This commit is contained in:
Alva Swanson 2025-01-01 20:16:00 +00:00
parent d0f4b46a5b
commit 10bf153263
No known key found for this signature in database
GPG key ID: 004760E77F753090
2 changed files with 23 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import bisq.desktop.main.overlays.popups.Popup;
import bisq.core.locale.FiatCurrency;
import bisq.core.locale.Res;
import bisq.core.locale.TradeCurrency;
import bisq.core.user.DontShowAgainLookup;
public class ArsBlueRatePopup {
public static boolean isTradeCurrencyArgentinePesos(TradeCurrency tradeCurrency) {
@ -13,11 +14,22 @@ public class ArsBlueRatePopup {
}
public static void show() {
new Popup()
createPopup().show();
}
public static void showMaybe() {
String key = "arsBlueMarketNotificationPopup";
if (DontShowAgainLookup.showAgain(key)) {
createPopup().dontShowAgainId(key)
.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()
.show();
.hideCloseButton();
}
}

View file

@ -25,6 +25,7 @@ import bisq.desktop.components.AutoTooltipTableColumn;
import bisq.desktop.components.AutocompleteComboBox;
import bisq.desktop.components.ColoredDecimalPlacesWithZerosText;
import bisq.desktop.components.PeerInfoIconSmall;
import bisq.desktop.components.paymentmethods.ArsBlueRatePopup;
import bisq.desktop.main.offer.offerbook.OfferBookListItem;
import bisq.desktop.util.CurrencyListItem;
import bisq.desktop.util.DisplayUtils;
@ -32,6 +33,7 @@ import bisq.desktop.util.GUIUtil;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.Res;
import bisq.core.locale.TradeCurrency;
import bisq.core.offer.Offer;
import bisq.core.offer.OfferDirection;
import bisq.core.util.FormattingUtils;
@ -203,8 +205,13 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
currencyComboBox.setOnChangeConfirmed(e -> {
CurrencyListItem selectedItem = currencyComboBox.getSelectionModel().getSelectedItem();
if (selectedItem != null) {
model.onSetTradeCurrency(selectedItem.tradeCurrency);
TradeCurrency selectedCurrency = selectedItem.tradeCurrency;
model.onSetTradeCurrency(selectedCurrency);
updateChartData();
if (ArsBlueRatePopup.isTradeCurrencyArgentinePesos(selectedCurrency)) {
ArsBlueRatePopup.showMaybe();
}
}
});