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 <jarolrod@tutanota.com>
  • Loading branch information
hebasto and jarolrod committed May 26, 2021
1 parent 2fd90bd commit 85e0f95
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 @@ -647,6 +647,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 day"), [this] { banSelectedNode(60 * 60 * 24); });
Expand Down

0 comments on commit 85e0f95

Please sign in to comment.