diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 75f69148..6f6ee84e 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -144,8 +144,6 @@ public class AppController implements Initializable { private static Integer currentBlockHeight; - public static boolean showTxHexProperty; - private static Map targetBlockFeeRates; private static final Map> mempoolHistogram = new TreeMap<>(); @@ -257,8 +255,7 @@ public class AppController implements Initializable { selectedThemeToggle.ifPresent(toggle -> theme.selectToggle(toggle)); setTheme(null); - showTxHex.setSelected(true); - showTxHexProperty = true; + showTxHex.setSelected(Config.get().isShowTransactionHex()); exportWallet.setDisable(true); serverToggle.selectedProperty().addListener((observable, oldValue, newValue) -> { @@ -756,8 +753,8 @@ public class AppController implements Initializable { public void showTxHex(ActionEvent event) { CheckMenuItem item = (CheckMenuItem)event.getSource(); + Config.get().setShowTransactionHex(item.isSelected()); EventManager.get().post(new TransactionTabChangedEvent(tabs.getSelectionModel().getSelectedItem(), item.isSelected())); - showTxHexProperty = item.isSelected(); } public void setBitcoinUnit(ActionEvent event) { diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Config.java b/src/main/java/com/sparrowwallet/sparrow/io/Config.java index 8dc8c33b..e5f5e601 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Config.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Config.java @@ -31,6 +31,7 @@ public class Config { private boolean notifyNewTransactions = true; private boolean checkNewVersions = true; private Theme theme; + private boolean showTransactionHex = true; private List recentWalletFiles; private Integer keyDerivationPeriod; private File hwi; @@ -184,6 +185,15 @@ public class Config { flush(); } + public boolean isShowTransactionHex() { + return showTransactionHex; + } + + public void setShowTransactionHex(boolean showTransactionHex) { + this.showTransactionHex = showTransactionHex; + flush(); + } + public List getRecentWalletFiles() { return recentWalletFiles; } diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java index 9784b9b5..72bcb23c 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java @@ -12,6 +12,7 @@ import com.sparrowwallet.sparrow.TransactionTabData; import com.sparrowwallet.sparrow.control.TransactionDiagram; import com.sparrowwallet.sparrow.control.TransactionHexArea; import com.sparrowwallet.sparrow.event.*; +import com.sparrowwallet.sparrow.io.Config; import com.sparrowwallet.sparrow.net.ElectrumServer; import javafx.application.Platform; import javafx.fxml.FXML; @@ -63,7 +64,7 @@ public class TransactionController implements Initializable { public void initializeView() { initializeTxTree(); - transactionMasterDetail.setShowDetailNode(AppController.showTxHexProperty); + transactionMasterDetail.setShowDetailNode(Config.get().isShowTransactionHex()); txhex.setTransaction(getTransaction()); highlightTxHex(); fetchThisAndInputBlockTransactions(0, Math.min(getTransaction().getInputs().size(), PageForm.PAGE_SIZE));