add restart in signet to tools menu, add mempool.space signet public server

This commit is contained in:
Craig Raw 2024-02-28 14:52:52 +02:00
parent ae29108656
commit 2cc02e38e6
3 changed files with 16 additions and 8 deletions

View file

@ -198,7 +198,7 @@ public class AppController implements Initializable {
private static final BooleanProperty preventSleepProperty = new SimpleBooleanProperty(); private static final BooleanProperty preventSleepProperty = new SimpleBooleanProperty();
@FXML @FXML
private MenuItem restart; private Menu restart;
@FXML @FXML
private StackPane rootStack; private StackPane rootStack;
@ -375,7 +375,14 @@ public class AppController implements Initializable {
showLoadingLog.selectedProperty().bindBidirectional(showLoadingLogProperty); showLoadingLog.selectedProperty().bindBidirectional(showLoadingLogProperty);
preventSleepProperty.set(Config.get().isPreventSleep()); preventSleepProperty.set(Config.get().isPreventSleep());
preventSleep.selectedProperty().bindBidirectional(preventSleepProperty); preventSleep.selectedProperty().bindBidirectional(preventSleepProperty);
restart.setText("Restart in " + (Network.get() == Network.MAINNET ? Network.TESTNET.toDisplayString() : Network.MAINNET.toDisplayString()));
List<Network> networks = new ArrayList<>(List.of(Network.MAINNET, Network.TESTNET, Network.SIGNET));
networks.remove(Network.get());
for(Network network : networks) {
MenuItem networkItem = new MenuItem(network.toDisplayString());
networkItem.setOnAction(event -> restart(event, network));
restart.getItems().add(networkItem);
}
restart.setVisible(System.getProperty(JPACKAGE_APP_PATH) != null); restart.setVisible(System.getProperty(JPACKAGE_APP_PATH) != null);
saveTransaction.setDisable(true); saveTransaction.setDisable(true);
@ -957,7 +964,7 @@ public class AppController implements Initializable {
AppServices.get().setPreventSleep(item.isSelected()); AppServices.get().setPreventSleep(item.isSelected());
} }
public void restart(ActionEvent event) { public void restart(ActionEvent event, Network network) {
if(System.getProperty(JPACKAGE_APP_PATH) == null) { if(System.getProperty(JPACKAGE_APP_PATH) == null) {
throw new IllegalStateException("Property " + JPACKAGE_APP_PATH + " is not present"); throw new IllegalStateException("Property " + JPACKAGE_APP_PATH + " is not present");
} }
@ -968,7 +975,7 @@ public class AppController implements Initializable {
jCommander.parse(argv); jCommander.parse(argv);
}); });
args.network = (Network.get() == Network.MAINNET ? Network.TESTNET : Network.MAINNET); args.network = network;
try { try {
List<String> cmd = new ArrayList<>(); List<String> cmd = new ArrayList<>();

View file

@ -16,14 +16,15 @@ public enum PublicElectrumServer {
DIYNODES_COM("electrum.diynodes.com", "ssl://electrum.diynodes.com:50022", Network.MAINNET), DIYNODES_COM("electrum.diynodes.com", "ssl://electrum.diynodes.com:50022", Network.MAINNET),
SETHFORPRIVACY_COM("fulcrum.sethforprivacy.com", "ssl://fulcrum.sethforprivacy.com:50002", Network.MAINNET), SETHFORPRIVACY_COM("fulcrum.sethforprivacy.com", "ssl://fulcrum.sethforprivacy.com:50002", Network.MAINNET),
TESTNET_ARANGUREN_ORG("testnet.aranguren.org", "ssl://testnet.aranguren.org:51002", Network.TESTNET), TESTNET_ARANGUREN_ORG("testnet.aranguren.org", "ssl://testnet.aranguren.org:51002", Network.TESTNET),
TESTNET_QTORNADO_COM("testnet.qtornado.com", "ssl://testnet.qtornado.com:51002", Network.TESTNET); TESTNET_QTORNADO_COM("testnet.qtornado.com", "ssl://testnet.qtornado.com:51002", Network.TESTNET),
SIGNET_MEMPOOL_SPACE("mempool.space", "ssl://mempool.space:60602", Network.SIGNET);
PublicElectrumServer(String name, String url, Network network) { PublicElectrumServer(String name, String url, Network network) {
this.server = new Server(url, name); this.server = new Server(url, name);
this.network = network; this.network = network;
} }
public static final List<Network> SUPPORTED_NETWORKS = List.of(Network.MAINNET, Network.TESTNET); public static final List<Network> SUPPORTED_NETWORKS = List.of(Network.MAINNET, Network.TESTNET, Network.SIGNET);
private final Server server; private final Server server;
private final Network network; private final Network network;

View file

@ -114,7 +114,7 @@
</items> </items>
</Menu> </Menu>
<SeparatorMenuItem /> <SeparatorMenuItem />
<CheckMenuItem fx:id="openWalletsInNewWindows" mnemonicParsing="false" text="Open Wallets in New Windows" onAction="#openWalletsInNewWindows"/> <CheckMenuItem fx:id="openWalletsInNewWindows" mnemonicParsing="false" text="Open Wallets In New Windows" onAction="#openWalletsInNewWindows"/>
<CheckMenuItem fx:id="hideEmptyUsedAddresses" mnemonicParsing="false" text="Hide Empty Used Addresses" onAction="#hideEmptyUsedAddresses"/> <CheckMenuItem fx:id="hideEmptyUsedAddresses" mnemonicParsing="false" text="Hide Empty Used Addresses" onAction="#hideEmptyUsedAddresses"/>
<CheckMenuItem fx:id="useHdCameraResolution" mnemonicParsing="false" text="Use HD Camera Resolution" onAction="#useHdCameraResolution"/> <CheckMenuItem fx:id="useHdCameraResolution" mnemonicParsing="false" text="Use HD Camera Resolution" onAction="#useHdCameraResolution"/>
<CheckMenuItem fx:id="showLoadingLog" mnemonicParsing="false" text="Show Wallet Loading Log" onAction="#showLoadingLog" /> <CheckMenuItem fx:id="showLoadingLog" mnemonicParsing="false" text="Show Wallet Loading Log" onAction="#showLoadingLog" />
@ -143,7 +143,7 @@
<MenuItem mnemonicParsing="false" text="Verify Download" onAction="#verifyDownload" /> <MenuItem mnemonicParsing="false" text="Verify Download" onAction="#verifyDownload" />
<MenuItem styleClass="osxHide,windowsHide" mnemonicParsing="false" text="Install Udev Rules" onAction="#installUdevRules"/> <MenuItem styleClass="osxHide,windowsHide" mnemonicParsing="false" text="Install Udev Rules" onAction="#installUdevRules"/>
<CheckMenuItem fx:id="preventSleep" mnemonicParsing="false" text="Prevent Computer Sleep" onAction="#preventSleep"/> <CheckMenuItem fx:id="preventSleep" mnemonicParsing="false" text="Prevent Computer Sleep" onAction="#preventSleep"/>
<MenuItem fx:id="restart" mnemonicParsing="false" text="Restart" onAction="#restart" /> <Menu fx:id="restart" mnemonicParsing="false" text="Restart In Network" />
</Menu> </Menu>
<Menu fx:id="helpMenu" mnemonicParsing="false" text="Help"> <Menu fx:id="helpMenu" mnemonicParsing="false" text="Help">
<MenuItem mnemonicParsing="false" text="Show Introduction" onAction="#showIntroduction"/> <MenuItem mnemonicParsing="false" text="Show Introduction" onAction="#showIntroduction"/>