From bb8c9a19cf67f8276c0cf25bbf5167bfc7e19387 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 24 Feb 2021 11:11:31 +0200 Subject: [PATCH] fix configure later path --- src/main/java/com/sparrowwallet/sparrow/AppController.java | 3 +++ src/main/java/com/sparrowwallet/sparrow/MainApp.java | 4 ++++ src/main/resources/com/sparrowwallet/sparrow/welcome.fxml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index f5bb0237..1c4134ca 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -231,6 +231,7 @@ public class AppController implements Initializable { setServerType(Config.get().getServerType()); serverToggle.setSelected(isConnected()); + serverToggle.setDisable(Config.get().getServerType() == null); onlineProperty().bindBidirectional(serverToggle.selectedProperty()); onlineProperty().addListener((observable, oldValue, newValue) -> { Platform.runLater(() -> setServerToggleTooltip(getCurrentBlockHeight())); @@ -1095,6 +1096,8 @@ public class AppController implements Initializable { } else { serverToggle.getStyleClass().remove("core-server"); } + + serverToggle.setDisable(false); } public void setTheme(ActionEvent event) { diff --git a/src/main/java/com/sparrowwallet/sparrow/MainApp.java b/src/main/java/com/sparrowwallet/sparrow/MainApp.java index 8cd81b4e..88f2fac3 100644 --- a/src/main/java/com/sparrowwallet/sparrow/MainApp.java +++ b/src/main/java/com/sparrowwallet/sparrow/MainApp.java @@ -10,6 +10,7 @@ import com.sparrowwallet.sparrow.io.FileType; import com.sparrowwallet.sparrow.io.IOUtils; import com.sparrowwallet.sparrow.io.Storage; import com.sparrowwallet.sparrow.net.Bwt; +import com.sparrowwallet.sparrow.net.PublicElectrumServer; import com.sparrowwallet.sparrow.net.ServerType; import com.sparrowwallet.sparrow.preferences.PreferenceGroup; import com.sparrowwallet.sparrow.preferences.PreferencesDialog; @@ -62,6 +63,9 @@ public class MainApp extends Application { PreferencesDialog preferencesDialog = new PreferencesDialog(PreferenceGroup.SERVER, true); Optional optNewWallet = preferencesDialog.showAndWait(); createNewWallet = optNewWallet.isPresent() && optNewWallet.get(); + } else if(Network.get() == Network.MAINNET) { + Config.get().setServerType(ServerType.PUBLIC_ELECTRUM_SERVER); + Config.get().setPublicElectrumServer(PublicElectrumServer.values()[new Random().nextInt(PublicElectrumServer.values().length)].getUrl()); } } } diff --git a/src/main/resources/com/sparrowwallet/sparrow/welcome.fxml b/src/main/resources/com/sparrowwallet/sparrow/welcome.fxml index c3179bd5..efe2f22c 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/welcome.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/welcome.fxml @@ -31,7 +31,7 @@