qt: Peers tab polish — NetNodeId column, drop Sync Height widget, Copy Address right-click #15
Labels
No labels
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SubGeniusFinance/Offerings-to-Cthulhu#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #13. Two small Qt-only refinements to the Peers tab. Pure
src/qt/*patch — no daemon code, no consensus impact, freeze-cliff-safe.1. Add NetNodeId column
Top table currently shows
Address / Subversion / Ping. Add a 4th columnNodeIdexposingCNodeStats.nodeid(the internalNodeIdtypedef fromsrc/net.h:58).Why it matters:
getpeerinfoJSON output, log lines (Misbehaving:, etc.) and the per-peer detail panePeerTableModel::ColumnIndex, plus header / data switch / sort handlingImplementation:
src/qt/peertablemodel.h: extendenum ColumnIndexto includeNetNodeIdsrc/qt/peertablemodel.cpp: add header label,data()case,NodeLessThan::operator()casesrc/qt/rpcconsole.cpp::setClientModel: addsetColumnWidth(PeerTableModel::NetNodeId, NETNODEID_COLUMN_WIDTH)and the corresponding entry in theColumnWidthsenum inrpcconsole.h(~50 px is plenty)~20 LOC.
2. Add Copy Address right-click context menu
When the user right-clicks a row in the peer table, show a small
QMenuwith a Copy Address action that pushesstats->nodeStats.addrNametoQApplication::clipboard().Pure Qt; no backend touch. Foundation for the future Disconnect / Ban menu items in the companion issues — adding the menu plumbing here makes those follow-ups smaller.
Implementation:
src/qt/rpcconsole.h: declareQMenu *contextMenu;member,showMenu(const QPoint&)slot,copyAddress()slotsrc/qt/rpcconsole.cpp:setClientModel(): setui->peerWidget->setContextMenuPolicy(Qt::CustomContextMenu), constructcontextMenu, addCopy Addressaction, connectcustomContextMenuRequested(QPoint)→showMenu(QPoint)showMenu(QPoint pos)to map the position to a peer andexec()the menucopyAddress()reading the current selection'saddrNameand writing toQApplication::clipboard()~25 LOC.
What this isn't
Offeringsd's code path at allpindexBestKnownBlocktrackingReference behavior
dobbscoin-source/src/qt/peertablemodel.{cpp,h}— model + NetNodeId column patterndobbscoin-source/src/qt/rpcconsole.cpp::showMenu— right-click menu patternsrc/qt/rpcconsole.cpp:264::setClientModel— wiring point for the column width + context menu setupThe guest list now has badge numbers and copy buttons. Iä Iä.
Tested end-to-end on the merge commit (
e9f1c5f):NodeIdcolumn renders as the first column of the peers table, right-aligned, sortable. Right-clicking a row pops the context menu; Copy address pushes the peer'saddrName(e.g.185.197.251.40:48146) to the system clipboard cleanly.windows-build-depends.yml, Qt 5.15.16 / GCC 13-posix): same — column + menu behave identically.Scope correction noted on the issue: the third sub-feature ("drop Sync Height widget") was a no-op because the widgets were never added to
src/qt/forms/rpcconsole.uiin the original #13 port (row 6 oftab_peers / gridLayout_3was skipped). Real Sync Height surfacing is tracked under #18 (pindexBestKnownBlockbackport, parked until post-Codex).The right-click context menu plumbing is now the foundation for:
Closing on next sync via the
closes #15trailer ine9f1c5f.The guest list now has badge numbers and a copy button. Iä Iä.