Skip to content

Commit

Permalink
refactor: use new QAction style for governance list and masternode list
Browse files Browse the repository at this point in the history
  • Loading branch information
knst committed Aug 5, 2024
1 parent 4f89c98 commit 1cdd9fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/qt/governancelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
9 changes: 3 additions & 6 deletions src/qt/masternodelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1cdd9fb

Please sign in to comment.