Browse Source

allow mix counterparty to retry listening

terminal
Craig Raw 3 years ago
parent
commit
ef5cca26ea
  1. 1
      src/main/java/com/sparrowwallet/sparrow/control/ProgressTimer.java
  2. 11
      src/main/java/com/sparrowwallet/sparrow/soroban/CounterpartyController.java
  3. 4
      src/main/resources/com/sparrowwallet/sparrow/darktheme.css
  4. 4
      src/main/resources/com/sparrowwallet/sparrow/general.css
  5. 4
      src/main/resources/com/sparrowwallet/sparrow/soroban/counterparty.fxml

1
src/main/java/com/sparrowwallet/sparrow/control/ProgressTimer.java

@ -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")),

11
src/main/java/com/sparrowwallet/sparrow/soroban/CounterpartyController.java

@ -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);

4
src/main/resources/com/sparrowwallet/sparrow/darktheme.css

@ -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;

4
src/main/resources/com/sparrowwallet/sparrow/general.css

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

4
src/main/resources/com/sparrowwallet/sparrow/soroban/counterparty.fxml

@ -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">

Loading…
Cancel
Save