Adding 'copy txid' to qt tx overview context menu

This commit is contained in:
Richard Schwab 2013-03-21 10:33:36 +01:00
parent 8ab14e6976
commit 598889973b
2 changed files with 9 additions and 0 deletions

View file

@ -123,6 +123,7 @@ TransactionView::TransactionView(QWidget *parent) :
QAction *copyAddressAction = new QAction(tr("Copy address"), this); QAction *copyAddressAction = new QAction(tr("Copy address"), this);
QAction *copyLabelAction = new QAction(tr("Copy label"), this); QAction *copyLabelAction = new QAction(tr("Copy label"), this);
QAction *copyAmountAction = new QAction(tr("Copy amount"), 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 *editLabelAction = new QAction(tr("Edit label"), this);
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this); QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
@ -130,6 +131,7 @@ TransactionView::TransactionView(QWidget *parent) :
contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyAddressAction);
contextMenu->addAction(copyLabelAction); contextMenu->addAction(copyLabelAction);
contextMenu->addAction(copyAmountAction); contextMenu->addAction(copyAmountAction);
contextMenu->addAction(copyTxIDAction);
contextMenu->addAction(editLabelAction); contextMenu->addAction(editLabelAction);
contextMenu->addAction(showDetailsAction); contextMenu->addAction(showDetailsAction);
@ -145,6 +147,7 @@ TransactionView::TransactionView(QWidget *parent) :
connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress())); connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel())); connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount())); connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));
connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel())); connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails())); connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
} }
@ -309,6 +312,11 @@ void TransactionView::copyAmount()
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::FormattedAmountRole); GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::FormattedAmountRole);
} }
void TransactionView::copyTxID()
{
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxIDRole);
}
void TransactionView::editLabel() void TransactionView::editLabel()
{ {
if(!transactionView->selectionModel() ||!model) if(!transactionView->selectionModel() ||!model)

View file

@ -66,6 +66,7 @@ private slots:
void editLabel(); void editLabel();
void copyLabel(); void copyLabel();
void copyAmount(); void copyAmount();
void copyTxID();
signals: signals:
void doubleClicked(const QModelIndex&); void doubleClicked(const QModelIndex&);