Skip to content

Commit d367a4e

Browse files
committed
Merge #505: Hide peers details
41a1a86 gui: Hide peers details (@RandyMcMillan) Pull request description: Add a close (X) button to the Peers Detail panel. Reuse the same icon used in the Console Tab. The close button deselects the peer highlighted in the PeerTableView and hides the detail panel. fixes #485 Co-authored-by: @w0xlt <[email protected]> ACKs for top commit: pablomartin4btc: re ACK 41a1a86 hebasto: ACK 41a1a86, tested on Ubuntu 23.10. Tree-SHA512: fc692891eec61bd1e6878f2433b478de3c69bf0b3ce3471f2faafda6f63d371e2cc125ae8290fd2ac3e4d8659031b79d85665318cfc5a9481e967ef99d245f9c
2 parents 4c62f4b + 41a1a86 commit d367a4e

File tree

2 files changed

+113
-36
lines changed

2 files changed

+113
-36
lines changed

src/qt/forms/debugwindow.ui

+111-36
Original file line numberDiff line numberDiff line change
@@ -984,42 +984,117 @@
984984
</size>
985985
</property>
986986
<layout class="QVBoxLayout" name="verticalLayout_8">
987-
<item>
988-
<widget class="QLabel" name="peerHeading">
989-
<property name="sizePolicy">
990-
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
991-
<horstretch>0</horstretch>
992-
<verstretch>0</verstretch>
993-
</sizepolicy>
994-
</property>
995-
<property name="minimumSize">
996-
<size>
997-
<width>0</width>
998-
<height>32</height>
999-
</size>
1000-
</property>
1001-
<property name="font">
1002-
<font>
1003-
<pointsize>10</pointsize>
1004-
</font>
1005-
</property>
1006-
<property name="cursor">
1007-
<cursorShape>IBeamCursor</cursorShape>
1008-
</property>
1009-
<property name="text">
1010-
<string>Select a peer to view detailed information.</string>
1011-
</property>
1012-
<property name="alignment">
1013-
<set>Qt::AlignHCenter|Qt::AlignTop</set>
1014-
</property>
1015-
<property name="wordWrap">
1016-
<bool>true</bool>
1017-
</property>
1018-
<property name="textInteractionFlags">
1019-
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
1020-
</property>
1021-
</widget>
1022-
</item>
987+
<item>
988+
<layout class="QHBoxLayout" name="horizontalLayout_8">
989+
<property name="topMargin">
990+
<number>0</number>
991+
</property>
992+
<property name="bottomMargin">
993+
<number>0</number>
994+
</property>
995+
<item>
996+
<widget class="QLabel" name="peerHeading">
997+
<property name="sizePolicy">
998+
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
999+
<horstretch>0</horstretch>
1000+
<verstretch>0</verstretch>
1001+
</sizepolicy>
1002+
</property>
1003+
<property name="minimumSize">
1004+
<size>
1005+
<width>0</width>
1006+
<height>32</height>
1007+
</size>
1008+
</property>
1009+
<property name="font">
1010+
<font>
1011+
<pointsize>10</pointsize>
1012+
</font>
1013+
</property>
1014+
<property name="cursor">
1015+
<cursorShape>IBeamCursor</cursorShape>
1016+
</property>
1017+
<property name="text">
1018+
<string>Select a peer to view detailed information.</string>
1019+
</property>
1020+
<property name="alignment">
1021+
<set>Qt::AlignHCenter|Qt::AlignTop</set>
1022+
</property>
1023+
<property name="wordWrap">
1024+
<bool>true</bool>
1025+
</property>
1026+
<property name="textInteractionFlags">
1027+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
1028+
</property>
1029+
</widget>
1030+
</item>
1031+
<item>
1032+
<widget class="QWidget" name="hidePeersDetail" native="true">
1033+
<property name="enabled">
1034+
<bool>true</bool>
1035+
</property>
1036+
<property name="minimumSize">
1037+
<size>
1038+
<width>32</width>
1039+
<height>32</height>
1040+
</size>
1041+
</property>
1042+
<property name="maximumSize">
1043+
<size>
1044+
<width>32</width>
1045+
<height>32</height>
1046+
</size>
1047+
</property>
1048+
<widget class="QToolButton" name="hidePeersDetailButton">
1049+
<property name="geometry">
1050+
<rect>
1051+
<x>0</x>
1052+
<y>0</y>
1053+
<width>32</width>
1054+
<height>32</height>
1055+
</rect>
1056+
</property>
1057+
<property name="minimumSize">
1058+
<size>
1059+
<width>32</width>
1060+
<height>32</height>
1061+
</size>
1062+
</property>
1063+
<property name="baseSize">
1064+
<size>
1065+
<width>32</width>
1066+
<height>32</height>
1067+
</size>
1068+
</property>
1069+
<property name="toolTip">
1070+
<string>Hide Peers Detail</string>
1071+
</property>
1072+
<property name="layoutDirection">
1073+
<enum>Qt::LeftToRight</enum>
1074+
</property>
1075+
<property name="text">
1076+
<string />
1077+
</property>
1078+
<property name="icon">
1079+
<iconset resource="../bitcoin.qrc">
1080+
<normaloff>:/icons/remove</normaloff>
1081+
:/icons/remove
1082+
</iconset>
1083+
</property>
1084+
<property name="iconSize">
1085+
<size>
1086+
<width>22</width>
1087+
<height>22</height>
1088+
</size>
1089+
</property>
1090+
<property name="shortcut">
1091+
<string>Ctrl+X</string>
1092+
</property>
1093+
</widget>
1094+
</widget>
1095+
</item>
1096+
</layout>
1097+
</item>
10231098
<item>
10241099
<widget class="QScrollArea" name="scrollArea">
10251100
<property name="widgetResizable">

src/qt/rpcconsole.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
560560
ui->lineEdit->setMaxLength(16 * 1024 * 1024);
561561
ui->messagesWidget->installEventFilter(this);
562562

563+
connect(ui->hidePeersDetailButton, &QAbstractButton::clicked, this, &RPCConsole::clearSelectedNode);
563564
connect(ui->clearButton, &QAbstractButton::clicked, [this] { clear(); });
564565
connect(ui->fontBiggerButton, &QAbstractButton::clicked, this, &RPCConsole::fontBigger);
565566
connect(ui->fontSmallerButton, &QAbstractButton::clicked, this, &RPCConsole::fontSmaller);
@@ -1251,6 +1252,7 @@ void RPCConsole::updateDetailWidget()
12511252
ui->peerRelayTxes->setText(stats->nodeStateStats.m_relay_txs ? ts.yes : ts.no);
12521253
}
12531254

1255+
ui->hidePeersDetailButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
12541256
ui->peersTabRightPanel->show();
12551257
}
12561258

0 commit comments

Comments
 (0)