mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Merge bitcoin-core/gui#436: Include vout when copying transaction ID from coin selection
10c6929d55ba9bc203bbadfb834537445dbd67ce Include vout when copying transaction ID from coin selection (Samuel Dobson) Pull request description: Fixes #432 I think it makes sense to just add the vout to the existing function because I can't imagine a situation where a user in the coin selection dialog would want just the transaction ID rather than the specific outpoint, and they can just delete it from the end anyway. ACKs for top commit: kristapsk: ACK 10c6929d55ba9bc203bbadfb834537445dbd67ce hebasto: ACK 10c6929d55ba9bc203bbadfb834537445dbd67ce, tested on Linux Mint 20.2 (Qt 5.12.8). shaavan: ACK 10c6929 Tree-SHA512: df4d132b6c2fd0b590594e91cf54f82c6c0f77ee9ca06296fb726bc3c52b9ae459ca3b50c48b2bf303ccafe832b6b4dba692a812f439991ca6d807ea0d8df934
This commit is contained in:
parent
02b5fce942
commit
95aeb6a08d
@ -67,7 +67,7 @@ CoinControlDialog::CoinControlDialog(CCoinControl& coin_control, WalletModel* _m
|
|||||||
contextMenu->addAction(tr("&Copy address"), this, &CoinControlDialog::copyAddress);
|
contextMenu->addAction(tr("&Copy address"), this, &CoinControlDialog::copyAddress);
|
||||||
contextMenu->addAction(tr("Copy &label"), this, &CoinControlDialog::copyLabel);
|
contextMenu->addAction(tr("Copy &label"), this, &CoinControlDialog::copyLabel);
|
||||||
contextMenu->addAction(tr("Copy &amount"), this, &CoinControlDialog::copyAmount);
|
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();
|
contextMenu->addSeparator();
|
||||||
lockAction = contextMenu->addAction(tr("L&ock unspent"), this, &CoinControlDialog::lockCoin);
|
lockAction = contextMenu->addAction(tr("L&ock unspent"), this, &CoinControlDialog::lockCoin);
|
||||||
unlockAction = contextMenu->addAction(tr("&Unlock unspent"), this, &CoinControlDialog::unlockCoin);
|
unlockAction = contextMenu->addAction(tr("&Unlock unspent"), this, &CoinControlDialog::unlockCoin);
|
||||||
@ -235,7 +235,7 @@ void CoinControlDialog::showMenu(const QPoint &point)
|
|||||||
// disable some items (like Copy Transaction ID, lock, unlock) for tree roots in context menu
|
// 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)
|
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())))
|
if (model->wallet().isLockedCoin(COutPoint(uint256S(item->data(COLUMN_ADDRESS, TxHashRole).toString().toStdString()), item->data(COLUMN_ADDRESS, VOutRole).toUInt())))
|
||||||
{
|
{
|
||||||
lockAction->setEnabled(false);
|
lockAction->setEnabled(false);
|
||||||
@ -249,7 +249,7 @@ void CoinControlDialog::showMenu(const QPoint &point)
|
|||||||
}
|
}
|
||||||
else // this means click on parent node in tree mode -> disable all
|
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);
|
lockAction->setEnabled(false);
|
||||||
unlockAction->setEnabled(false);
|
unlockAction->setEnabled(false);
|
||||||
}
|
}
|
||||||
@ -283,10 +283,14 @@ void CoinControlDialog::copyAddress()
|
|||||||
GUIUtil::setClipboard(contextMenuItem->text(COLUMN_ADDRESS));
|
GUIUtil::setClipboard(contextMenuItem->text(COLUMN_ADDRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
// context menu action: copy transaction id
|
// context menu action: copy transaction id and vout index
|
||||||
void CoinControlDialog::copyTransactionHash()
|
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
|
// context menu action: lock coin
|
||||||
|
@ -59,7 +59,7 @@ private:
|
|||||||
|
|
||||||
QMenu *contextMenu;
|
QMenu *contextMenu;
|
||||||
QTreeWidgetItem *contextMenuItem;
|
QTreeWidgetItem *contextMenuItem;
|
||||||
QAction *copyTransactionHashAction;
|
QAction* m_copy_transaction_outpoint_action;
|
||||||
QAction *lockAction;
|
QAction *lockAction;
|
||||||
QAction *unlockAction;
|
QAction *unlockAction;
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ private Q_SLOTS:
|
|||||||
void copyAmount();
|
void copyAmount();
|
||||||
void copyLabel();
|
void copyLabel();
|
||||||
void copyAddress();
|
void copyAddress();
|
||||||
void copyTransactionHash();
|
void copyTransactionOutpoint();
|
||||||
void lockCoin();
|
void lockCoin();
|
||||||
void unlockCoin();
|
void unlockCoin();
|
||||||
void clipboardQuantity();
|
void clipboardQuantity();
|
||||||
|
Loading…
Reference in New Issue
Block a user