From 59b41c7a4f16fea66b7bebb522e7f8cb69afbbdf Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Fri, 1 Apr 2016 10:16:16 +0200 Subject: [PATCH] ignore popups in dev mode --- .../steps/buyer/BuyerStep2View.java | 5 +++-- .../steps/buyer/BuyerStep5View.java | 22 ++++++++++--------- .../steps/seller/SellerStep3View.java | 3 ++- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java index ac1e11d44e..aebe872e24 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java +++ b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java @@ -17,6 +17,7 @@ package io.bitsquare.gui.main.portfolio.pendingtrades.steps.buyer; +import io.bitsquare.app.BitsquareApp; import io.bitsquare.common.util.Tuple3; import io.bitsquare.gui.components.TextFieldWithCopyIcon; import io.bitsquare.gui.components.TitledGroupBg; @@ -88,7 +89,7 @@ public class BuyerStep2View extends TradeStepView { "DO NOT use any additional notice in the reference text like " + "Bitcoin, Btc or Bitsquare."; - if (preferences.showAgain(key)) { + if (!BitsquareApp.DEV_MODE && preferences.showAgain(key)) { preferences.dontShowAgain(key, true); new Popup().headLine("Attention required for trade with ID " + trade.getShortId()) .attention(message) @@ -219,7 +220,7 @@ public class BuyerStep2View extends TradeStepView { private void onPaymentStarted() { if (model.p2PService.isBootstrapped()) { String key = "confirmPaymentStarted"; - if (preferences.showAgain(key)) { + if (!BitsquareApp.DEV_MODE && preferences.showAgain(key)) { Popup popup = new Popup(); popup.headLine("Confirm that you have started the payment") .confirmation("Have you initiated the " + model.dataModel.getCurrencyCode() + diff --git a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep5View.java b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep5View.java index 921b6f76bd..9528f315f9 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep5View.java +++ b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/buyer/BuyerStep5View.java @@ -145,7 +145,7 @@ public class BuyerStep5View extends TradeStepView { withdrawAddressTextField.setText("mo6y756TnpdZQCeHStraavjqrndeXzVkxi"); } else { String key = "tradeCompleted" + trade.getId(); - if (preferences.showAgain(key)) { + if (!BitsquareApp.DEV_MODE && preferences.showAgain(key)) { preferences.dontShowAgain(key, true); new Notification().headLine("Trade completed") .notification("You can withdraw your funds now to your external Bitcoin wallet.") @@ -180,7 +180,7 @@ public class BuyerStep5View extends TradeStepView { Coin receiverAmount = senderAmount.subtract(requiredFee); BSFormatter formatter = model.formatter; String key = "reviewWithdrawalAtTradeComplete"; - if (preferences.showAgain(key)) { + if (!BitsquareApp.DEV_MODE && preferences.showAgain(key)) { new Popup().headLine("Confirm withdrawal request") .confirmation("Sending: " + formatter.formatCoinWithCode(senderAmount) + "\n" + "From address: " + fromAddresses + "\n" + @@ -231,14 +231,16 @@ public class BuyerStep5View extends TradeStepView { } private void handleTradeCompleted() { - String key = "tradeCompleteWithdrawCompletedInfo"; - new Popup().headLine("Withdrawal completed") - .feedback("Your completed trades are stored under \"Portfolio/History\".\n" + - "You can review all your bitcoin transactions under \"Funds/Transactions\"") - .actionButtonText("Go to \"Transactions\"") - .onAction(() -> model.dataModel.navigation.navigateTo(MainView.class, FundsView.class, TransactionsView.class)) - .dontShowAgainId(key, preferences) - .show(); + if (!BitsquareApp.DEV_MODE) { + String key = "tradeCompleteWithdrawCompletedInfo"; + new Popup().headLine("Withdrawal completed") + .feedback("Your completed trades are stored under \"Portfolio/History\".\n" + + "You can review all your bitcoin transactions under \"Funds/Transactions\"") + .actionButtonText("Go to \"Transactions\"") + .onAction(() -> model.dataModel.navigation.navigateTo(MainView.class, FundsView.class, TransactionsView.class)) + .dontShowAgainId(key, preferences) + .show(); + } useSavingsWalletButton.setDisable(true); withdrawToExternalWalletButton.setDisable(true); } diff --git a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java index 14378bde8d..db97460e4b 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java +++ b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java @@ -17,6 +17,7 @@ package io.bitsquare.gui.main.portfolio.pendingtrades.steps.seller; +import io.bitsquare.app.BitsquareApp; import io.bitsquare.common.util.Tuple3; import io.bitsquare.gui.components.TextFieldWithCopyIcon; import io.bitsquare.gui.components.TitledGroupBg; @@ -84,7 +85,7 @@ public class SellerStep3View extends TradeStepView { tradeAmountWithCode + " from the bitcoin buyer.\n\n" + "The reference text of the transaction is: \"" + trade.getShortId() + "\""; } - if (preferences.showAgain(key)) { + if (!BitsquareApp.DEV_MODE && preferences.showAgain(key)) { preferences.dontShowAgain(key, true); new Popup().headLine("Attention required for trade with ID " + trade.getShortId()) .attention(message)