qt: Add "Copy address" item to the context menu in the Peers table

Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
This commit is contained in:
Hennadii Stepanov 2021-03-30 09:15:55 +03:00 committed by Jarol Rodriguez
parent 0ebd88fe0b
commit 3ec061d9da

View file

@ -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); });