mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-20 10:22:18 +01:00
Use abstract method to apply TradeCurrency
This commit is contained in:
parent
d9b11ab647
commit
7e5e9cb588
@ -18,7 +18,6 @@
|
||||
package bisq.desktop.components.paymentmethods;
|
||||
|
||||
import bisq.desktop.components.InputTextField;
|
||||
import bisq.desktop.main.overlays.popups.Popup;
|
||||
import bisq.desktop.util.FormBuilder;
|
||||
import bisq.desktop.util.GUIUtil;
|
||||
import bisq.desktop.util.Layout;
|
||||
@ -364,20 +363,7 @@ abstract class BankForm extends GeneralBankForm {
|
||||
|
||||
private void onTradeCurrencySelected(TradeCurrency tradeCurrency) {
|
||||
FiatCurrency defaultCurrency = CurrencyUtil.getCurrencyByCountryCode(selectedCountry.code);
|
||||
if (!defaultCurrency.equals(tradeCurrency)) {
|
||||
new Popup<>().warning(Res.get("payment.foreign.currency"))
|
||||
.actionButtonText(Res.get("shared.yes"))
|
||||
.onAction(() -> {
|
||||
paymentAccount.setSingleTradeCurrency(tradeCurrency);
|
||||
autoFillNameTextField();
|
||||
})
|
||||
.closeButtonText(Res.get("payment.restore.default"))
|
||||
.onClose(() -> currencyComboBox.getSelectionModel().select(defaultCurrency))
|
||||
.show();
|
||||
} else {
|
||||
paymentAccount.setSingleTradeCurrency(tradeCurrency);
|
||||
autoFillNameTextField();
|
||||
}
|
||||
applyTradeCurrency(tradeCurrency, defaultCurrency);
|
||||
}
|
||||
|
||||
private CountryBasedPaymentAccount getCountryBasedPaymentAccount() {
|
||||
|
@ -18,7 +18,6 @@
|
||||
package bisq.desktop.components.paymentmethods;
|
||||
|
||||
import bisq.desktop.components.InputTextField;
|
||||
import bisq.desktop.main.overlays.popups.Popup;
|
||||
import bisq.desktop.util.FormBuilder;
|
||||
import bisq.desktop.util.GUIUtil;
|
||||
import bisq.desktop.util.Layout;
|
||||
@ -108,20 +107,7 @@ public class WesternUnionForm extends PaymentMethodForm {
|
||||
|
||||
private void onTradeCurrencySelected(TradeCurrency tradeCurrency) {
|
||||
FiatCurrency defaultCurrency = CurrencyUtil.getCurrencyByCountryCode(selectedCountry.code);
|
||||
if (!defaultCurrency.equals(tradeCurrency)) {
|
||||
new Popup<>().warning(Res.get("payment.foreign.currency"))
|
||||
.actionButtonText(Res.get("shared.yes"))
|
||||
.onAction(() -> {
|
||||
paymentAccount.setSingleTradeCurrency(tradeCurrency);
|
||||
autoFillNameTextField();
|
||||
})
|
||||
.closeButtonText(Res.get("payment.restore.default"))
|
||||
.onClose(() -> currencyComboBox.getSelectionModel().select(defaultCurrency))
|
||||
.show();
|
||||
} else {
|
||||
paymentAccount.setSingleTradeCurrency(tradeCurrency);
|
||||
autoFillNameTextField();
|
||||
}
|
||||
applyTradeCurrency(tradeCurrency, defaultCurrency);
|
||||
}
|
||||
|
||||
private void onCountrySelected(Country country) {
|
||||
|
Loading…
Reference in New Issue
Block a user