diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 8601e320..72decf15 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -2021,9 +2021,12 @@ tradeDetailsWindow.agentAddresses=Arbitrator/Mediator tradeDetailsWindow.detailData=Detail data txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. +txDetailsWindow.xmr.noteSent=You have sent XMR. +txDetailsWindow.xmr.noteReceived=You have received XMR. txDetailsWindow.sentTo=Sent to +txDetailsWindow.receivedWith=Received with txDetailsWindow.txId=TxId +txDetailsWindow.txKey=Transaction Key closedTradesSummaryWindow.headline=Trade history summary closedTradesSummaryWindow.totalAmount.title=Total trade amount diff --git a/core/src/main/resources/i18n/displayStrings_cs.properties b/core/src/main/resources/i18n/displayStrings_cs.properties index a3edc2ec..4ff0d73a 100644 --- a/core/src/main/resources/i18n/displayStrings_cs.properties +++ b/core/src/main/resources/i18n/displayStrings_cs.properties @@ -1502,8 +1502,10 @@ tradeDetailsWindow.agentAddresses=Rozhodce/Mediátor tradeDetailsWindow.detailData=Detailní data txDetailsWindow.headline=Detaily transakce -txDetailsWindow.xmr.note=Poslali jste XMR. +txDetailsWindow.xmr.noteSent=Poslali jste XMR. +txDetailsWindow.xmr.noteReceived=Obdrželi jste XMR. txDetailsWindow.sentTo=Odesláno na +txDetailsWindow.receivedWith=Přijato s txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Souhrn uzavřených obchodů diff --git a/core/src/main/resources/i18n/displayStrings_de.properties b/core/src/main/resources/i18n/displayStrings_de.properties index 1dc5d740..39e8bf33 100644 --- a/core/src/main/resources/i18n/displayStrings_de.properties +++ b/core/src/main/resources/i18n/displayStrings_de.properties @@ -1502,8 +1502,10 @@ tradeDetailsWindow.agentAddresses=Vermittler/Mediator tradeDetailsWindow.detailData=Detaillierte Daten txDetailsWindow.headline=Transaktionsdetails -txDetailsWindow.xmr.note=Sie haben XMR gesendet. +txDetailsWindow.xmr.noteSent=Sie haben XMR gesendet. +txDetailsWindow.xmr.noteReceived=Sie haben XMR erhalten. txDetailsWindow.sentTo=Gesendet an +txDetailsWindow.receivedWith=Erhalten mit txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_es.properties b/core/src/main/resources/i18n/displayStrings_es.properties index a3af6a0f..cff751f9 100644 --- a/core/src/main/resources/i18n/displayStrings_es.properties +++ b/core/src/main/resources/i18n/displayStrings_es.properties @@ -1503,8 +1503,10 @@ tradeDetailsWindow.agentAddresses=Árbitro/Mediador tradeDetailsWindow.detailData=Detalle de datos txDetailsWindow.headline=Detalles de transacción -txDetailsWindow.xmr.note=Ha enviado XMR +txDetailsWindow.xmr.noteSent=Ha enviado XMR +txDetailsWindow.xmr.noteReceived=Has recibido XMR. txDetailsWindow.sentTo=Enviado a +txDetailsWindow.receivedWith=Recibido con txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Resume de historia de intercambio diff --git a/core/src/main/resources/i18n/displayStrings_fa.properties b/core/src/main/resources/i18n/displayStrings_fa.properties index b0dd0764..84f2ade8 100644 --- a/core/src/main/resources/i18n/displayStrings_fa.properties +++ b/core/src/main/resources/i18n/displayStrings_fa.properties @@ -1498,8 +1498,10 @@ tradeDetailsWindow.agentAddresses=Arbitrator/Mediator tradeDetailsWindow.detailData=Detail data txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. -txDetailsWindow.sentTo=Sent to +txDetailsWindow.xmr.noteSent=شما XMR ارسال کرده‌اید. +txDetailsWindow.xmr.noteReceived=شما XMR دریافت کرده‌اید. +txDetailsWindow.sentTo=ارسال به +txDetailsWindow.receivedWith=دریافت با txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_fr.properties b/core/src/main/resources/i18n/displayStrings_fr.properties index 901d3a19..1dc5406e 100644 --- a/core/src/main/resources/i18n/displayStrings_fr.properties +++ b/core/src/main/resources/i18n/displayStrings_fr.properties @@ -1504,8 +1504,10 @@ tradeDetailsWindow.agentAddresses=Arbitre/Médiateur tradeDetailsWindow.detailData=Données détaillées txDetailsWindow.headline=Détails de la transaction -txDetailsWindow.xmr.note=Vous avez envoyé du XMR. +txDetailsWindow.xmr.noteSent=Vous avez envoyé du XMR. +txDetailsWindow.xmr.noteReceived=Vous avez reçu XMR. txDetailsWindow.sentTo=Envoyé à +txDetailsWindow.receivedWith=Reçu avec txDetailsWindow.txId=ID de transaction closedTradesSummaryWindow.headline=Résumé de l'historique de trade diff --git a/core/src/main/resources/i18n/displayStrings_it.properties b/core/src/main/resources/i18n/displayStrings_it.properties index 8eb8e159..123e2342 100644 --- a/core/src/main/resources/i18n/displayStrings_it.properties +++ b/core/src/main/resources/i18n/displayStrings_it.properties @@ -1501,8 +1501,10 @@ tradeDetailsWindow.agentAddresses=Arbitro/Mediatore tradeDetailsWindow.detailData=Detail data txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. -txDetailsWindow.sentTo=Sent to +txDetailsWindow.xmr.noteSent=Hai inviato XMR. +txDetailsWindow.xmr.noteReceived=Hai ricevuto XMR. +txDetailsWindow.sentTo=Inviato a +txDetailsWindow.receivedWith=Ricevuto con txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_ja.properties b/core/src/main/resources/i18n/displayStrings_ja.properties index 8f187cff..6956b840 100644 --- a/core/src/main/resources/i18n/displayStrings_ja.properties +++ b/core/src/main/resources/i18n/displayStrings_ja.properties @@ -1502,8 +1502,10 @@ tradeDetailsWindow.agentAddresses=仲裁者 / 調停人 tradeDetailsWindow.detailData=詳細データ txDetailsWindow.headline=トランザクション詳細 -txDetailsWindow.xmr.note=XMRを送金しました。 +txDetailsWindow.xmr.noteSent=XMRを送金しました。 +txDetailsWindow.xmr.noteReceived=XMRを受け取りました。 txDetailsWindow.sentTo=送信先 +txDetailsWindow.receivedWith=受け取りました。 txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_pt-br.properties b/core/src/main/resources/i18n/displayStrings_pt-br.properties index 19d7498f..08ac8984 100644 --- a/core/src/main/resources/i18n/displayStrings_pt-br.properties +++ b/core/src/main/resources/i18n/displayStrings_pt-br.properties @@ -1505,8 +1505,10 @@ tradeDetailsWindow.agentAddresses=Árbitro/Mediador tradeDetailsWindow.detailData=Detail data txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. -txDetailsWindow.sentTo=Sent to +txDetailsWindow.xmr.noteSent=Você enviou XMR. +txDetailsWindow.xmr.noteReceived=Você recebeu XMR. +txDetailsWindow.sentTo=Enviado para +txDetailsWindow.receivedWith=Recebido com txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_pt.properties b/core/src/main/resources/i18n/displayStrings_pt.properties index a14e3c7b..70243d55 100644 --- a/core/src/main/resources/i18n/displayStrings_pt.properties +++ b/core/src/main/resources/i18n/displayStrings_pt.properties @@ -1498,8 +1498,10 @@ tradeDetailsWindow.agentAddresses=Árbitro/Mediador tradeDetailsWindow.detailData=Detail data txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. -txDetailsWindow.sentTo=Sent to +txDetailsWindow.xmr.noteSent=Você enviou XMR. +txDetailsWindow.xmr.noteReceived=Você recebeu XMR. +txDetailsWindow.sentTo=Enviado para +txDetailsWindow.receivedWith=Recebido com txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_ru.properties b/core/src/main/resources/i18n/displayStrings_ru.properties index 346053e1..fc562735 100644 --- a/core/src/main/resources/i18n/displayStrings_ru.properties +++ b/core/src/main/resources/i18n/displayStrings_ru.properties @@ -1499,8 +1499,10 @@ tradeDetailsWindow.agentAddresses=Arbitrator/Mediator tradeDetailsWindow.detailData=Detail data txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. -txDetailsWindow.sentTo=Sent to +txDetailsWindow.xmr.noteSent=Вы отправили XMR. +txDetailsWindow.xmr.noteReceived=Вы получили XMR. +txDetailsWindow.sentTo=Отправлено в +txDetailsWindow.receivedWith=Получено с txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_th.properties b/core/src/main/resources/i18n/displayStrings_th.properties index 626916d1..1b75f244 100644 --- a/core/src/main/resources/i18n/displayStrings_th.properties +++ b/core/src/main/resources/i18n/displayStrings_th.properties @@ -1499,8 +1499,10 @@ tradeDetailsWindow.agentAddresses=Arbitrator/Mediator tradeDetailsWindow.detailData=Detail data txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. -txDetailsWindow.sentTo=Sent to +txDetailsWindow.xmr.noteSent=คุณได้ส่ง XMR แล้ว +txDetailsWindow.xmr.noteReceived=คุณได้รับ XMR แล้ว +txDetailsWindow.sentTo=ส่งไปยัง +txDetailsWindow.receivedWith=ได้รับด้วย txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_tr.properties b/core/src/main/resources/i18n/displayStrings_tr.properties index 73304ada..3f13ff55 100644 --- a/core/src/main/resources/i18n/displayStrings_tr.properties +++ b/core/src/main/resources/i18n/displayStrings_tr.properties @@ -2016,8 +2016,10 @@ tradeDetailsWindow.agentAddresses=Hakem/Arabulucu tradeDetailsWindow.detailData=Detay verileri txDetailsWindow.headline=İşlem Detayları -txDetailsWindow.xmr.note=XMR gönderdiniz. +txDetailsWindow.xmr.noteSent=XMR gönderdiniz. +txDetailsWindow.xmr.noteReceived=XMR aldınız. txDetailsWindow.sentTo=Gönderilen adres +txDetailsWindow.receivedWith=Alındı ile txDetailsWindow.txId=İşlem Kimliği (TxId) closedTradesSummaryWindow.headline=Ticaret geçmişi özeti diff --git a/core/src/main/resources/i18n/displayStrings_vi.properties b/core/src/main/resources/i18n/displayStrings_vi.properties index ca3f46aa..a6ead95a 100644 --- a/core/src/main/resources/i18n/displayStrings_vi.properties +++ b/core/src/main/resources/i18n/displayStrings_vi.properties @@ -1501,8 +1501,10 @@ tradeDetailsWindow.agentAddresses=Arbitrator/Mediator tradeDetailsWindow.detailData=Detail data txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. -txDetailsWindow.sentTo=Sent to +txDetailsWindow.xmr.noteSent=Bạn đã gửi XMR. +txDetailsWindow.xmr.noteReceived=Bạn đã nhận được XMR. +txDetailsWindow.sentTo=Gửi đến +txDetailsWindow.receivedWith=Đã nhận với txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_zh-hans.properties b/core/src/main/resources/i18n/displayStrings_zh-hans.properties index c9dce9d7..de1e8b1d 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hans.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hans.properties @@ -1503,8 +1503,10 @@ tradeDetailsWindow.agentAddresses=仲裁员/调解员 tradeDetailsWindow.detailData=详情数据 txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. -txDetailsWindow.sentTo=Sent to +txDetailsWindow.xmr.noteSent=您已发送 XMR。 +txDetailsWindow.xmr.noteReceived=你已收到XMR。 +txDetailsWindow.sentTo=发送至 +txDetailsWindow.receivedWith=已收到,带有 txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/core/src/main/resources/i18n/displayStrings_zh-hant.properties b/core/src/main/resources/i18n/displayStrings_zh-hant.properties index 53ee27d2..7f5f2299 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hant.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hant.properties @@ -1503,8 +1503,10 @@ tradeDetailsWindow.agentAddresses=仲裁員/調解員 tradeDetailsWindow.detailData=Detail data txDetailsWindow.headline=Transaction Details -txDetailsWindow.xmr.note=You have sent XMR. -txDetailsWindow.sentTo=Sent to +txDetailsWindow.xmr.noteSent=您已發送XMR。 +txDetailsWindow.xmr.noteReceived=您已收到 XMR。 +txDetailsWindow.sentTo=發送至 +txDetailsWindow.receivedWith=已收到與 txDetailsWindow.txId=TxId closedTradesSummaryWindow.headline=Trade history summary diff --git a/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionsListItem.java b/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionsListItem.java index f0baf8c9..b325b04e 100644 --- a/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionsListItem.java +++ b/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionsListItem.java @@ -42,7 +42,7 @@ import java.util.Date; import java.util.Optional; @Slf4j -class TransactionsListItem { +public class TransactionsListItem { private String dateString; private final Date date; private final String txId; @@ -61,6 +61,8 @@ class TransactionsListItem { private boolean initialTxConfidenceVisibility = true; private final Supplier lazyFieldsSupplier; private XmrWalletService xmrWalletService; + @Getter + private MoneroTxWallet tx; private static class LazyFields { TxConfidenceIndicator txConfidenceIndicator; @@ -81,6 +83,7 @@ class TransactionsListItem { TransactionsListItem(MoneroTxWallet tx, XmrWalletService xmrWalletService, TransactionAwareTradable transactionAwareTradable) { + this.tx = tx; this.memo = tx.getNote(); this.txId = tx.getHash(); this.xmrWalletService = xmrWalletService; diff --git a/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionsView.java b/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionsView.java index 44fdab6b..284d3369 100644 --- a/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionsView.java +++ b/desktop/src/main/java/haveno/desktop/main/funds/transactions/TransactionsView.java @@ -32,10 +32,10 @@ import haveno.desktop.common.view.FxmlView; import haveno.desktop.components.AddressWithIconAndDirection; import haveno.desktop.components.AutoTooltipButton; import haveno.desktop.components.AutoTooltipLabel; -import haveno.desktop.components.ExternalHyperlink; import haveno.desktop.components.HyperlinkWithIcon; import haveno.desktop.main.overlays.windows.OfferDetailsWindow; import haveno.desktop.main.overlays.windows.TradeDetailsWindow; +import haveno.desktop.main.overlays.windows.TxDetailsWindow; import haveno.desktop.util.GUIUtil; import haveno.network.p2p.P2PService; import java.math.BigInteger; @@ -85,6 +85,7 @@ public class TransactionsView extends ActivatableView { private final Preferences preferences; private final TradeDetailsWindow tradeDetailsWindow; private final OfferDetailsWindow offerDetailsWindow; + private final TxDetailsWindow txDetailsWindow; private EventHandler keyEventEventHandler; private Scene scene; @@ -113,11 +114,13 @@ public class TransactionsView extends ActivatableView { Preferences preferences, TradeDetailsWindow tradeDetailsWindow, OfferDetailsWindow offerDetailsWindow, + TxDetailsWindow txDetailsWindow, DisplayedTransactionsFactory displayedTransactionsFactory) { this.xmrWalletService = xmrWalletService; this.preferences = preferences; this.tradeDetailsWindow = tradeDetailsWindow; this.offerDetailsWindow = offerDetailsWindow; + this.txDetailsWindow = txDetailsWindow; this.displayedTransactions = displayedTransactionsFactory.create(); this.sortedDisplayedTransactions = displayedTransactions.asSortedList(); } @@ -253,6 +256,10 @@ public class TransactionsView extends ActivatableView { tradeDetailsWindow.show((Trade) item.getTradable()); } + private void openTxDetailPopup(TransactionsListItem item) { + txDetailsWindow.show(item); + } + /////////////////////////////////////////////////////////////////////////////////////////// // ColumnCellFactories @@ -376,9 +383,9 @@ public class TransactionsView extends ActivatableView { //noinspection Duplicates if (item != null && !empty) { String transactionId = item.getTxId(); - hyperlinkWithIcon = new ExternalHyperlink(transactionId); - hyperlinkWithIcon.setOnAction(event -> openTxInBlockExplorer(item)); - hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForTx", transactionId))); + hyperlinkWithIcon = new HyperlinkWithIcon(transactionId, AwesomeIcon.INFO_SIGN); + hyperlinkWithIcon.setOnAction(event -> openTxDetailPopup(item)); + hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("txDetailsWindow.headline"))); setGraphic(hyperlinkWithIcon); } else { setGraphic(null); diff --git a/desktop/src/main/java/haveno/desktop/main/funds/withdrawal/WithdrawalView.java b/desktop/src/main/java/haveno/desktop/main/funds/withdrawal/WithdrawalView.java index cc5a7cd1..53b3d70b 100644 --- a/desktop/src/main/java/haveno/desktop/main/funds/withdrawal/WithdrawalView.java +++ b/desktop/src/main/java/haveno/desktop/main/funds/withdrawal/WithdrawalView.java @@ -51,7 +51,7 @@ import haveno.desktop.components.BusyAnimation; import haveno.desktop.components.HyperlinkWithIcon; import haveno.desktop.components.TitledGroupBg; import haveno.desktop.main.overlays.popups.Popup; -import haveno.desktop.main.overlays.windows.TxDetails; +import haveno.desktop.main.overlays.windows.TxWithdrawWindow; import haveno.desktop.main.overlays.windows.WalletPasswordWindow; import haveno.desktop.util.FormBuilder; import haveno.desktop.util.GUIUtil; @@ -333,7 +333,7 @@ public class WithdrawalView extends ActivatableView { xmrWalletService.getWallet().setTxNote(tx.getHash(), withdrawMemoTextField.getText()); // TODO (monero-java): tx note does not persist when tx created then relayed String key = "showTransactionSent"; if (DontShowAgainLookup.showAgain(key)) { - new TxDetails(tx.getHash(), withdrawToAddress, HavenoUtils.formatXmr(receiverAmount, true), HavenoUtils.formatXmr(fee, true), xmrWalletService.getWallet().getTxNote(tx.getHash())) + new TxWithdrawWindow(tx.getHash(), withdrawToAddress, HavenoUtils.formatXmr(receiverAmount, true), HavenoUtils.formatXmr(fee, true), xmrWalletService.getWallet().getTxNote(tx.getHash())) .dontShowAgainId(key) .show(); } diff --git a/desktop/src/main/java/haveno/desktop/main/overlays/windows/TxDetailsWindow.java b/desktop/src/main/java/haveno/desktop/main/overlays/windows/TxDetailsWindow.java new file mode 100644 index 00000000..1af5d97f --- /dev/null +++ b/desktop/src/main/java/haveno/desktop/main/overlays/windows/TxDetailsWindow.java @@ -0,0 +1,108 @@ +/* + * This file is part of Haveno. + * + * Haveno is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Haveno is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Haveno. If not, see . + */ + +package haveno.desktop.main.overlays.windows; + +import haveno.core.locale.Res; +import haveno.core.trade.HavenoUtils; +import haveno.core.xmr.wallet.XmrWalletService; +import haveno.desktop.main.funds.transactions.TransactionsListItem; +import haveno.desktop.main.overlays.Overlay; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Region; +import monero.wallet.model.MoneroTxWallet; + +import static haveno.desktop.util.FormBuilder.addConfirmationLabelLabel; +import static haveno.desktop.util.FormBuilder.addConfirmationLabelTextFieldWithCopyIcon; +import static haveno.desktop.util.FormBuilder.addLabelTxIdTextField; +import static haveno.desktop.util.FormBuilder.addMultilineLabel; +import static haveno.desktop.util.FormBuilder.addTitledGroupBg; + +import java.math.BigInteger; + +import com.google.inject.Inject; + +public class TxDetailsWindow extends Overlay { + + private XmrWalletService xmrWalletService; + private TransactionsListItem item; + + @Inject + public TxDetailsWindow(XmrWalletService xmrWalletService) { + this.xmrWalletService = xmrWalletService; + } + + public void show(TransactionsListItem item) { + this.item = item; + rowIndex = -1; + width = 918; + createGridPane(); + gridPane.setHgap(15); + addHeadLine(); + addContent(); + addButtons(); + addDontShowAgainCheckBox(); + applyStyles(); + display(); + } + + protected void addContent() { + int rows = 10; + MoneroTxWallet tx = item.getTx(); + String memo = tx.getNote(); + if (memo != null && !"".equals(memo)) rows++; + String txKey = null; + boolean isOutgoing = tx.getOutgoingTransfer() != null; + if (isOutgoing) { + try { + txKey = xmrWalletService.getWallet().getTxKey(tx.getHash()); + } catch (Exception e) { + // TODO (monero-java): wallet.getTxKey() should return null if key does not exist instead of throwing exception + } + } + if (txKey != null && !"".equals(txKey)) rows++; + + // add title + addTitledGroupBg(gridPane, ++rowIndex, rows, Res.get("txDetailsWindow.headline")); + Region spacer = new Region(); + spacer.setMinHeight(15); + gridPane.add(spacer, 0, ++rowIndex); + + // add sent or received note + String resKey = isOutgoing ? "txDetailsWindow.xmr.noteSent" : "txDetailsWindow.xmr.noteReceived"; + GridPane.setColumnSpan(addMultilineLabel(gridPane, ++rowIndex, Res.get(resKey), 0), 2); + spacer = new Region(); + spacer.setMinHeight(15); + gridPane.add(spacer, 0, ++rowIndex); + + // add tx fields + addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.dateTime"), item.getDateString()); + BigInteger amount; + if (isOutgoing) { + addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("txDetailsWindow.sentTo"), item.getAddressString()); + amount = tx.getOutgoingAmount(); + } else { + addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("txDetailsWindow.receivedWith"), item.getAddressString()); + amount = tx.getIncomingAmount(); + } + addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.amount"), HavenoUtils.formatXmr(amount)); + addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.txFee"), HavenoUtils.formatXmr(tx.getFee())); + if (memo != null && !"".equals(memo)) addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("funds.withdrawal.memoLabel"), memo); + if (txKey != null && !"".equals(txKey)) addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("txDetailsWindow.txKey"), txKey); + addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("txDetailsWindow.txId"), tx.getHash()); + } +} diff --git a/desktop/src/main/java/haveno/desktop/main/overlays/windows/TxDetails.java b/desktop/src/main/java/haveno/desktop/main/overlays/windows/TxWithdrawWindow.java similarity index 92% rename from desktop/src/main/java/haveno/desktop/main/overlays/windows/TxDetails.java rename to desktop/src/main/java/haveno/desktop/main/overlays/windows/TxWithdrawWindow.java index e96fcb32..f3dfc654 100644 --- a/desktop/src/main/java/haveno/desktop/main/overlays/windows/TxDetails.java +++ b/desktop/src/main/java/haveno/desktop/main/overlays/windows/TxWithdrawWindow.java @@ -28,12 +28,12 @@ import static haveno.desktop.util.FormBuilder.addConfirmationLabelTextFieldWithC import static haveno.desktop.util.FormBuilder.addLabelTxIdTextField; import static haveno.desktop.util.FormBuilder.addMultilineLabel; -public class TxDetails extends Overlay { +public class TxWithdrawWindow extends Overlay { protected String txId, address, amount, fee, memo; protected TxIdTextField txIdTextField; - public TxDetails(String txId, String address, String amount, String fee, String memo) { + public TxWithdrawWindow(String txId, String address, String amount, String fee, String memo) { type = Type.Attention; this.txId = txId; this.address = address; @@ -59,7 +59,7 @@ public class TxDetails extends Overlay { protected void addContent() { GridPane.setColumnSpan( - addMultilineLabel(gridPane, ++rowIndex, Res.get("txDetailsWindow.xmr.note"), 0), 2); + addMultilineLabel(gridPane, ++rowIndex, Res.get("txDetailsWindow.xmr.noteSent"), 0), 2); Region spacer = new Region(); spacer.setMinHeight(20); gridPane.add(spacer, 0, ++rowIndex);