Skip to content

Commit 3bb3ad2

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

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/qt/forms/debugwindow.ui

Lines changed: 1 addition & 1 deletion
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: 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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
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>
2222
#include <util/system.h>
2323
#include <util/threadnames.h>
@@ -45,6 +45,7 @@
4545
#include <QTime>
4646
#include <QTimer>
4747

48+
#include <string>
4849

4950
const int CONSOLE_HISTORY = 50;
5051
const int INITIAL_TRAFFIC_GRAPH_MINS = 30;
@@ -444,7 +445,7 @@ void RPCExecutor::request(const QString &command, const WalletModel* wallet_mode
444445
}
445446
}
446447

447-
RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformStyle, QWidget *parent) :
448+
RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle* _platformStyle, QWidget* parent) :
448449
QWidget(parent),
449450
m_node(node),
450451
ui(new Ui::RPCConsole),
@@ -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+
const QChar nonbreaking_hyphen(8209);
464+
const std::vector<QString> CONNECTION_TYPE_DOC{
465+
tr("Inbound: 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)