diff --git a/core/src/main/java/io/bitsquare/fiat/FiatAccount.java b/core/src/main/java/io/bitsquare/fiat/FiatAccount.java index 3d7452e660..d5493d1c38 100644 --- a/core/src/main/java/io/bitsquare/fiat/FiatAccount.java +++ b/core/src/main/java/io/bitsquare/fiat/FiatAccount.java @@ -37,7 +37,7 @@ public class FiatAccount implements Serializable { public static final long WEEK_IN_BLOCKS = DAY_IN_BLOCKS * 7; public enum Type { - IRC("", "", 1), + IRC("", "", 0), SEPA("IBAN", "BIC", WEEK_IN_BLOCKS), WIRE("primary ID", "secondary ID", WEEK_IN_BLOCKS), INTERNATIONAL("primary ID", "secondary ID", 2 * WEEK_IN_BLOCKS), diff --git a/core/src/main/java/io/bitsquare/trade/TradeManager.java b/core/src/main/java/io/bitsquare/trade/TradeManager.java index 0d25e90436..b5063e144e 100644 --- a/core/src/main/java/io/bitsquare/trade/TradeManager.java +++ b/core/src/main/java/io/bitsquare/trade/TradeManager.java @@ -232,7 +232,6 @@ public class TradeManager { } } - public void shutDown() { if (!shutDownRequested) { log.debug("shutDown"); diff --git a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/BuyerSubView.java b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/BuyerSubView.java index 45ffba8af6..1e5c27d012 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/BuyerSubView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/BuyerSubView.java @@ -47,16 +47,6 @@ public class BuyerSubView extends TradeSubView { super(model); } - @Override - public void activate() { - super.activate(); - } - - @Override - public void deactivate() { - super.deactivate(); - } - @Override protected void addWizards() { waitTxInBlockchain = new TradeWizardItem(WaitTxInBlockchainView.class, "Wait for blockchain confirmation"); @@ -65,7 +55,7 @@ public class BuyerSubView extends TradeSubView { payoutUnlock = new TradeWizardItem(WaitPayoutLockTimeView.class, "Wait for payout unlock"); completed = new TradeWizardItem(CompletedView.class, "Completed"); - leftVBox.getChildren().addAll(waitTxInBlockchain, startFiat, waitFiatReceived, payoutUnlock, completed); + leftVBox.getChildren().setAll(waitTxInBlockchain, startFiat, waitFiatReceived, payoutUnlock, completed); } @@ -77,10 +67,11 @@ public class BuyerSubView extends TradeSubView { protected void applyState(PendingTradesViewModel.ViewState viewState) { log.debug("applyState " + viewState); - waitTxInBlockchain.inactive(); - startFiat.inactive(); - waitFiatReceived.inactive(); - completed.inactive(); + waitTxInBlockchain.setDisabled(); + startFiat.setDisabled(); + waitFiatReceived.setDisabled(); + payoutUnlock.setDisabled(); + completed.setDisabled(); if (tradeStepDetailsView != null) tradeStepDetailsView.deactivate(); @@ -93,40 +84,40 @@ public class BuyerSubView extends TradeSubView { ((WaitTxInBlockchainView) tradeStepDetailsView).setInfoLabelText("Deposit transaction has been published. You need to wait for at least " + "one block chain confirmation."); - ((WaitTxInBlockchainView) tradeStepDetailsView).setInfoDisplayField("You need to wait for at least one block chain confirmation to" + + /* ((WaitTxInBlockchainView) tradeStepDetailsView).setInfoDisplayField("You need to wait for at least one block chain confirmation to" + " be sure that the deposit funding has not been double spent. For higher trade volumes we" + - " recommend to wait up to 6 confirmations."); + " recommend to wait up to 6 confirmations.");*/ break; case BUYER_START_PAYMENT: - waitTxInBlockchain.done(); + waitTxInBlockchain.setCompleted(); showItem(startFiat); break; case BUYER_WAIT_CONFIRM_PAYMENT_RECEIVED: - waitTxInBlockchain.done(); - startFiat.done(); + waitTxInBlockchain.setCompleted(); + startFiat.setCompleted(); showItem(waitFiatReceived); ((WaitFiatReceivedView) tradeStepDetailsView).setInfoLabelText(BSResources.get("Waiting for the Bitcoin sellers confirmation " + "that the {0} payment has arrived.", model.getCurrencyCode())); - ((WaitFiatReceivedView) tradeStepDetailsView).setInfoDisplayField(BSResources.get("When the confirmation that the {0} payment arrived at " + + /* ((WaitFiatReceivedView) tradeStepDetailsView).setInfoDisplayField(BSResources.get("When the confirmation that the {0} payment arrived at " + "the Bitcoin sellers payment account, the payout transaction will be published.", - model.getCurrencyCode())); + model.getCurrencyCode()));*/ break; case BUYER_PAYOUT_FINALIZED: - waitTxInBlockchain.done(); - startFiat.done(); - waitFiatReceived.done(); + waitTxInBlockchain.setCompleted(); + startFiat.setCompleted(); + waitFiatReceived.setCompleted(); showItem(payoutUnlock); ((WaitPayoutLockTimeView) tradeStepDetailsView).setInfoLabelText("The payout transaction is signed and finalized by both parties." + - "\nFor reducing bank chargeback risks you need to wait until the payout gets unlocked to transfer your Bitcoin."); + "\nFor reducing bank charge back risks you need to wait until the payout gets unlocked to transfer your Bitcoin."); break; case BUYER_COMPLETED: - waitTxInBlockchain.done(); - startFiat.done(); - waitFiatReceived.done(); - payoutUnlock.done(); + waitTxInBlockchain.setCompleted(); + startFiat.setCompleted(); + waitFiatReceived.setCompleted(); + payoutUnlock.setCompleted(); showItem(completed); CompletedView completedView = (CompletedView) tradeStepDetailsView; @@ -146,6 +137,8 @@ public class BuyerSubView extends TradeSubView { case EXCEPTION: if (model.getTradeException() != null) Popups.openExceptionPopup(model.getTradeException()); + else + Popups.openErrorPopup("An error occurred", model.getErrorMessage()); break; default: log.warn("unhandled viewState " + viewState); diff --git a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/PendingTradesView.java b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/PendingTradesView.java index 98096f02ce..128644d9d0 100644 --- a/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/PendingTradesView.java +++ b/gui/src/main/java/io/bitsquare/gui/main/portfolio/pendingtrades/PendingTradesView.java @@ -83,11 +83,8 @@ public class PendingTradesView extends ActivatableViewAndModel { model.onSelectTrade(newValue); - - if (newValue != null) - addSubView(); - else - removeSubView(); + log.debug("selectedItemChangeListener {} ", newValue); + setNewSubView(newValue != null && newValue.getTrade() != null); }; appFocusChangeListener = (observable, oldValue, newValue) -> { @@ -102,10 +99,8 @@ public class PendingTradesView extends ActivatableViewAndModel { - if (newValue != null) - addSubView(); - else - removeSubView(); + log.debug("currentTradeChangeListener {} ", newValue); + setNewSubView(newValue != null); }; } @@ -118,7 +113,7 @@ public class PendingTradesView extends ActivatableViewAndModel