Disable the keyboard shortcut for saving PSBT binary when its parent menu is disabled

This commit is contained in:
Haakon Nilsen 2021-05-26 18:54:20 +02:00
parent 8a77f22158
commit 447e2ab264
2 changed files with 5 additions and 1 deletions

View file

@ -87,6 +87,9 @@ public class AppController implements Initializable {
@FXML @FXML
private Menu savePSBT; private Menu savePSBT;
@FXML
private MenuItem savePSBTBinary;
@FXML @FXML
private MenuItem exportWallet; private MenuItem exportWallet;
@ -267,6 +270,7 @@ public class AppController implements Initializable {
showLoadingLog.setSelected(Config.get().isShowLoadingLog()); showLoadingLog.setSelected(Config.get().isShowLoadingLog());
showUtxosChart.setSelected(Config.get().isShowUtxosChart()); showUtxosChart.setSelected(Config.get().isShowUtxosChart());
savePSBT.visibleProperty().bind(saveTransaction.visibleProperty().not()); savePSBT.visibleProperty().bind(saveTransaction.visibleProperty().not());
savePSBTBinary.disableProperty().bind(saveTransaction.visibleProperty());
exportWallet.setDisable(true); exportWallet.setDisable(true);
refreshWallet.disableProperty().bind(Bindings.or(exportWallet.disableProperty(), Bindings.or(serverToggle.disableProperty(), AppServices.onlineProperty().not()))); refreshWallet.disableProperty().bind(Bindings.or(exportWallet.disableProperty(), Bindings.or(serverToggle.disableProperty(), AppServices.onlineProperty().not())));
sendToMany.disableProperty().bind(exportWallet.disableProperty()); sendToMany.disableProperty().bind(exportWallet.disableProperty());

View file

@ -29,7 +29,7 @@
</Menu> </Menu>
<MenuItem fx:id="saveTransaction" mnemonicParsing="false" text="Save Transaction..." accelerator="Shortcut+S" onAction="#saveTransaction"/> <MenuItem fx:id="saveTransaction" mnemonicParsing="false" text="Save Transaction..." accelerator="Shortcut+S" onAction="#saveTransaction"/>
<Menu fx:id="savePSBT" mnemonicParsing="false" text="Save PSBT"> <Menu fx:id="savePSBT" mnemonicParsing="false" text="Save PSBT">
<MenuItem text="As Binary..." onAction="#savePSBTBinary" accelerator="Shortcut+S"/> <MenuItem fx:id="savePSBTBinary" text="As Binary..." onAction="#savePSBTBinary" accelerator="Shortcut+S"/>
<MenuItem text="As Base64..." onAction="#savePSBTText"/> <MenuItem text="As Base64..." onAction="#savePSBTText"/>
<MenuItem text="As Binary (No Xpubs)..." onAction="#savePSBTBinaryNoXpubs"/> <MenuItem text="As Binary (No Xpubs)..." onAction="#savePSBTBinaryNoXpubs"/>
<MenuItem text="As Base64 (No Xpubs)..." onAction="#savePSBTTextNoXpubs"/> <MenuItem text="As Base64 (No Xpubs)..." onAction="#savePSBTTextNoXpubs"/>