Browse Source

TxInfoDialog: add copy Tx ID button

1.0.0
tobtoht 4 months ago
parent
commit
3deaa1bc1d
Signed by: tobtoht GPG Key ID: 1CADD27F41F45C3C
  1. 9
      src/dialog/TxInfoDialog.cpp
  2. 1
      src/dialog/TxInfoDialog.h
  3. 11
      src/dialog/TxInfoDialog.ui

9
src/dialog/TxInfoDialog.cpp

@ -29,8 +29,9 @@ TxInfoDialog::TxInfoDialog(QSharedPointer<AppContext> 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();

1
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);

11
src/dialog/TxInfoDialog.ui

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>929</width>
<height>631</height>
<height>715</height>
</rect>
</property>
<property name="windowTitle">
@ -205,10 +205,17 @@
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QPushButton" name="btn_copyTxID">
<property name="text">
<string>Copy Tx ID/hash</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_CopyTxKey">
<property name="text">
<string>Copy Transaction Key</string>
<string>Copy Tx Secret Key</string>
</property>
</widget>
</item>

Loading…
Cancel
Save