mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-03-14 18:06:34 -04:00
Add info popup for first time user at take offer screen
This commit is contained in:
parent
009a4daff3
commit
aa66d591ab
@ -22,6 +22,7 @@ import io.bitsquare.btc.FeePolicy;
|
||||
import io.bitsquare.btc.WalletFacade;
|
||||
import io.bitsquare.btc.listeners.BalanceListener;
|
||||
import io.bitsquare.gui.UIModel;
|
||||
import io.bitsquare.persistence.Persistence;
|
||||
import io.bitsquare.settings.Settings;
|
||||
import io.bitsquare.trade.Offer;
|
||||
import io.bitsquare.trade.Trade;
|
||||
@ -56,6 +57,7 @@ class TakeOfferModel extends UIModel {
|
||||
private final TradeManager tradeManager;
|
||||
private final WalletFacade walletFacade;
|
||||
private final Settings settings;
|
||||
private Persistence persistence;
|
||||
|
||||
private Offer offer;
|
||||
private AddressEntry addressEntry;
|
||||
@ -81,10 +83,11 @@ class TakeOfferModel extends UIModel {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Inject
|
||||
TakeOfferModel(TradeManager tradeManager, WalletFacade walletFacade, Settings settings) {
|
||||
TakeOfferModel(TradeManager tradeManager, WalletFacade walletFacade, Settings settings, Persistence persistence) {
|
||||
this.tradeManager = tradeManager;
|
||||
this.walletFacade = walletFacade;
|
||||
this.settings = settings;
|
||||
this.persistence = persistence;
|
||||
}
|
||||
|
||||
|
||||
@ -227,6 +230,13 @@ class TakeOfferModel extends UIModel {
|
||||
return true;
|
||||
}
|
||||
|
||||
Boolean displaySecurityDepositInfo() {
|
||||
Object securityDepositInfoDisplayedObject = persistence.read("displaySecurityDepositInfo");
|
||||
if (securityDepositInfoDisplayedObject instanceof Boolean)
|
||||
return (Boolean) securityDepositInfoDisplayedObject;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Setter
|
||||
|
@ -303,6 +303,10 @@ class TakeOfferPM extends PresentationModel<TakeOfferModel> {
|
||||
return paymentLabel;
|
||||
}
|
||||
|
||||
Boolean displaySecurityDepositInfo() {
|
||||
return model.displaySecurityDepositInfo();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Private
|
||||
|
@ -196,6 +196,23 @@ public class TakeOfferViewCB extends CachedViewCB<TakeOfferPM> {
|
||||
|
||||
@FXML
|
||||
void onTakeOffer() {
|
||||
if (presentationModel.displaySecurityDepositInfo()) {
|
||||
overlayManager.blurContent();
|
||||
List<Action> actions = new ArrayList<>();
|
||||
actions.add(new AbstractAction(BSResources.get("shared.close")) {
|
||||
@Override
|
||||
public void handle(ActionEvent actionEvent) {
|
||||
Dialog.Actions.CLOSE.handle(actionEvent);
|
||||
overlayManager.removeBlurContent();
|
||||
}
|
||||
});
|
||||
Popups.openInfo("To ensure that both traders behave fair they need to pay a security deposit.",
|
||||
"The deposit will stay in your local trading wallet until the offer gets accepted by " +
|
||||
"another trader. " +
|
||||
"\nIt will be refunded to you after the trade has successfully completed.",
|
||||
actions);
|
||||
}
|
||||
|
||||
presentationModel.takeOffer();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user