context menu
| 174 | |
| 175 | // context menu |
| 176 | void 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 |
| 211 | void CoinControlDialog::copyAmount() |
nothing calls this directly
no test coverage detected