From 447e2ab264a02c067a5c943876813a5e92e1d227 Mon Sep 17 00:00:00 2001 From: Haakon Nilsen Date: Wed, 26 May 2021 18:54:20 +0200 Subject: [PATCH 1/3] Disable the keyboard shortcut for saving PSBT binary when its parent menu is disabled --- src/main/java/com/sparrowwallet/sparrow/AppController.java | 4 ++++ src/main/resources/com/sparrowwallet/sparrow/app.fxml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 677e3972..f1aed537 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -87,6 +87,9 @@ public class AppController implements Initializable { @FXML private Menu savePSBT; + @FXML + private MenuItem savePSBTBinary; + @FXML private MenuItem exportWallet; @@ -267,6 +270,7 @@ public class AppController implements Initializable { showLoadingLog.setSelected(Config.get().isShowLoadingLog()); showUtxosChart.setSelected(Config.get().isShowUtxosChart()); savePSBT.visibleProperty().bind(saveTransaction.visibleProperty().not()); + savePSBTBinary.disableProperty().bind(saveTransaction.visibleProperty()); exportWallet.setDisable(true); refreshWallet.disableProperty().bind(Bindings.or(exportWallet.disableProperty(), Bindings.or(serverToggle.disableProperty(), AppServices.onlineProperty().not()))); sendToMany.disableProperty().bind(exportWallet.disableProperty()); diff --git a/src/main/resources/com/sparrowwallet/sparrow/app.fxml b/src/main/resources/com/sparrowwallet/sparrow/app.fxml index c77731d4..7964263e 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/app.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/app.fxml @@ -29,7 +29,7 @@ - + From f7f58524766a140ac9baa7700d249c7d177e7b6d Mon Sep 17 00:00:00 2001 From: Haakon Nilsen Date: Wed, 26 May 2021 18:57:07 +0200 Subject: [PATCH 2/3] Disable the "Save transaction" menu item when starting app without any open tabs --- src/main/java/com/sparrowwallet/sparrow/AppController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index f1aed537..dd6ab34d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -269,6 +269,7 @@ public class AppController implements Initializable { showTxHex.setSelected(Config.get().isShowTransactionHex()); showLoadingLog.setSelected(Config.get().isShowLoadingLog()); showUtxosChart.setSelected(Config.get().isShowUtxosChart()); + saveTransaction.setDisable(true); savePSBT.visibleProperty().bind(saveTransaction.visibleProperty().not()); savePSBTBinary.disableProperty().bind(saveTransaction.visibleProperty()); exportWallet.setDisable(true); From e740c6d162f4cc7888a4b3a2d899ee37564cc069 Mon Sep 17 00:00:00 2001 From: Haakon Nilsen Date: Wed, 26 May 2021 18:58:58 +0200 Subject: [PATCH 3/3] Disable transaction saving menu items after a transaction tab is closed and no other tabs are open --- src/main/java/com/sparrowwallet/sparrow/AppController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index dd6ab34d..10bf5293 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -235,6 +235,8 @@ public class AppController implements Initializable { if(tabs.getTabs().isEmpty()) { Stage tabStage = (Stage)tabs.getScene().getWindow(); tabStage.setTitle("Sparrow"); + saveTransaction.setVisible(true); + saveTransaction.setDisable(true); } } });