allow mix counterparty to retry listening

This commit is contained in:
Craig Raw 2022-03-14 11:47:12 +02:00
parent d86517606b
commit ef5cca26ea
5 changed files with 21 additions and 3 deletions

View file

@ -25,6 +25,7 @@ public class ProgressTimer extends ProgressIndicator {
}
public void start(EventHandler<ActionEvent> onFinished) {
getStyleClass().remove("warn");
timeline = new Timeline(
new KeyFrame(Duration.ZERO, new KeyValue(progressProperty(), 0)),
new KeyFrame(Duration.seconds(getSeconds() * 0.8), e -> getStyleClass().add("warn")),

View file

@ -90,7 +90,7 @@ public class CounterpartyController extends SorobanController {
private PayNymAvatar mixPartnerAvatar;
@FXML
private Label meetingFail;
private Hyperlink meetingFail;
@FXML
private VBox mixDetails;
@ -187,6 +187,15 @@ public class CounterpartyController extends SorobanController {
mixingPartner.managedProperty().bind(mixingPartner.visibleProperty());
meetingFail.managedProperty().bind(meetingFail.visibleProperty());
meetingFail.visibleProperty().bind(mixingPartner.visibleProperty().not());
meetingFail.setOnAction(event -> {
step2Desc.setText("Ask your mix partner to initiate the Soroban communication.");
mixingPartner.setVisible(true);
startCounterpartyMeetingReceive();
step2Timer.start(e -> {
step2Desc.setText("Mix declined due to timeout.");
meetingReceived.set(Boolean.FALSE);
});
});
mixDetails.managedProperty().bind(mixDetails.visibleProperty());
mixDetails.setVisible(false);

View file

@ -173,6 +173,10 @@
-fx-text-fill: #e06c75;
}
.root .failure.hyperlink:visited {
-fx-text-fill: #e06c75;
}
.root .titled-description-pane > .title {
-fx-background-color: derive(-fx-base, 10%);
-fx-padding: 0;

View file

@ -114,6 +114,10 @@
-fx-underline: false;
}
.failure.hyperlink:visited {
-fx-text-fill: rgb(202, 18, 67);
}
.hyperlink:hover:visited {
-fx-underline: true;
}

View file

@ -107,11 +107,11 @@
<HBox styleClass="field-box">
<Label text="Mix partner:" styleClass="field-label" />
<Label fx:id="mixingPartner" text="Waiting for mix partner..." styleClass="field-control" />
<Label fx:id="meetingFail" text="Failed to find mix partner." styleClass="failure" graphicTextGap="5">
<Hyperlink fx:id="meetingFail" text="Failed to find mix partner. Try again?" styleClass="failure" graphicTextGap="5">
<graphic>
<Glyph fontFamily="Font Awesome 5 Free Solid" fontSize="12" icon="EXCLAMATION_CIRCLE" styleClass="failure" />
</graphic>
</Label>
</Hyperlink>
</HBox>
<VBox fx:id="mixDetails" spacing="10">
<HBox styleClass="field-box">