gui: improve markup handling of connection type tooltip

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
pull/826/head
Jon Atack 4 years ago
parent 4f09615733
commit f3153dc08f
No known key found for this signature in database
GPG Key ID: 4F5721B3D0E3921D

@ -1079,7 +1079,7 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="peerConnectionTypeLabel"> <widget class="QLabel" name="peerConnectionTypeLabel">
<property name="toolTip"> <property name="toolTip">
<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> <string>The type of peer connection: %1</string>
</property> </property>
<property name="text"> <property name="text">
<string>Connection Type</string> <string>Connection Type</string>

@ -16,9 +16,10 @@
#include <chainparams.h> #include <chainparams.h>
#include <interfaces/node.h> #include <interfaces/node.h>
#include <netbase.h> #include <netbase.h>
#include <rpc/server.h>
#include <rpc/client.h> #include <rpc/client.h>
#include <rpc/server.h>
#include <util/strencodings.h> #include <util/strencodings.h>
#include <util/string.h>
#include <util/system.h> #include <util/system.h>
#include <util/threadnames.h> #include <util/threadnames.h>
@ -459,11 +460,22 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
ui->splitter->restoreState(settings.value("PeersTabSplitterSizes").toByteArray()); ui->splitter->restoreState(settings.value("PeersTabSplitterSizes").toByteArray());
QChar nonbreaking_hyphen(8209); constexpr QChar nonbreaking_hyphen(8209);
const std::vector<QString> CONNECTION_TYPE_DOC{
tr("Inbound Full/Block Relay: initiated by peer"),
tr("Outbound Full Relay: default"),
tr("Outbound Block Relay: does not relay transactions or addresses"),
tr("Outbound Manual: added using RPC %1 or %2/%3 configuration options")
.arg("addnode")
.arg(QString(nonbreaking_hyphen) + "addnode")
.arg(QString(nonbreaking_hyphen) + "connect"),
tr("Outbound Feeler: short-lived, for testing addresses"),
tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));
ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir")); ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir")); ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(PACKAGE_NAME)); ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(PACKAGE_NAME));
ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg("addnode").arg(QString(nonbreaking_hyphen) + "addnode").arg(QString(nonbreaking_hyphen) + "connect"));
if (platformStyle->getImagesOnButtons()) { if (platformStyle->getImagesOnButtons()) {
ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export")); ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export"));

Loading…
Cancel
Save