mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-29 01:38:39 -04:00
Show busy spinner at pay reg. fee #284
This commit is contained in:
parent
2b4e7528c4
commit
bd8b39b996
3 changed files with 32 additions and 7 deletions
|
@ -44,6 +44,7 @@ class RegistrationPM extends PresentationModel<RegistrationModel> {
|
||||||
final BooleanProperty isPayButtonDisabled = new SimpleBooleanProperty(true);
|
final BooleanProperty isPayButtonDisabled = new SimpleBooleanProperty(true);
|
||||||
final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty();
|
final StringProperty requestPlaceOfferErrorMessage = new SimpleStringProperty();
|
||||||
final BooleanProperty showTransactionPublishedScreen = new SimpleBooleanProperty();
|
final BooleanProperty showTransactionPublishedScreen = new SimpleBooleanProperty();
|
||||||
|
final BooleanProperty isPaymentSpinnerVisible = new SimpleBooleanProperty(false);
|
||||||
|
|
||||||
// That is needed for the addressTextField
|
// That is needed for the addressTextField
|
||||||
final ObjectProperty<Address> address = new SimpleObjectProperty<>();
|
final ObjectProperty<Address> address = new SimpleObjectProperty<>();
|
||||||
|
@ -79,10 +80,18 @@ class RegistrationPM extends PresentationModel<RegistrationModel> {
|
||||||
});
|
});
|
||||||
validateInput();
|
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);
|
model.payFeeErrorMessage.addListener((ov, oldValue, newValue) -> {
|
||||||
showTransactionPublishedScreen.bind(model.payFeeSuccess);
|
if (newValue != null) {
|
||||||
|
requestPlaceOfferErrorMessage.set(newValue);
|
||||||
|
isPaymentSpinnerVisible.set(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("EmptyMethod")
|
@SuppressWarnings("EmptyMethod")
|
||||||
|
@ -113,6 +122,7 @@ class RegistrationPM extends PresentationModel<RegistrationModel> {
|
||||||
model.payFeeSuccess.set(false);
|
model.payFeeSuccess.set(false);
|
||||||
|
|
||||||
isPayButtonDisabled.set(true);
|
isPayButtonDisabled.set(true);
|
||||||
|
isPaymentSpinnerVisible.set(true);
|
||||||
|
|
||||||
model.payFee();
|
model.payFee();
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,13 +64,19 @@
|
||||||
<InfoDisplay gridPane="$root" onAction="#onOpenHelp" rowIndex="3"
|
<InfoDisplay gridPane="$root" onAction="#onOpenHelp" rowIndex="3"
|
||||||
text="You need to pay a 0.0002 BTC which is needed for storing your encrypted account data in the blockchain. That will be used in the trade process for account verification."/>
|
text="You need to pay a 0.0002 BTC which is needed for storing your encrypted account data in the blockchain. That will be used in the trade process for account verification."/>
|
||||||
|
|
||||||
<Button fx:id="payButton" text="Pay registration fee" onAction="#onPayFee" GridPane.columnIndex="1"
|
<HBox spacing="10" GridPane.columnIndex="1" GridPane.rowIndex="4">
|
||||||
GridPane.rowIndex="4"
|
<Button fx:id="payButton" text="Pay registration fee" onAction="#onPayFee" defaultButton="true"/>
|
||||||
defaultButton="true">
|
<ProgressIndicator fx:id="paymentSpinner" progress="0" visible="false" prefHeight="24"
|
||||||
|
prefWidth="24"/>
|
||||||
|
<Label fx:id="paymentSpinnerInfoLabel" text="Payment is in progress..." visible="false">
|
||||||
|
<padding>
|
||||||
|
<Insets top="5.0"/>
|
||||||
|
</padding>
|
||||||
|
</Label>
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets top="15.0"/>
|
<Insets top="15.0"/>
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</Button>
|
</HBox>
|
||||||
|
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="200.0"/>
|
<ColumnConstraints hgrow="SOMETIMES" halignment="RIGHT" minWidth="200.0"/>
|
||||||
|
|
|
@ -58,6 +58,8 @@ public class RegistrationViewCB extends CachedViewCB<RegistrationPM> implements
|
||||||
@FXML AddressTextField addressTextField;
|
@FXML AddressTextField addressTextField;
|
||||||
@FXML BalanceTextField balanceTextField;
|
@FXML BalanceTextField balanceTextField;
|
||||||
@FXML Button payButton;
|
@FXML Button payButton;
|
||||||
|
@FXML Label paymentSpinnerInfoLabel;
|
||||||
|
@FXML ProgressIndicator paymentSpinner;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -100,6 +102,13 @@ public class RegistrationViewCB extends CachedViewCB<RegistrationPM> 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) -> {
|
presentationModel.showTransactionPublishedScreen.addListener((o, oldValue, newValue) -> {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
overlayManager.blurContent();
|
overlayManager.blurContent();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue