Remove redundant popup

This commit is contained in:
chimp1984 2020-12-20 18:54:32 -05:00
parent 99184567b3
commit 4050644677
No known key found for this signature in database
GPG Key ID: 9801B4EC591F90E3
4 changed files with 13 additions and 28 deletions

View File

@ -458,7 +458,6 @@ createOffer.tradeFee.fiatAndPercent=≈ {0} / {1} of trade amount
# new entries
createOffer.placeOfferButton=Review: Place offer to {0} bitcoin
createOffer.alreadyFunded=You had already funded that offer.\nYour funds have been moved to your local Bisq wallet and are available for withdrawal in the \"Funds/Send funds\" screen.
createOffer.createOfferFundWalletInfo.headline=Fund your offer
# suppress inspection "TrailingSpacesInProperty"
createOffer.createOfferFundWalletInfo.tradeAmount=- Trade amount: {0} \n
@ -519,7 +518,6 @@ takeOffer.error.message=An error occurred when taking the offer.\n\n{0}
# new entries
takeOffer.takeOfferButton=Review: Take offer to {0} bitcoin
takeOffer.noPriceFeedAvailable=You cannot take that offer as it uses a percentage price based on the market price but there is no price feed available.
takeOffer.alreadyFunded.movedFunds=You had already funded that offer.\nYour funds have been moved to your local Bisq wallet and are available for withdrawal in the \"Funds/Send funds\" screen.
takeOffer.takeOfferFundWalletInfo.headline=Fund your trade
# suppress inspection "TrailingSpacesInProperty"
takeOffer.takeOfferFundWalletInfo.tradeAmount=- Trade amount: {0} \n

View File

@ -35,8 +35,6 @@ import bisq.desktop.main.account.content.fiataccounts.FiatAccountsView;
import bisq.desktop.main.dao.DaoView;
import bisq.desktop.main.dao.wallet.BsqWalletView;
import bisq.desktop.main.dao.wallet.receive.BsqReceiveView;
import bisq.desktop.main.funds.FundsView;
import bisq.desktop.main.funds.withdrawal.WithdrawalView;
import bisq.desktop.main.overlays.notifications.Notification;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.main.overlays.windows.OfferDetailsWindow;
@ -328,14 +326,6 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
// we use model.placeOfferCompleted to not react on close which was triggered by a successful placeOffer
if (model.getDataModel().getBalance().get().isPositive() && !model.placeOfferCompleted.get()) {
model.getDataModel().swapTradeToSavings();
String key = "CreateOfferCancelAndFunded";
if (preferences.showAgain(key)) {
new Popup().information(Res.get("createOffer.alreadyFunded"))
.actionButtonTextWithGoTo("navigation.funds.availableForWithdrawal")
.onAction(() -> navigation.navigateTo(MainView.class, FundsView.class, WithdrawalView.class))
.dontShowAgainId(key)
.show();
}
}
}
@ -1239,14 +1229,17 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
fundingHBox.getChildren().add(cancelButton2);
cancelButton2.setOnAction(e -> {
if (model.getDataModel().getIsBtcWalletFunded().get()) {
new Popup().warning(Res.get("createOffer.warnCancelOffer"))
String key = "CreateOfferCancelAndFunded";
if (model.getDataModel().getIsBtcWalletFunded().get() &&
preferences.showAgain(key)) {
new Popup().backgroundInfo(Res.get("createOffer.warnCancelOffer"))
.closeButtonText(Res.get("shared.no"))
.actionButtonText(Res.get("shared.yesCancel"))
.onAction(() -> {
close();
model.getDataModel().swapTradeToSavings();
})
.dontShowAgainId(key)
.show();
} else {
close();

View File

@ -87,7 +87,7 @@ class TakeOfferDataModel extends OfferDataModel {
private final User user;
private final FeeService feeService;
private final FilterManager filterManager;
private final Preferences preferences;
final Preferences preferences;
private final TxFeeEstimationService txFeeEstimationService;
private final PriceFeedService priceFeedService;
private final AccountAgeWitnessService accountAgeWitnessService;

View File

@ -396,21 +396,12 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
this.closeHandler = closeHandler;
}
// called form parent as the view does not get notified when the tab is closed
// Called from parent as the view does not get notified when the tab is closed
public void onClose() {
Coin balance = model.dataModel.getBalance().get();
if (balance != null && balance.isPositive() && !model.takeOfferCompleted.get() && !DevEnv.isDevMode()) {
model.dataModel.swapTradeToSavings();
new Popup().information(Res.get("takeOffer.alreadyFunded.movedFunds"))
.actionButtonTextWithGoTo("navigation.funds.availableForWithdrawal")
.onAction(() -> navigation.navigateTo(MainView.class, FundsView.class, WithdrawalView.class))
.show();
}
// TODO need other implementation as it is displayed also if there are old funds in the wallet
/*
if (model.dataModel.getIsWalletFunded().get())
new Popup<>().warning("You have already funds paid in.\nIn the <Funds/Open for withdrawal> section you can withdraw those funds.").show();*/
}
public void onTabSelected(boolean isSelected) {
@ -1034,14 +1025,17 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
fundingHBox.getChildren().add(cancelButton2);
cancelButton2.setOnAction(e -> {
if (model.dataModel.getIsBtcWalletFunded().get()) {
new Popup().warning(Res.get("takeOffer.alreadyFunded.askCancel"))
String key = "CreateOfferCancelAndFunded";
if (model.dataModel.getIsBtcWalletFunded().get() &&
model.dataModel.preferences.showAgain(key)) {
new Popup().backgroundInfo(Res.get("takeOffer.alreadyFunded.askCancel"))
.closeButtonText(Res.get("shared.no"))
.actionButtonText(Res.get("shared.yesCancel"))
.onAction(() -> {
model.dataModel.swapTradeToSavings();
close();
close(false);
})
.dontShowAgainId(key)
.show();
} else {
close(false);