Skip to content

Commit

Permalink
qt: Add "Copy address" item to the context menu in the Peers table
Browse files Browse the repository at this point in the history
Co-authored-by: Jarol Rodriguez <[email protected]>
  • Loading branch information
hebasto and jarolrod committed May 5, 2021
1 parent 1d8007a commit 6ee6d2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,10 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_

// create peer table context menu
peersTableContextMenu = new QMenu(this);
peersTableContextMenu->addAction(tr("Copy address"), [this] {
GUIUtil::copyEntryData(ui->peerWidget, PeerTableModel::Address, Qt::DisplayRole);
});
peersTableContextMenu->addSeparator();
peersTableContextMenu->addAction(tr("Disconnect"), this, &RPCConsole::disconnectSelectedNode);
peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 hour"), [this] { banSelectedNode(60 * 60); });
peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 day"), [this] { banSelectedNode(60 * 60 * 24); });
Expand Down

0 comments on commit 6ee6d2f

Please sign in to comment.