]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
TxInfoDialog: add copy Tx ID button
authortobtoht <thotbot@protonmail.com>
Tue, 12 Oct 2021 12:58:54 +0000 (14:58 +0200)
committertobtoht <thotbot@protonmail.com>
Tue, 12 Oct 2021 12:58:54 +0000 (14:58 +0200)
src/dialog/TxInfoDialog.cpp
src/dialog/TxInfoDialog.h
src/dialog/TxInfoDialog.ui

index 69576e74034e24366c415f3ef8075fdbc2c40e03..76a7ef43d4fd4c0b2e987c77b501770c3f151ae1 100644 (file)
@@ -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();
index 0041471aa6ebec2d5c08e70bd8e85b7f3222e60e..0de4a374c008b1ee2529c86b62fd13aac96cb6e2 100644 (file)
@@ -28,6 +28,7 @@ signals:
     void resendTranscation(const QString &txid);
 
 private:
+    void copyTxID();
     void copyTxKey();
     void createTxProof();
     void setData(TransactionInfo *tx);
index 02b18c82a0e97c927942ed10a5dbb117cea3f15b..f925805834343e914be51b26020d42e396b24dfc 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>929</width>
-    <height>631</height>
+    <height>715</height>
    </rect>
   </property>
   <property name="windowTitle">
    </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>