remember showtxhex for new tabs

This commit is contained in:
Craig Raw 2020-04-12 16:27:03 +02:00
parent 7bbbc10c61
commit b420705db4
2 changed files with 6 additions and 0 deletions

View file

@ -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) {

View file

@ -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();
}