diff --git a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationPM.java b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationPM.java index e4f65cef3d..c966024f53 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationPM.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationPM.java @@ -44,6 +44,7 @@ class RegistrationPM extends PresentationModel { final BooleanProperty isPayButtonDisabled = new SimpleBooleanProperty(true); final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty(); final BooleanProperty showTransactionPublishedScreen = new SimpleBooleanProperty(); + final BooleanProperty isPaymentSpinnerVisible = new SimpleBooleanProperty(false); // That is needed for the addressTextField final ObjectProperty
address = new SimpleObjectProperty<>(); @@ -79,10 +80,18 @@ class RegistrationPM extends PresentationModel { }); validateInput(); - model.payFeeSuccess.addListener((ov, oldValue, newValue) -> isPayButtonDisabled.set(newValue)); + model.payFeeSuccess.addListener((ov, oldValue, newValue) -> { + isPayButtonDisabled.set(newValue); + showTransactionPublishedScreen.set(newValue); + isPaymentSpinnerVisible.set(false); + }); - requestPlaceOfferErrorMessage.bind(model.payFeeErrorMessage); - showTransactionPublishedScreen.bind(model.payFeeSuccess); + model.payFeeErrorMessage.addListener((ov, oldValue, newValue) -> { + if (newValue != null) { + requestPlaceOfferErrorMessage.set(newValue); + isPaymentSpinnerVisible.set(false); + } + }); } @SuppressWarnings("EmptyMethod") @@ -113,6 +122,7 @@ class RegistrationPM extends PresentationModel { model.payFeeSuccess.set(false); isPayButtonDisabled.set(true); + isPaymentSpinnerVisible.set(true); model.payFee(); } diff --git a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationView.fxml b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationView.fxml index 5aacb51798..e55cc62d7e 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationView.fxml +++ b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationView.fxml @@ -64,13 +64,19 @@ - + diff --git a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java index 75b92ce47f..52ca8b3d82 100644 --- a/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java +++ b/src/main/java/io/bitsquare/gui/main/account/content/registration/RegistrationViewCB.java @@ -58,6 +58,8 @@ public class RegistrationViewCB extends CachedViewCB implements @FXML AddressTextField addressTextField; @FXML BalanceTextField balanceTextField; @FXML Button payButton; + @FXML Label paymentSpinnerInfoLabel; + @FXML ProgressIndicator paymentSpinner; /////////////////////////////////////////////////////////////////////////////////////////// @@ -100,6 +102,13 @@ public class RegistrationViewCB extends CachedViewCB implements } }); + paymentSpinnerInfoLabel.visibleProperty().bind(presentationModel.isPaymentSpinnerVisible); + + presentationModel.isPaymentSpinnerVisible.addListener((ov, oldValue, newValue) -> { + paymentSpinner.setProgress(newValue ? -1 : 0); + paymentSpinner.setVisible(newValue); + }); + presentationModel.showTransactionPublishedScreen.addListener((o, oldValue, newValue) -> { if (newValue) { overlayManager.blurContent();