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

Method viewItemChanged

src/qt/coincontroldialog.cpp:354–371  ·  view source on GitHub ↗

checkbox clicked by user

Source from the content-addressed store, hash-verified

352
353// checkbox clicked by user
354void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column)
355{
356 if (column == COLUMN_CHECKBOX && 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)
357 {
358 COutPoint outpt(uint256S(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt());
359
360 if (item->checkState(COLUMN_CHECKBOX) == Qt::Unchecked)
361 m_coin_control.UnSelect(outpt);
362 else if (item->isDisabled()) // locked (this happens if "check all" through parent node)
363 item->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);
364 else
365 m_coin_control.Select(outpt);
366
367 // selection changed -> update labels
368 if (ui->treeWidget->isEnabled()) // do not update on every click for (un)select all
369 CoinControlDialog::updateLabels(m_coin_control, model, this);
370 }
371}
372
373// shows count of locked unspent outputs
374void CoinControlDialog::updateLabelLocked()

Callers

nothing calls this directly

Calls 4

uint256SFunction · 0.85
UnSelectMethod · 0.80
dataMethod · 0.45
SelectMethod · 0.45

Tested by

no test coverage detected