From b420705db403307c5fa04e5c9b1103d4be75e90d Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Sun, 12 Apr 2020 16:27:03 +0200 Subject: [PATCH] remember showtxhex for new tabs --- src/main/java/com/sparrowwallet/sparrow/AppController.java | 4 ++++ .../sparrow/transaction/TransactionController.java | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 842d777c..2b9c95a6 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -42,6 +42,8 @@ public class AppController implements Initializable { @FXML private TabPane tabs; + public static boolean showTxHexProperty; + @Override public void initialize(URL location, ResourceBundle resources) { @@ -78,6 +80,7 @@ public class AppController implements Initializable { }); showTxHex.setSelected(true); + showTxHexProperty = true; } public void openFromFile(ActionEvent event) { @@ -167,6 +170,7 @@ public class AppController implements Initializable { public void showTxHex(ActionEvent event) { CheckMenuItem item = (CheckMenuItem)event.getSource(); EventManager.get().post(new TransactionTabChangedEvent(tabs.getSelectionModel().getSelectedItem(), item.isSelected())); + showTxHexProperty = item.isSelected(); } public void openExamples(ActionEvent event) { diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java index 9b99d2ae..b807d259 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/TransactionController.java @@ -6,6 +6,7 @@ import com.sparrowwallet.drongo.protocol.*; import com.sparrowwallet.drongo.psbt.PSBT; import com.sparrowwallet.drongo.psbt.PSBTInput; import com.sparrowwallet.drongo.psbt.PSBTOutput; +import com.sparrowwallet.sparrow.AppController; import com.sparrowwallet.sparrow.EventManager; import com.sparrowwallet.sparrow.event.TransactionChangedEvent; import com.sparrowwallet.sparrow.event.TransactionTabChangedEvent; @@ -56,6 +57,7 @@ public class TransactionController implements Initializable { private void initializeView() { initializeTxTree(); + transactionMasterDetail.setShowDetailNode(AppController.showTxHexProperty); refreshTxHex(); }