MCPcopy Create free account
hub / github.com/ElementsProject/elements / contextualMenu

Method contextualMenu

src/qt/transactionview.cpp:392–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392void TransactionView::contextualMenu(const QPoint &point)
393{
394 QModelIndex index = transactionView->indexAt(point);
395 QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
396 if (selection.empty())
397 return;
398
399 // check if transaction can be abandoned, disable context menu action in case it doesn't
400 uint256 hash;
401 hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
402 abandonAction->setEnabled(model->wallet().transactionCanBeAbandoned(hash));
403 bumpFeeAction->setEnabled(model->wallet().transactionCanBeBumped(hash));
404 copyAddressAction->setEnabled(GUIUtil::hasEntryData(transactionView, 0, TransactionTableModel::AddressRole));
405 copyLabelAction->setEnabled(GUIUtil::hasEntryData(transactionView, 0, TransactionTableModel::LabelRole));
406
407 if (index.isValid()) {
408 GUIUtil::PopupMenu(contextMenu, transactionView->viewport()->mapToGlobal(point));
409 }
410}
411
412void TransactionView::abandonTx()
413{

Callers

nothing calls this directly

Calls 10

hasEntryDataFunction · 0.85
PopupMenuFunction · 0.85
emptyMethod · 0.45
SetHexMethod · 0.45
dataMethod · 0.45
setEnabledMethod · 0.45
walletMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected