aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-09-12 18:58:21 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-09-12 19:00:25 +0300
commitee1db7b6dc4e8a3458a7cfb5ead445c56fb75c51 (patch)
tree6bba8a4992441f664c05ca8892a9b0a0a58af2a8 /src
parent5c0f46ca46e23a161649b5150baa01020dc85e48 (diff)
parent3ec061d9da0c8742bd9dec94ffeb82a11d000aba (diff)
downloadbitcoin-ee1db7b6dc4e8a3458a7cfb5ead445c56fb75c51.tar.xz
Merge bitcoin-core/gui#318: Add `Copy address` Peers Tab Context Menu Action
3ec061d9da0c8742bd9dec94ffeb82a11d000aba qt: Add "Copy address" item to the context menu in the Peers table (Hennadii Stepanov) Pull request description: Picking up #264 This adds a `Copy Address` context menu action to the `Peers Tab`. Based on the first commit of PR #317 so that we can use `Qt::DisplayRole` in the `copyEntryData` function. | Master | PR | | ----------- | ----------- | | ![Screen Shot 2021-05-05 at 4 51 11 AM](https://user-images.githubusercontent.com/23396902/117117822-fb067400-ad5d-11eb-9466-228456108e52.png) | ![Screen Shot 2021-05-05 at 4 49 15 AM](https://user-images.githubusercontent.com/23396902/117117835-fe99fb00-ad5d-11eb-8de0-f6a9acdbf40e.png) | ACKs for top commit: shaavan: tACK 3ec061d9da0c8742bd9dec94ffeb82a11d000aba luke-jr: utACK 3ec061d9da0c8742bd9dec94ffeb82a11d000aba hebasto: ACK 3ec061d9da0c8742bd9dec94ffeb82a11d000aba, tested on Linux Mint 20.2 (Qt 5.12.8): Tree-SHA512: be0d7324592aae3928fa3cc522294f17226419fe8cbe3587df12a36bd4fa9c81bead377b13051e950b9a3fcd290b273861e70d6c76b75cdf76eaf58224b834cd
Diffstat (limited to 'src')
-rw-r--r--src/qt/rpcconsole.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 829f7add80..bcfdd1fa80 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -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); });