Skip to content

Commit f3153dc

Browse files
jonatackhebasto
andcommitted
gui: improve markup handling of connection type tooltip
Co-authored-by: Hennadii Stepanov <[email protected]>
1 parent 4f09615 commit f3153dc

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/qt/forms/debugwindow.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@
10791079
<item row="1" column="0">
10801080
<widget class="QLabel" name="peerConnectionTypeLabel">
10811081
<property name="toolTip">
1082-
<string>The type of peer connection:&lt;ul&gt;&lt;li&gt;Inbound Full/Block Relay: initiated by peer&lt;/li&gt;&lt;li&gt;Outbound Full Relay: default&lt;/li&gt;&lt;li&gt;Outbound Block Relay: does not relay transactions or addresses&lt;/li&gt;&lt;li&gt;Outbound Manual: added using RPC %1 or %2/%3 configuration options&lt;/li&gt;&lt;li&gt;Outbound Feeler: short-lived, for testing addresses&lt;/li&gt;&lt;li&gt;Outbound Address Fetch: short-lived, for soliciting addresses&lt;/li&gt;&lt;/ul&gt;</string>
1082+
<string>The type of peer connection: %1</string>
10831083
</property>
10841084
<property name="text">
10851085
<string>Connection Type</string>

src/qt/rpcconsole.cpp

+15-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
#include <chainparams.h>
1717
#include <interfaces/node.h>
1818
#include <netbase.h>
19-
#include <rpc/server.h>
2019
#include <rpc/client.h>
20+
#include <rpc/server.h>
2121
#include <util/strencodings.h>
22+
#include <util/string.h>
2223
#include <util/system.h>
2324
#include <util/threadnames.h>
2425

@@ -459,11 +460,22 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
459460

460461
ui->splitter->restoreState(settings.value("PeersTabSplitterSizes").toByteArray());
461462

462-
QChar nonbreaking_hyphen(8209);
463+
constexpr QChar nonbreaking_hyphen(8209);
464+
const std::vector<QString> CONNECTION_TYPE_DOC{
465+
tr("Inbound Full/Block Relay: initiated by peer"),
466+
tr("Outbound Full Relay: default"),
467+
tr("Outbound Block Relay: does not relay transactions or addresses"),
468+
tr("Outbound Manual: added using RPC %1 or %2/%3 configuration options")
469+
.arg("addnode")
470+
.arg(QString(nonbreaking_hyphen) + "addnode")
471+
.arg(QString(nonbreaking_hyphen) + "connect"),
472+
tr("Outbound Feeler: short-lived, for testing addresses"),
473+
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
474+
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
475+
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));
463476
ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
464477
ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
465478
ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(PACKAGE_NAME));
466-
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg("addnode").arg(QString(nonbreaking_hyphen) + "addnode").arg(QString(nonbreaking_hyphen) + "connect"));
467479

468480
if (platformStyle->getImagesOnButtons()) {
469481
ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export"));

0 commit comments

Comments
 (0)