aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactionview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/transactionview.cpp')
-rw-r--r--src/qt/transactionview.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp
index 7acf5deaa3..9240b71c71 100644
--- a/src/qt/transactionview.cpp
+++ b/src/qt/transactionview.cpp
@@ -20,12 +20,9 @@
#include <QLineEdit>
#include <QTableView>
#include <QHeaderView>
-#include <QPushButton>
#include <QMessageBox>
#include <QPoint>
#include <QMenu>
-#include <QApplication>
-#include <QClipboard>
#include <QLabel>
#include <QDateTimeEdit>
@@ -126,6 +123,7 @@ TransactionView::TransactionView(QWidget *parent) :
QAction *copyAddressAction = new QAction(tr("Copy address"), this);
QAction *copyLabelAction = new QAction(tr("Copy label"), this);
QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
+ QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
QAction *editLabelAction = new QAction(tr("Edit label"), this);
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
@@ -133,6 +131,7 @@ TransactionView::TransactionView(QWidget *parent) :
contextMenu->addAction(copyAddressAction);
contextMenu->addAction(copyLabelAction);
contextMenu->addAction(copyAmountAction);
+ contextMenu->addAction(copyTxIDAction);
contextMenu->addAction(editLabelAction);
contextMenu->addAction(showDetailsAction);
@@ -148,6 +147,7 @@ TransactionView::TransactionView(QWidget *parent) :
connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));
+ connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
}
@@ -173,16 +173,11 @@ void TransactionView::setModel(WalletModel *model)
transactionView->sortByColumn(TransactionTableModel::Status, Qt::DescendingOrder);
transactionView->verticalHeader()->hide();
- transactionView->horizontalHeader()->resizeSection(
- TransactionTableModel::Status, 23);
- transactionView->horizontalHeader()->resizeSection(
- TransactionTableModel::Date, 120);
- transactionView->horizontalHeader()->resizeSection(
- TransactionTableModel::Type, 120);
- transactionView->horizontalHeader()->setResizeMode(
- TransactionTableModel::ToAddress, QHeaderView::Stretch);
- transactionView->horizontalHeader()->resizeSection(
- TransactionTableModel::Amount, 100);
+ transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Status, 23);
+ transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Date, 120);
+ transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Type, 120);
+ transactionView->horizontalHeader()->setResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch);
+ transactionView->horizontalHeader()->resizeSection(TransactionTableModel::Amount, 100);
}
}
@@ -317,6 +312,11 @@ void TransactionView::copyAmount()
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::FormattedAmountRole);
}
+void TransactionView::copyTxID()
+{
+ GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxIDRole);
+}
+
void TransactionView::editLabel()
{
if(!transactionView->selectionModel() ||!model)