From 57b3214c54c972b0d1fe92f19ece76fc1e7c1169 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Tue, 24 Aug 2021 10:40:27 +0200 Subject: [PATCH] improvements to whirlpool dialog --- .../whirlpool/WhirlpoolController.java | 9 ++++ .../sparrow/whirlpool/WhirlpoolDialog.java | 9 ++-- .../sparrow/whirlpool/whirlpool.fxml | 42 +++++++++++++++++-- 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java index 91aa1cb1..fd828c65 100644 --- a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java +++ b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolController.java @@ -94,6 +94,11 @@ public class WhirlpoolController { Config.get().setScode(newValue); }); + if(Config.get().getScode() != null) { + step1.setVisible(false); + step3.setVisible(true); + } + pool.setConverter(new StringConverter() { @Override public String toString(Pool pool) { @@ -219,6 +224,10 @@ public class WhirlpoolController { } private void fetchTx0Preview(Pool pool) { + if(Config.get().getScode() == null) { + Config.get().setScode(""); + } + Whirlpool whirlpool = AppServices.get().getWhirlpool(walletId); whirlpool.setScode(Config.get().getScode()); diff --git a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolDialog.java b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolDialog.java index 22dfbf15..103d13f4 100644 --- a/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/whirlpool/WhirlpoolDialog.java @@ -1,9 +1,9 @@ package com.sparrowwallet.sparrow.whirlpool; import com.samourai.whirlpool.client.tx0.Tx0Preview; -import com.samourai.whirlpool.client.whirlpool.beans.Pool; import com.sparrowwallet.drongo.wallet.Wallet; import com.sparrowwallet.sparrow.AppServices; +import com.sparrowwallet.sparrow.io.Config; import com.sparrowwallet.sparrow.wallet.UtxoEntry; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; @@ -27,9 +27,10 @@ public class WhirlpoolDialog extends Dialog { whirlpoolController.initializeView(walletId, wallet, utxoEntries); dialogPane.setPrefWidth(600); - dialogPane.setPrefHeight(520); + dialogPane.setPrefHeight(550); AppServices.moveToActiveWindowScreen(this); + dialogPane.getStylesheets().add(AppServices.class.getResource("app.css").toExternalForm()); dialogPane.getStylesheets().add(AppServices.class.getResource("whirlpool/whirlpool.css").toExternalForm()); final ButtonType nextButtonType = new javafx.scene.control.ButtonType("Next", ButtonBar.ButtonData.OK_DONE); @@ -53,7 +54,9 @@ public class WhirlpoolDialog extends Dialog { backButton.managedProperty().bind(backButton.visibleProperty()); previewButton.managedProperty().bind(previewButton.visibleProperty()); - backButton.setDisable(true); + if(Config.get().getScode() == null) { + backButton.setDisable(true); + } previewButton.visibleProperty().bind(nextButton.visibleProperty().not()); nextButton.addEventFilter(ActionEvent.ACTION, event -> { diff --git a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml index 84a7dd81..a8fa0d14 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/whirlpool/whirlpool.fxml @@ -39,9 +39,45 @@ -