From dfa781e16cf9adb63344fa3319dabffd6545ba8b Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 7 Dec 2020 14:12:11 +0200 Subject: [PATCH] subscription handling for multiple app windows --- .../sparrowwallet/sparrow/AppController.java | 90 ++++++++++--------- .../sparrowwallet/sparrow/AppServices.java | 10 ++- .../sparrow/control/EntryCell.java | 4 +- .../sparrow/control/MessageSignDialog.java | 3 +- .../sparrow/event/OpenWalletsEvent.java | 9 +- .../sparrow/event/RequestQRScanEvent.java | 15 +++- .../event/RequestTransactionOpenEvent.java | 15 +++- .../sparrow/event/RequestWalletOpenEvent.java | 15 +++- .../sparrow/event/ViewPSBTEvent.java | 13 ++- .../sparrow/event/ViewTransactionEvent.java | 17 ++-- .../transaction/HeadersController.java | 10 +-- .../sparrow/transaction/InputController.java | 2 +- .../sparrow/transaction/OutputController.java | 2 +- .../sparrow/wallet/SendController.java | 2 +- .../com/sparrowwallet/sparrow/darktheme.css | 4 + 15 files changed, 145 insertions(+), 66 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index e2df277e..3040d1dd 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -168,7 +168,7 @@ public class AppController implements Initializable { boolean walletAdded = c.getAddedSubList().stream().anyMatch(tab -> ((TabData)tab.getUserData()).getType() == TabData.TabType.WALLET); boolean walletRemoved = c.getRemoved().stream().anyMatch(tab -> ((TabData)tab.getUserData()).getType() == TabData.TabType.WALLET); if(walletAdded || walletRemoved) { - EventManager.get().post(new OpenWalletsEvent(getOpenWallets())); + EventManager.get().post(new OpenWalletsEvent(tabs.getScene().getWindow(), getOpenWallets())); } List closedWalletTabs = c.getRemoved().stream().map(tab -> (TabData)tab.getUserData()) @@ -361,7 +361,7 @@ public class AppController implements Initializable { showErrorDialog("Invalid transaction ID", "A transaction with that ID could not be found."); } else { Platform.runLater(() -> { - EventManager.get().post(new ViewTransactionEvent(blockTransaction)); + EventManager.get().post(new ViewTransactionEvent(tabs.getScene().getWindow(), blockTransaction)); }); } }); @@ -1000,27 +1000,28 @@ public class AppController implements Initializable { @Subscribe public void tabSelected(TabSelectedEvent event) { - //TODO: Handle multiple windows - String tabName = event.getTabName(); - if(tabs.getScene() != null) { - Stage tabStage = (Stage)tabs.getScene().getWindow(); - tabStage.setTitle("Sparrow - " + tabName); - } + if(tabs.getTabs().contains(event.getTab())) { + String tabName = event.getTabName(); + if(tabs.getScene() != null) { + Stage tabStage = (Stage)tabs.getScene().getWindow(); + tabStage.setTitle("Sparrow - " + tabName); + } - if(event instanceof TransactionTabSelectedEvent) { - TransactionTabSelectedEvent txTabEvent = (TransactionTabSelectedEvent)event; - TransactionTabData transactionTabData = txTabEvent.getTransactionTabData(); - saveTransaction.setDisable(false); - saveTransaction.setText("Save " + (transactionTabData.getPsbt() == null || transactionTabData.getPsbt().getTransaction() != transactionTabData.getTransaction() ? "Transaction..." : "PSBT...")); - exportWallet.setDisable(true); - showTxHex.setDisable(false); - } else if(event instanceof WalletTabSelectedEvent) { - WalletTabSelectedEvent walletTabEvent = (WalletTabSelectedEvent)event; - WalletTabData walletTabData = walletTabEvent.getWalletTabData(); - saveTransaction.setDisable(true); - saveTransaction.setText("Save Transaction..."); - exportWallet.setDisable(walletTabData.getWallet() == null || !walletTabData.getWallet().isValid()); - showTxHex.setDisable(true); + if(event instanceof TransactionTabSelectedEvent) { + TransactionTabSelectedEvent txTabEvent = (TransactionTabSelectedEvent)event; + TransactionTabData transactionTabData = txTabEvent.getTransactionTabData(); + saveTransaction.setDisable(false); + saveTransaction.setText("Save " + (transactionTabData.getPsbt() == null || transactionTabData.getPsbt().getTransaction() != transactionTabData.getTransaction() ? "Transaction..." : "PSBT...")); + exportWallet.setDisable(true); + showTxHex.setDisable(false); + } else if(event instanceof WalletTabSelectedEvent) { + WalletTabSelectedEvent walletTabEvent = (WalletTabSelectedEvent)event; + WalletTabData walletTabData = walletTabEvent.getWalletTabData(); + saveTransaction.setDisable(true); + saveTransaction.setText("Save Transaction..."); + exportWallet.setDisable(walletTabData.getWallet() == null || !walletTabData.getWallet().isValid()); + showTxHex.setDisable(true); + } } } @@ -1039,14 +1040,19 @@ public class AppController implements Initializable { @Subscribe public void walletSettingsChanged(WalletSettingsChangedEvent event) { - //TODO: Handle multiple windows - exportWallet.setDisable(!event.getWallet().isValid()); + Tab tab = tabs.getSelectionModel().getSelectedItem(); + TabData tabData = (TabData)tab.getUserData(); + if(tabData instanceof WalletTabData) { + WalletTabData walletTabData = (WalletTabData)tabData; + if(walletTabData.getWalletForm().getWalletFile().equals(event.getWalletFile())) { + exportWallet.setDisable(!event.getWallet().isValid()); + } + } } @Subscribe public void newWalletTransactions(NewWalletTransactionsEvent event) { - //TODO: Handle multiple windows - if(Config.get().isNotifyNewTransactions()) { + if(Config.get().isNotifyNewTransactions() && getOpenWallets().containsKey(event.getWallet())) { String text; if(event.getBlockTransactions().size() == 1) { BlockTransaction blockTransaction = event.getBlockTransactions().get(0); @@ -1184,16 +1190,18 @@ public class AppController implements Initializable { @Subscribe public void viewTransaction(ViewTransactionEvent event) { - //TODO: Handle multiple windows - Tab tab = addTransactionTab(event.getBlockTransaction(), event.getInitialView(), event.getInitialIndex()); - tabs.getSelectionModel().select(tab); + if(tabs.getScene().getWindow().equals(event.getWindow())) { + Tab tab = addTransactionTab(event.getBlockTransaction(), event.getInitialView(), event.getInitialIndex()); + tabs.getSelectionModel().select(tab); + } } @Subscribe public void viewPSBT(ViewPSBTEvent event) { - //TODO: Handle multiple windows - Tab tab = addTransactionTab(event.getLabel(), event.getPsbt()); - tabs.getSelectionModel().select(tab); + if(tabs.getScene().getWindow().equals(event.getWindow())) { + Tab tab = addTransactionTab(event.getLabel(), event.getPsbt()); + tabs.getSelectionModel().select(tab); + } } @Subscribe @@ -1204,25 +1212,27 @@ public class AppController implements Initializable { @Subscribe public void requestOpenWallets(RequestOpenWalletsEvent event) { - //TODO: Handle multiple windows - EventManager.get().post(new OpenWalletsEvent(getOpenWallets())); + EventManager.get().post(new OpenWalletsEvent(tabs.getScene().getWindow(), getOpenWallets())); } @Subscribe public void requestWalletOpen(RequestWalletOpenEvent event) { - //TODO: Handle multiple windows - openWallet(null); + if(tabs.getScene().getWindow().equals(event.getWindow())) { + openWallet(null); + } } @Subscribe public void requestTransactionOpen(RequestTransactionOpenEvent event) { - //TODO: Handle multiple windows - openTransactionFromFile(null); + if(tabs.getScene().getWindow().equals(event.getWindow())) { + openTransactionFromFile(null); + } } @Subscribe public void requestQRScan(RequestQRScanEvent event) { - //TODO: Handle multiple windows - openTransactionFromQR(null); + if(tabs.getScene().getWindow().equals(event.getWindow())) { + openTransactionFromQR(null); + } } } \ No newline at end of file diff --git a/src/main/java/com/sparrowwallet/sparrow/AppServices.java b/src/main/java/com/sparrowwallet/sparrow/AppServices.java index 50ae41c4..41cd2621 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppServices.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppServices.java @@ -52,6 +52,8 @@ public class AppServices { private final MainApp application; + private final Map> windows = new LinkedHashMap<>(); + private static final BooleanProperty onlineProperty = new SimpleBooleanProperty(false); private ExchangeSource.RatesService ratesService; @@ -381,12 +383,14 @@ public class AppServices { @Subscribe public void openWallets(OpenWalletsEvent event) { - List walletFiles = event.getWalletsMap().values().stream().map(Storage::getWalletFile).collect(Collectors.toList()); - //TODO: Handle multiple windows + windows.put(event.getWindow(), event.getWalletsMap()); + List> allWallets = windows.values().stream().flatMap(map -> map.entrySet().stream()).collect(Collectors.toList()); + + List walletFiles = allWallets.stream().map(entry -> entry.getValue().getWalletFile()).collect(Collectors.toList()); Config.get().setRecentWalletFiles(walletFiles); boolean usbWallet = false; - for(Map.Entry entry : event.getWalletsMap().entrySet()) { + for(Map.Entry entry : allWallets) { Wallet wallet = entry.getKey(); Storage storage = entry.getValue(); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java index cbf9257c..fe87c34f 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java @@ -68,7 +68,7 @@ class EntryCell extends TreeTableCell { searchGlyph.setFontSize(12); viewTransactionButton.setGraphic(searchGlyph); viewTransactionButton.setOnAction(event -> { - EventManager.get().post(new ViewTransactionEvent(transactionEntry.getBlockTransaction())); + EventManager.get().post(new ViewTransactionEvent(this.getScene().getWindow(), transactionEntry.getBlockTransaction())); }); actionBox.getChildren().add(viewTransactionButton); @@ -135,7 +135,7 @@ class EntryCell extends TreeTableCell { searchGlyph.setFontSize(12); viewTransactionButton.setGraphic(searchGlyph); viewTransactionButton.setOnAction(event -> { - EventManager.get().post(new ViewTransactionEvent(hashIndexEntry.getBlockTransaction(), hashIndexEntry)); + EventManager.get().post(new ViewTransactionEvent(this.getScene().getWindow(), hashIndexEntry.getBlockTransaction(), hashIndexEntry)); }); actionBox.getChildren().add(viewTransactionButton); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java index 74daf1fe..a1631242 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/MessageSignDialog.java @@ -304,7 +304,8 @@ public class MessageSignDialog extends Dialog { public void openWallets(OpenWalletsEvent event) { Storage storage = event.getStorage(wallet); if(storage == null) { - throw new IllegalStateException("Wallet " + wallet + " without Storage"); + //Another window, ignore + return; } WalletPasswordDialog dlg = new WalletPasswordDialog(WalletPasswordDialog.PasswordRequirement.LOAD); diff --git a/src/main/java/com/sparrowwallet/sparrow/event/OpenWalletsEvent.java b/src/main/java/com/sparrowwallet/sparrow/event/OpenWalletsEvent.java index 04cb423e..20205a2b 100644 --- a/src/main/java/com/sparrowwallet/sparrow/event/OpenWalletsEvent.java +++ b/src/main/java/com/sparrowwallet/sparrow/event/OpenWalletsEvent.java @@ -2,18 +2,25 @@ package com.sparrowwallet.sparrow.event; import com.sparrowwallet.drongo.wallet.Wallet; import com.sparrowwallet.sparrow.io.Storage; +import javafx.stage.Window; import java.util.ArrayList; import java.util.List; import java.util.Map; public class OpenWalletsEvent { + private final Window window; private final Map walletsMap; - public OpenWalletsEvent(Map walletsMap) { + public OpenWalletsEvent(Window window, Map walletsMap) { + this.window = window; this.walletsMap = walletsMap; } + public Window getWindow() { + return window; + } + public List getWallets() { return new ArrayList<>(walletsMap.keySet()); } diff --git a/src/main/java/com/sparrowwallet/sparrow/event/RequestQRScanEvent.java b/src/main/java/com/sparrowwallet/sparrow/event/RequestQRScanEvent.java index aa44b10f..47f68406 100644 --- a/src/main/java/com/sparrowwallet/sparrow/event/RequestQRScanEvent.java +++ b/src/main/java/com/sparrowwallet/sparrow/event/RequestQRScanEvent.java @@ -1,5 +1,18 @@ package com.sparrowwallet.sparrow.event; +import javafx.stage.Window; + +/** + * Event class used to request the QRScanDialog is opened + */ public class RequestQRScanEvent { - //Empty event class used to request the QRScanDialog is opened + private final Window window; + + public RequestQRScanEvent(Window window) { + this.window = window; + } + + public Window getWindow() { + return window; + } } diff --git a/src/main/java/com/sparrowwallet/sparrow/event/RequestTransactionOpenEvent.java b/src/main/java/com/sparrowwallet/sparrow/event/RequestTransactionOpenEvent.java index 5b53c007..88ec5ffa 100644 --- a/src/main/java/com/sparrowwallet/sparrow/event/RequestTransactionOpenEvent.java +++ b/src/main/java/com/sparrowwallet/sparrow/event/RequestTransactionOpenEvent.java @@ -1,5 +1,18 @@ package com.sparrowwallet.sparrow.event; +import javafx.stage.Window; + +/** + * Event class used to request the transaction open file dialog + */ public class RequestTransactionOpenEvent { - //Empty event class used to request the transaction open file dialog + private final Window window; + + public RequestTransactionOpenEvent(Window window) { + this.window = window; + } + + public Window getWindow() { + return window; + } } diff --git a/src/main/java/com/sparrowwallet/sparrow/event/RequestWalletOpenEvent.java b/src/main/java/com/sparrowwallet/sparrow/event/RequestWalletOpenEvent.java index b6796f2f..eedf6fb5 100644 --- a/src/main/java/com/sparrowwallet/sparrow/event/RequestWalletOpenEvent.java +++ b/src/main/java/com/sparrowwallet/sparrow/event/RequestWalletOpenEvent.java @@ -1,5 +1,18 @@ package com.sparrowwallet.sparrow.event; +import javafx.stage.Window; + +/** + * Event class used to request the wallet open dialog + */ public class RequestWalletOpenEvent { - //Empty event class used to request the wallet open dialog + private final Window window; + + public RequestWalletOpenEvent(Window window) { + this.window = window; + } + + public Window getWindow() { + return window; + } } diff --git a/src/main/java/com/sparrowwallet/sparrow/event/ViewPSBTEvent.java b/src/main/java/com/sparrowwallet/sparrow/event/ViewPSBTEvent.java index a5e3f31c..fe42f8d9 100644 --- a/src/main/java/com/sparrowwallet/sparrow/event/ViewPSBTEvent.java +++ b/src/main/java/com/sparrowwallet/sparrow/event/ViewPSBTEvent.java @@ -2,24 +2,31 @@ package com.sparrowwallet.sparrow.event; import com.sparrowwallet.drongo.psbt.PSBT; import com.sparrowwallet.sparrow.transaction.TransactionView; +import javafx.stage.Window; public class ViewPSBTEvent { + private final Window window; private final String label; private final PSBT psbt; private final TransactionView initialView; private final Integer initialIndex; - public ViewPSBTEvent(String label, PSBT psbt) { - this(label, psbt, TransactionView.HEADERS, null); + public ViewPSBTEvent(Window window, String label, PSBT psbt) { + this(window, label, psbt, TransactionView.HEADERS, null); } - public ViewPSBTEvent(String label, PSBT psbt, TransactionView initialView, Integer initialIndex) { + public ViewPSBTEvent(Window window, String label, PSBT psbt, TransactionView initialView, Integer initialIndex) { + this.window = window; this.label = label; this.psbt = psbt; this.initialView = initialView; this.initialIndex = initialIndex; } + public Window getWindow() { + return window; + } + public String getLabel() { return label; } diff --git a/src/main/java/com/sparrowwallet/sparrow/event/ViewTransactionEvent.java b/src/main/java/com/sparrowwallet/sparrow/event/ViewTransactionEvent.java index 0ddd53ed..17812473 100644 --- a/src/main/java/com/sparrowwallet/sparrow/event/ViewTransactionEvent.java +++ b/src/main/java/com/sparrowwallet/sparrow/event/ViewTransactionEvent.java @@ -3,26 +3,33 @@ package com.sparrowwallet.sparrow.event; import com.sparrowwallet.drongo.wallet.BlockTransaction; import com.sparrowwallet.sparrow.transaction.TransactionView; import com.sparrowwallet.sparrow.wallet.HashIndexEntry; +import javafx.stage.Window; public class ViewTransactionEvent { + private final Window window; private final BlockTransaction blockTransaction; private final TransactionView initialView; private final Integer initialIndex; - public ViewTransactionEvent(BlockTransaction blockTransaction) { - this(blockTransaction, TransactionView.HEADERS, null); + public ViewTransactionEvent(Window window, BlockTransaction blockTransaction) { + this(window, blockTransaction, TransactionView.HEADERS, null); } - public ViewTransactionEvent(BlockTransaction blockTransaction, HashIndexEntry hashIndexEntry) { - this(blockTransaction, hashIndexEntry.getType().equals(HashIndexEntry.Type.INPUT) ? TransactionView.INPUT : TransactionView.OUTPUT, (int)hashIndexEntry.getHashIndex().getIndex()); + public ViewTransactionEvent(Window window, BlockTransaction blockTransaction, HashIndexEntry hashIndexEntry) { + this(window, blockTransaction, hashIndexEntry.getType().equals(HashIndexEntry.Type.INPUT) ? TransactionView.INPUT : TransactionView.OUTPUT, (int)hashIndexEntry.getHashIndex().getIndex()); } - public ViewTransactionEvent(BlockTransaction blockTransaction, TransactionView initialView, Integer initialIndex) { + public ViewTransactionEvent(Window window, BlockTransaction blockTransaction, TransactionView initialView, Integer initialIndex) { + this.window = window; this.blockTransaction = blockTransaction; this.initialView = initialView; this.initialIndex = initialIndex; } + public Window getWindow() { + return window; + } + public BlockTransaction getBlockTransaction() { return blockTransaction; } diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java index 6cfe5d0f..6af5819b 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/HeadersController.java @@ -609,7 +609,7 @@ public class HeadersController extends TransactionFormController implements Init } public void openWallet(ActionEvent event) { - EventManager.get().post(new RequestWalletOpenEvent()); + EventManager.get().post(new RequestWalletOpenEvent(noWalletsWarningLink.getScene().getWindow())); } public void finalizeTransaction(ActionEvent event) { @@ -635,7 +635,7 @@ public class HeadersController extends TransactionFormController implements Init ToggleButton toggleButton = (ToggleButton)event.getSource(); toggleButton.setSelected(false); - EventManager.get().post(new RequestQRScanEvent()); + EventManager.get().post(new RequestQRScanEvent(toggleButton.getScene().getWindow())); } public void savePSBT(ActionEvent event) { @@ -668,7 +668,7 @@ public class HeadersController extends TransactionFormController implements Init ToggleButton toggleButton = (ToggleButton)event.getSource(); toggleButton.setSelected(false); - EventManager.get().post(new RequestTransactionOpenEvent()); + EventManager.get().post(new RequestTransactionOpenEvent(toggleButton.getScene().getWindow())); } public void signPSBT(ActionEvent event) { @@ -830,7 +830,7 @@ public class HeadersController extends TransactionFormController implements Init try { Payjoin payjoin = new Payjoin(payjoinURI, headersForm.getSigningWallet(), headersForm.getPsbt()); PSBT proposalPsbt = payjoin.requestPayjoinPSBT(true); - EventManager.get().post(new ViewPSBTEvent(headersForm.getName() + " Payjoin", proposalPsbt)); + EventManager.get().post(new ViewPSBTEvent(payjoinButton.getScene().getWindow(), headersForm.getName() + " Payjoin", proposalPsbt)); } catch(PayjoinReceiverException e) { AppServices.showErrorDialog("Invalid Payjoin Transaction", e.getMessage()); } @@ -884,7 +884,7 @@ public class HeadersController extends TransactionFormController implements Init @Subscribe public void openWallets(OpenWalletsEvent event) { - if(headersForm.getPsbt() != null && headersForm.getBlockTransaction() == null) { + if((id.getScene() == null || id.getScene().getWindow().equals(event.getWindow())) && headersForm.getPsbt() != null && headersForm.getBlockTransaction() == null) { List availableWallets = event.getWallets().stream().filter(wallet -> wallet.canSign(headersForm.getPsbt())).sorted(new WalletSignComparator()).collect(Collectors.toList()); Map availableWalletsMap = new LinkedHashMap<>(event.getWalletsMap()); availableWalletsMap.keySet().retainAll(availableWallets); diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/InputController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/InputController.java index d635c1d1..8a80f634 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/InputController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/InputController.java @@ -194,7 +194,7 @@ public class InputController extends TransactionFormController implements Initia linkedOutpoint.setText(txInput.getOutpoint().getHash().toString() + ":" + txInput.getOutpoint().getIndex()); linkedOutpoint.setOnAction(event -> { BlockTransaction linkedTransaction = inputTransactions.get(txInput.getOutpoint().getHash()); - EventManager.get().post(new ViewTransactionEvent(linkedTransaction, TransactionView.OUTPUT, (int)txInput.getOutpoint().getIndex())); + EventManager.get().post(new ViewTransactionEvent(linkedOutpoint.getScene().getWindow(), linkedTransaction, TransactionView.OUTPUT, (int)txInput.getOutpoint().getIndex())); }); linkedOutpoint.setContextMenu(new TransactionReferenceContextMenu(linkedOutpoint.getText())); } diff --git a/src/main/java/com/sparrowwallet/sparrow/transaction/OutputController.java b/src/main/java/com/sparrowwallet/sparrow/transaction/OutputController.java index 3d0733c3..7c97e67c 100644 --- a/src/main/java/com/sparrowwallet/sparrow/transaction/OutputController.java +++ b/src/main/java/com/sparrowwallet/sparrow/transaction/OutputController.java @@ -148,7 +148,7 @@ public class OutputController extends TransactionFormController implements Initi final Integer inputIndex = i; spentBy.setText(outputBlockTransaction.getHash().toString() + ":" + inputIndex); spentBy.setOnAction(event -> { - EventManager.get().post(new ViewTransactionEvent(outputBlockTransaction, TransactionView.INPUT, inputIndex)); + EventManager.get().post(new ViewTransactionEvent(spentBy.getScene().getWindow(), outputBlockTransaction, TransactionView.INPUT, inputIndex)); }); spentBy.setContextMenu(new TransactionReferenceContextMenu(spentBy.getText())); } diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java index 744fce2a..c6ca9683 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/SendController.java @@ -728,7 +728,7 @@ public class SendController extends WalletFormController implements Initializabl addWalletTransactionNodes(); createdWalletTransactionProperty.set(walletTransactionProperty.get()); PSBT psbt = walletTransactionProperty.get().createPSBT(); - EventManager.get().post(new ViewPSBTEvent(walletTransactionProperty.get().getPayments().get(0).getLabel(), psbt)); + EventManager.get().post(new ViewPSBTEvent(createButton.getScene().getWindow(), walletTransactionProperty.get().getPayments().get(0).getLabel(), psbt)); } private void addWalletTransactionNodes() { diff --git a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css index f3ff4d65..4d487f9f 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css +++ b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css @@ -102,6 +102,10 @@ -fx-text-fill: #e06c75; } +.root #noWalletsWarning .glyph-font { + -fx-text-fill: #e06c75; +} + .root .etched-raised-border { -fx-border-color: #ffffff, #000000; -fx-border-style: solid, solid;