Changeset View
Changeset View
Standalone View
Standalone View
src/qt/transactionview.cpp
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | TransactionView::TransactionView(const PlatformStyle *platformStyle, | ||||
// Always show scroll bar | // Always show scroll bar | ||||
view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); | view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); | ||||
view->setTabKeyNavigation(false); | view->setTabKeyNavigation(false); | ||||
view->setContextMenuPolicy(Qt::CustomContextMenu); | view->setContextMenuPolicy(Qt::CustomContextMenu); | ||||
view->installEventFilter(this); | view->installEventFilter(this); | ||||
transactionView = view; | transactionView = view; | ||||
transactionView->setObjectName("transactionView"); | |||||
Fabien: Even if I think it is a good practice to name the elements, here the name is set in order to… | |||||
jasonbcoxAuthorUnsubmitted Done Inline ActionsInteresting. I figured all objects required names, but these are the only two objects with them and both are unused. jasonbcox: Interesting. I figured all objects required names, but these are the only two objects with… | |||||
// Actions | // Actions | ||||
abandonAction = new QAction(tr("Abandon transaction"), this); | abandonAction = new QAction(tr("Abandon transaction"), this); | ||||
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 *copyTxIDAction = new QAction(tr("Copy transaction ID"), this); | ||||
QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this); | QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this); | ||||
QAction *copyTxPlainText = | QAction *copyTxPlainText = | ||||
new QAction(tr("Copy full transaction details"), this); | new QAction(tr("Copy full transaction details"), this); | ||||
QAction *editLabelAction = new QAction(tr("Edit label"), this); | QAction *editLabelAction = new QAction(tr("Edit label"), this); | ||||
QAction *showDetailsAction = | QAction *showDetailsAction = | ||||
new QAction(tr("Show transaction details"), this); | new QAction(tr("Show transaction details"), this); | ||||
contextMenu = new QMenu(this); | contextMenu = new QMenu(this); | ||||
contextMenu->setObjectName("contextMenu"); | |||||
FabienUnsubmitted Done Inline ActionsDito, this one seems to have no use even in the original PR Fabien: Dito, this one seems to have no use even in the original PR | |||||
contextMenu->addAction(copyAddressAction); | contextMenu->addAction(copyAddressAction); | ||||
contextMenu->addAction(copyLabelAction); | contextMenu->addAction(copyLabelAction); | ||||
contextMenu->addAction(copyAmountAction); | contextMenu->addAction(copyAmountAction); | ||||
contextMenu->addAction(copyTxIDAction); | contextMenu->addAction(copyTxIDAction); | ||||
contextMenu->addAction(copyTxHexAction); | contextMenu->addAction(copyTxHexAction); | ||||
contextMenu->addAction(copyTxPlainText); | contextMenu->addAction(copyTxPlainText); | ||||
contextMenu->addAction(showDetailsAction); | contextMenu->addAction(showDetailsAction); | ||||
contextMenu->addSeparator(); | contextMenu->addSeparator(); | ||||
▲ Show 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | void TransactionView::contextualMenu(const QPoint &point) { | ||||
TxId txid; | TxId txid; | ||||
txid.SetHex(selection.at(0) | txid.SetHex(selection.at(0) | ||||
.data(TransactionTableModel::TxHashRole) | .data(TransactionTableModel::TxHashRole) | ||||
.toString() | .toString() | ||||
.toStdString()); | .toStdString()); | ||||
abandonAction->setEnabled(model->transactionCanBeAbandoned(txid)); | abandonAction->setEnabled(model->transactionCanBeAbandoned(txid)); | ||||
if (index.isValid()) { | if (index.isValid()) { | ||||
contextMenu->exec(QCursor::pos()); | contextMenu->popup(transactionView->viewport()->mapToGlobal(point)); | ||||
} | } | ||||
} | } | ||||
void TransactionView::abandonTx() { | void TransactionView::abandonTx() { | ||||
if (!transactionView || !transactionView->selectionModel()) { | if (!transactionView || !transactionView->selectionModel()) { | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |
Even if I think it is a good practice to name the elements, here the name is set in order to let the BumpFee function find the view in the original PR, and actually has no other usage.