-
Notifications
You must be signed in to change notification settings - Fork 326
Add "Direction" column to peers tab #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
678b572
842f4e8
ad92e04
2bf3f5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,12 +37,14 @@ | |
| #include <QDateTime> | ||
| #include <QFont> | ||
| #include <QKeyEvent> | ||
| #include <QLatin1String> | ||
| #include <QMenu> | ||
| #include <QMessageBox> | ||
| #include <QScreen> | ||
| #include <QScrollBar> | ||
| #include <QSettings> | ||
| #include <QString> | ||
| #include <QStringBuilder> | ||
| #include <QStringList> | ||
| #include <QTime> | ||
| #include <QTimer> | ||
|
|
@@ -53,6 +55,9 @@ const int INITIAL_TRAFFIC_GRAPH_MINS = 30; | |
| const QSize FONT_RANGE(4, 40); | ||
| const char fontSizeSettingsKey[] = "consoleFontSize"; | ||
|
|
||
| const QLatin1String COLON_SPACE{": "}; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting idea. It actually could be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was the first thing I tried but the compiler doesn't like it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's strange, QLatin1String's constructors are constexpr-marked since at least 5.3: https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qstring.h?h=5.3#n89 Sure that wasn't type or something? What kind of message was that? And what compiler? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seemed relevant: https://stackoverflow.com/questions/56201976/qt-vs-constexpr-string-literal Clang 9 and GCC 10.2.1: |
||
| const QLatin1String SPACE{" "}; | ||
|
|
||
| const struct { | ||
| const char *url; | ||
| const char *source; | ||
|
|
@@ -463,16 +468,18 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty | |
|
|
||
| constexpr QChar nonbreaking_hyphen(8209); | ||
| const std::vector<QString> CONNECTION_TYPE_DOC{ | ||
| tr("Inbound: 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") | ||
| //: The connection direction (Inbound/Outbound) is also used in ConnectionTypeToQString() and PeerTableModel::data(). | ||
| //: The connection types (Full Relay, Block Relay, Manual, Feeler, Address Fetch) are also used in ConnectionTypeToQString(). | ||
| tr("Inbound") % COLON_SPACE % tr("initiated by peer"), | ||
| tr("Outbound") % SPACE % tr("Full Relay") % COLON_SPACE % tr("default"), | ||
| tr("Outbound") % SPACE % tr("Block Relay") % COLON_SPACE % tr("does not relay transactions or addresses"), | ||
| tr("Outbound") % SPACE % tr("Manual") % COLON_SPACE % tr("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>"}; | ||
| .arg(QString(nonbreaking_hyphen) % "addnode") | ||
| .arg(QString(nonbreaking_hyphen) % "connect"), | ||
| tr("Outbound") % SPACE % tr("Feeler") % COLON_SPACE % tr("short-lived, for testing addresses"), | ||
| tr("Outbound") % SPACE % tr("Address Fetch") % COLON_SPACE % tr("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)); | ||
| const QString hb_list{"<ul><li>\"" | ||
| + ts.to + "\" – " + tr("we selected the peer for high bandwidth relay") + "</li><li>\"" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it helps only by including (without using
operator %), unless whole bitcoin-qt would be built withQT_USE_QSTRINGBUILDER.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added because this file already uses
%.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, QLatin1String and QStringBuilder included because where simply missing, not because of new usage. New usage would be nice though, but I don't want to be too-QString-nazi..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the nudge, @Talkless. Looked up https://wiki.qt.io/Using_QString_Effectively and updated. Please let me know what you think.