mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Include vout when copying transaction ID from coin selection
This commit is contained in:
@@ -55,7 +55,7 @@ CoinControlDialog::CoinControlDialog(CCoinControl& coin_control, WalletModel* _m
|
||||
contextMenu->addAction(tr("&Copy address"), this, &CoinControlDialog::copyAddress);
|
||||
contextMenu->addAction(tr("Copy &label"), this, &CoinControlDialog::copyLabel);
|
||||
contextMenu->addAction(tr("Copy &amount"), this, &CoinControlDialog::copyAmount);
|
||||
copyTransactionHashAction = contextMenu->addAction(tr("Copy transaction &ID"), this, &CoinControlDialog::copyTransactionHash);
|
||||
m_copy_transaction_outpoint_action = contextMenu->addAction(tr("Copy transaction &ID and output index"), this, &CoinControlDialog::copyTransactionOutpoint);
|
||||
contextMenu->addSeparator();
|
||||
lockAction = contextMenu->addAction(tr("L&ock unspent"), this, &CoinControlDialog::lockCoin);
|
||||
unlockAction = contextMenu->addAction(tr("&Unlock unspent"), this, &CoinControlDialog::unlockCoin);
|
||||
@@ -180,7 +180,7 @@ void CoinControlDialog::showMenu(const QPoint &point)
|
||||
// disable some items (like Copy Transaction ID, lock, unlock) for tree roots in context menu
|
||||
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)
|
||||
{
|
||||
copyTransactionHashAction->setEnabled(true);
|
||||
m_copy_transaction_outpoint_action->setEnabled(true);
|
||||
if (model->wallet().isLockedCoin(COutPoint(uint256S(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt())))
|
||||
{
|
||||
lockAction->setEnabled(false);
|
||||
@@ -194,7 +194,7 @@ void CoinControlDialog::showMenu(const QPoint &point)
|
||||
}
|
||||
else // this means click on parent node in tree mode -> disable all
|
||||
{
|
||||
copyTransactionHashAction->setEnabled(false);
|
||||
m_copy_transaction_outpoint_action->setEnabled(false);
|
||||
lockAction->setEnabled(false);
|
||||
unlockAction->setEnabled(false);
|
||||
}
|
||||
@@ -228,10 +228,14 @@ void CoinControlDialog::copyAddress()
|
||||
GUIUtil::setClipboard(contextMenuItem->text(COLUMN_ADDRESS));
|
||||
}
|
||||
|
||||
// context menu action: copy transaction id
|
||||
void CoinControlDialog::copyTransactionHash()
|
||||
// context menu action: copy transaction id and vout index
|
||||
void CoinControlDialog::copyTransactionOutpoint()
|
||||
{
|
||||
GUIUtil::setClipboard(contextMenuItem->data(COLUMN_ADDRESS, TxHashRole).toString());
|
||||
const QString address = contextMenuItem->data(COLUMN_ADDRESS, TxHashRole).toString();
|
||||
const QString vout = contextMenuItem->data(COLUMN_ADDRESS, VOutRole).toString();
|
||||
const QString outpoint = QString("%1:%2").arg(address).arg(vout);
|
||||
|
||||
GUIUtil::setClipboard(outpoint);
|
||||
}
|
||||
|
||||
// context menu action: lock coin
|
||||
|
||||
Reference in New Issue
Block a user