Show information popup if more than one payment account is available for offer

I still used a popup as it is a more rare case that someone sets up multiple accounts of the same payment method for its first offer.
This commit is contained in:
Christoph Atteneder 2019-01-07 16:16:00 +01:00
parent 83a812a0f9
commit 2a79f1a8af
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B
2 changed files with 9 additions and 6 deletions

View file

@ -2028,6 +2028,9 @@ popup.attention.forTradeWithId=Attention required for trade with ID {0}
popup.roundedFiatValues.headline=New privacy feature: Rounded fiat values popup.roundedFiatValues.headline=New privacy feature: Rounded fiat values
popup.roundedFiatValues.msg=To increase privacy of your trade the {0} amount was rounded.\n\nDepending on the client version you''ll pay or receive either values with decimals or rounded ones.\n\nBoth values do comply from now on with the trade protocol.\n\nAlso be aware that BTC values are changed automatically to match the rounded fiat amount as close as possible. popup.roundedFiatValues.msg=To increase privacy of your trade the {0} amount was rounded.\n\nDepending on the client version you''ll pay or receive either values with decimals or rounded ones.\n\nBoth values do comply from now on with the trade protocol.\n\nAlso be aware that BTC values are changed automatically to match the rounded fiat amount as close as possible.
popup.info.multiplePaymentAccounts.headline=Multiple payment accounts available
popup.info.multiplePaymentAccounts.msg=You have multiple payment accounts available for this offer. Please make sure you've picked the right one.
#################################################################### ####################################################################
# Notifications # Notifications

View file

@ -282,17 +282,17 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
volumeDescriptionLabel.setText(model.volumeDescriptionLabel.get()); volumeDescriptionLabel.setText(model.volumeDescriptionLabel.get());
if (model.getPossiblePaymentAccounts().size() > 1) { if (model.getPossiblePaymentAccounts().size() > 1) {
new Popup<>().headLine(Res.get("popup.info.multiplePaymentAccounts.headline"))
.information(Res.get("popup.info.multiplePaymentAccounts.msg"))
.dontShowAgainId("MultiplePaymentAccountsAvailableWarning")
.show();
PaymentAccount lastPaymentAccount = model.getLastSelectedPaymentAccount(); PaymentAccount lastPaymentAccount = model.getLastSelectedPaymentAccount();
paymentAccountsComboBox.setItems(model.getPossiblePaymentAccounts()); paymentAccountsComboBox.setItems(model.getPossiblePaymentAccounts());
paymentAccountsComboBox.getSelectionModel().select(lastPaymentAccount); paymentAccountsComboBox.getSelectionModel().select(lastPaymentAccount);
model.onPaymentAccountSelected(lastPaymentAccount); model.onPaymentAccountSelected(lastPaymentAccount);
paymentAccountTitledGroupBg.setText(Res.get("shared.selectTradingAccount")); paymentAccountTitledGroupBg.setText(Res.get("shared.selectTradingAccount"));
// TODO if we have multiple payment accounts we should show some info/warning to
// make sure the user has selected the account he wants to use.
// To use a popup is not recommended as we have already 3 popups at the first time (if user has not clicked
// don't show again).
// @Christoph Maybe a similar warn triangle as used in create offer might work?
} }
balanceTextField.setTargetAmount(model.dataModel.getTotalToPayAsCoin().get()); balanceTextField.setTargetAmount(model.dataModel.getTotalToPayAsCoin().get());