From 4c408ac7b1ef80e446569a55fb876991b43e557b Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 17 Jul 2023 10:52:01 +0200 Subject: [PATCH] make send to many dialog non-modal, menu command brings an existing dialog to foreground --- .../com/sparrowwallet/sparrow/AppController.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index df5935d0..bace3f60 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -210,6 +210,8 @@ public class AppController implements Initializable { private Timeline statusTimeline; + private SendToManyDialog sendToManyDialog; + private Tab previouslySelectedTab; private boolean subTabsVisible; @@ -1286,6 +1288,13 @@ public class AppController implements Initializable { } public void sendToMany(ActionEvent event) { + if(sendToManyDialog != null) { + Stage stage = (Stage)sendToManyDialog.getDialogPane().getScene().getWindow(); + stage.setAlwaysOnTop(true); + stage.setAlwaysOnTop(false); + return; + } + WalletForm selectedWalletForm = getSelectedWalletForm(); if(selectedWalletForm != null) { Wallet wallet = selectedWalletForm.getWallet(); @@ -1294,8 +1303,10 @@ public class AppController implements Initializable { bitcoinUnit = wallet.getAutoUnit(); } - SendToManyDialog sendToManyDialog = new SendToManyDialog(bitcoinUnit); + sendToManyDialog = new SendToManyDialog(bitcoinUnit); + sendToManyDialog.initModality(Modality.NONE); Optional> optPayments = sendToManyDialog.showAndWait(); + sendToManyDialog = null; optPayments.ifPresent(payments -> { if(!payments.isEmpty()) { EventManager.get().post(new SendActionEvent(wallet, new ArrayList<>(wallet.getSpendableUtxos().keySet())));