From 3deaa1bc1d234bfb08809a7e879782a09b9a452c Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 12 Oct 2021 14:58:54 +0200 Subject: [PATCH] TxInfoDialog: add copy Tx ID button --- src/dialog/TxInfoDialog.cpp | 9 +++++++-- src/dialog/TxInfoDialog.h | 1 + src/dialog/TxInfoDialog.ui | 11 +++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/dialog/TxInfoDialog.cpp b/src/dialog/TxInfoDialog.cpp index 69576e7..76a7ef4 100644 --- a/src/dialog/TxInfoDialog.cpp +++ b/src/dialog/TxInfoDialog.cpp @@ -29,8 +29,9 @@ TxInfoDialog::TxInfoDialog(QSharedPointer ctx, TransactionInfo *txIn m_txid = txInfo->hash(); ui->label_txid->setText(m_txid); - connect(ui->btn_CopyTxKey, &QPushButton::pressed, this, &TxInfoDialog::copyTxKey); - connect(ui->btn_createTxProof, &QPushButton::pressed, this, &TxInfoDialog::createTxProof); + connect(ui->btn_copyTxID, &QPushButton::clicked, this, &TxInfoDialog::copyTxID); + connect(ui->btn_CopyTxKey, &QPushButton::clicked, this, &TxInfoDialog::copyTxKey); + connect(ui->btn_createTxProof, &QPushButton::clicked, this, &TxInfoDialog::createTxProof); connect(m_ctx->wallet, &Wallet::newBlock, this, &TxInfoDialog::updateData); @@ -140,6 +141,10 @@ void TxInfoDialog::updateData() { this->setData(tx); } +void TxInfoDialog::copyTxID() { + Utils::copyToClipboard(m_txid); +} + void TxInfoDialog::copyTxKey() { m_ctx->wallet->getTxKeyAsync(m_txid, [this](QVariantMap map){ QString txKey = map.value("tx_key").toString(); diff --git a/src/dialog/TxInfoDialog.h b/src/dialog/TxInfoDialog.h index 0041471..0de4a37 100644 --- a/src/dialog/TxInfoDialog.h +++ b/src/dialog/TxInfoDialog.h @@ -28,6 +28,7 @@ signals: void resendTranscation(const QString &txid); private: + void copyTxID(); void copyTxKey(); void createTxProof(); void setData(TransactionInfo *tx); diff --git a/src/dialog/TxInfoDialog.ui b/src/dialog/TxInfoDialog.ui index 02b18c8..f925805 100644 --- a/src/dialog/TxInfoDialog.ui +++ b/src/dialog/TxInfoDialog.ui @@ -7,7 +7,7 @@ 0 0 929 - 631 + 715 @@ -205,10 +205,17 @@ + + + + Copy Tx ID/hash + + + - Copy Transaction Key + Copy Tx Secret Key