refactor: use new QAction style for governance list and masternode list

This commit is contained in:
Konstantin Akimov 2024-07-13 12:52:14 +07:00
parent 4f89c98dc4
commit 1cdd9fbdf5
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524
2 changed files with 5 additions and 10 deletions

View File

@ -387,14 +387,12 @@ void GovernanceList::showProposalContextMenu(const QPoint& pos)
return;
}
// right click menu with option to open proposal url
QString proposal_url = proposal->url();
proposal_url.replace(QChar('&'), QString("&&"));
// right click menu with option to open proposal url
QAction* openProposalUrl = new QAction(proposal_url, this);
proposalContextMenu->clear();
proposalContextMenu->addAction(openProposalUrl);
connect(openProposalUrl, &QAction::triggered, proposal, &Proposal::openUrl);
proposalContextMenu->addAction(proposal_url, proposal, &Proposal::openUrl);
proposalContextMenu->exec(QCursor::pos());
}

View File

@ -81,15 +81,12 @@ MasternodeList::MasternodeList(QWidget* parent) :
ui->checkBoxMyMasternodesOnly->setEnabled(false);
QAction* copyProTxHashAction = new QAction(tr("Copy ProTx Hash"), this);
QAction* copyCollateralOutpointAction = new QAction(tr("Copy Collateral Outpoint"), this);
contextMenuDIP3 = new QMenu(this);
contextMenuDIP3->addAction(copyProTxHashAction);
contextMenuDIP3->addAction(copyCollateralOutpointAction);
contextMenuDIP3->addAction(tr("Copy ProTx Hash"), this, &MasternodeList::copyProTxHash_clicked);
contextMenuDIP3->addAction(tr("Copy Collateral Outpoint"), this, &MasternodeList::copyCollateralOutpoint_clicked);
connect(ui->tableWidgetMasternodesDIP3, &QTableWidget::customContextMenuRequested, this, &MasternodeList::showContextMenuDIP3);
connect(ui->tableWidgetMasternodesDIP3, &QTableWidget::doubleClicked, this, &MasternodeList::extraInfoDIP3_clicked);
connect(copyProTxHashAction, &QAction::triggered, this, &MasternodeList::copyProTxHash_clicked);
connect(copyCollateralOutpointAction, &QAction::triggered, this, &MasternodeList::copyCollateralOutpoint_clicked);
timer = new QTimer(this);
connect(timer, &QTimer::timeout, this, &MasternodeList::updateDIP3ListScheduled);