diff options
Diffstat (limited to 'src/qt/coincontroldialog.cpp')
-rw-r--r-- | src/qt/coincontroldialog.cpp | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index ca78c96d70..daea2f9cab 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -50,32 +50,16 @@ CoinControlDialog::CoinControlDialog(CCoinControl& coin_control, WalletModel* _m { ui->setupUi(this); - // context menu actions - QAction *copyAddressAction = new QAction(tr("Copy address"), this); - QAction *copyLabelAction = new QAction(tr("Copy label"), this); - QAction *copyAmountAction = new QAction(tr("Copy amount"), this); - copyTransactionHashAction = new QAction(tr("Copy transaction ID"), this); // we need to enable/disable this - lockAction = new QAction(tr("Lock unspent"), this); // we need to enable/disable this - unlockAction = new QAction(tr("Unlock unspent"), this); // we need to enable/disable this - // context menu contextMenu = new QMenu(this); - contextMenu->addAction(copyAddressAction); - contextMenu->addAction(copyLabelAction); - contextMenu->addAction(copyAmountAction); - contextMenu->addAction(copyTransactionHashAction); + 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); contextMenu->addSeparator(); - contextMenu->addAction(lockAction); - contextMenu->addAction(unlockAction); - - // context menu signals + lockAction = contextMenu->addAction(tr("Lock unspent"), this, &CoinControlDialog::lockCoin); + unlockAction = contextMenu->addAction(tr("Unlock unspent"), this, &CoinControlDialog::unlockCoin); connect(ui->treeWidget, &QWidget::customContextMenuRequested, this, &CoinControlDialog::showMenu); - connect(copyAddressAction, &QAction::triggered, this, &CoinControlDialog::copyAddress); - connect(copyLabelAction, &QAction::triggered, this, &CoinControlDialog::copyLabel); - connect(copyAmountAction, &QAction::triggered, this, &CoinControlDialog::copyAmount); - connect(copyTransactionHashAction, &QAction::triggered, this, &CoinControlDialog::copyTransactionHash); - connect(lockAction, &QAction::triggered, this, &CoinControlDialog::lockCoin); - connect(unlockAction, &QAction::triggered, this, &CoinControlDialog::unlockCoin); // clipboard actions QAction *clipboardQuantityAction = new QAction(tr("Copy quantity"), this); |