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

Method showMenu

src/qt/coincontroldialog.cpp:176–208  ·  view source on GitHub ↗

context menu

Source from the content-addressed store, hash-verified

174
175// context menu
176void CoinControlDialog::showMenu(const QPoint &point)
177{
178 QTreeWidgetItem *item = ui->treeWidget->itemAt(point);
179 if(item)
180 {
181 contextMenuItem = item;
182
183 // disable some items (like Copy Transaction ID, lock, unlock) for tree roots in context menu
184 if (item->data(COLUMN_ADDRESS, TxHashRole).toString().length() == 64) // transaction hash is 64 characters (this means it is a child node, so it is not a parent node in tree mode)
185 {
186 m_copy_transaction_outpoint_action->setEnabled(true);
187 if (model->wallet().isLockedCoin(COutPoint(uint256S(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt())))
188 {
189 lockAction->setEnabled(false);
190 unlockAction->setEnabled(true);
191 }
192 else
193 {
194 lockAction->setEnabled(true);
195 unlockAction->setEnabled(false);
196 }
197 }
198 else // this means click on parent node in tree mode -> disable all
199 {
200 m_copy_transaction_outpoint_action->setEnabled(false);
201 lockAction->setEnabled(false);
202 unlockAction->setEnabled(false);
203 }
204
205 // show context menu
206 contextMenu->exec(QCursor::pos());
207 }
208}
209
210// context menu action: copy amount
211void CoinControlDialog::copyAmount()

Callers

nothing calls this directly

Calls 7

uint256SFunction · 0.85
isLockedCoinMethod · 0.80
execMethod · 0.80
COutPointClass · 0.70
dataMethod · 0.45
setEnabledMethod · 0.45
walletMethod · 0.45

Tested by

no test coverage detected