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 Sep 5, 2021
1 parent 0ebd88f commit 3ec061d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,11 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_

// create peer table context menu
peersTableContextMenu = new QMenu(this);
//: Context menu action to copy the address of a peer
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 d&ay"), [this] { banSelectedNode(60 * 60 * 24); });
Expand Down

0 comments on commit 3ec061d

Please sign in to comment.