-
Notifications
You must be signed in to change notification settings - Fork 271
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
Peer details: replace Direction with Connection Type #163
Peer details: replace Direction with Connection Type #163
Conversation
Nice. Concept ACK |
41b97b9
to
bf8135d
Compare
Concept ACK. |
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.
Concept ACK.
I have reviewed the code (bf8135d), and tested it.
bf8135d
to
8e7f82a
Compare
Thanks for the excellent feedback @hebasto! Updated. |
I have reviewed the code (8e7f82a), and tested it. The following patch: --- a/src/qt/forms/debugwindow.ui
+++ b/src/qt/forms/debugwindow.ui
@@ -1079,7 +1079,7 @@
<item row="1" column="0">
<widget class="QLabel" name="peerConnectionTypeLabel">
<property name="toolTip">
- <string>The type of peer connection: Outbound Full Relay (default), Outbound Block Relay (does not relay transactions or addresses), Inbound (initiated by peer), Outbound Manual (added using RPC addnode or -addnode/-connect config options), Outbound Feeler (short-lived, for testing addresses), or Outbound Address Fetch (short-lived, for soliciting addresses).</string>
+ <string>The type of peer connection: Outbound Full Relay (default), Outbound Block Relay (does not relay transactions or addresses), Inbound (initiated by peer), Outbound Manual (added using RPC %1 or %2/%3 config options), Outbound Feeler (short-lived, for testing addresses), or Outbound Address Fetch (short-lived, for soliciting addresses).</string>
</property>
<property name="text">
<string>Connection Type</string>
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -496,6 +496,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
clear();
GUIUtil::handleCloseWindowShortcut(this);
+
+ ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg("addnode").arg(QString(nonbreaking_hyphen) + "addnode").arg(QString(nonbreaking_hyphen) + "connect"));
}
RPCConsole::~RPCConsole() |
Thanks @hebasto, tested and added your suggestion, updated the screenshot in the PR description. |
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.
ACK 6cd242c, tested on Linux Mint 20 (x86_64) + Qt 5.12.8.
4b5a7ae
to
3707f8c
Compare
It was suggested to re-open here. |
Concept re-ACK. Thanks for re-opening. |
3707f8c
to
aef9693
Compare
Rebased. |
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.
aef9693
to
7098509
Compare
Rebased |
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.
7098509
to
be8294f
Compare
be8294f
to
20fa975
Compare
Rebased after the merge of bitcoin/bitcoin#20786. |
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.
re-ACK 20fa975, only rebased since my previous review due to the conflict with bitcoin/bitcoin#20786, verified with
$ git range-diff master be8294ff428da7d13043b3f9a27d7ace1c2dadf4 20fa97560b2d27f94f556a570f3556356877b79f
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.
ACK 20fa975
Tested on macOS Big Sur 11.1 with qt 5.15.2. Looks great!
Small NIT: There's a lot of text in the tooltip. It would be nice if all the possible values were put into a list instead of separated by commas. It would look something like this, which to me would be an improvement.
See: Supported HTML Subset,
@jonatack the list looks great! I think not-bold is better. I think that Write the descriptions like this: instead of: |
@jarolrod test with inbound first and your colon suggestion (agree, it's more readable) |
@jonatack looks awesome 👍 |
20fa975
to
b99fbd6
Compare
b99fbd6
to
8341039
Compare
@hebasto thanks--done. |
- remove RPC and option names from the translatable string - use non-breaking hyphens
per review feedback
8341039
to
06ba9b3
Compare
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.
re-ACK 06ba9b3, the tooltip content is organized as unordered list.
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.
re-ACK 06ba9b3
<widget class="QLabel" name="label_23"> | ||
<widget class="QLabel" name="peerConnectionTypeLabel"> | ||
<property name="toolTip"> | ||
<string>The type of peer connection:<ul><li>Inbound: initiated by peer</li><li>Outbound Full Relay: default</li><li>Outbound Block Relay: does not relay transactions or addresses</li><li>Outbound Manual: added using RPC %1 or %2/%3 configuration options</li><li>Outbound Feeler: short-lived, for testing addresses</li><li>Outbound Address Fetch: short-lived, for soliciting addresses</li></ul></string> |
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.
translation nit: How are translators supposed to translate :<ul><li>
? It might be better to say "Can be one of %s" and then use Join(translated_strings, ", ")
or simply "Refer to the getpeerinfo RPC help for details on the connection types"?
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.
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.
translation nit: How are translators supposed to translate
:<ul><li>
?
There was a discussion in private IRC with @jonatack:
<hebasto>
14:24:52 but I expect the translators' burden :)
14:25:39 hope that translators are aware of escaping :)
I'm not an expert in translation but I believe that :<ul><li>
is not a subject to translate as %1
or %2
.
It might be better to say "Can be one of %s" and then use
Join(translated_strings, ", ")
or simply "Refer to the getpeerinfo RPC help for details on the connection types"?
Either of the suggested variants LGTM.
if we replace the escaped markup with placeholders (as done here for the nonbreaking hyphen), is that still QT Designer-friendly?
I think it is. But, tbh, I'd prefer more succinct @MarcoFalke's suggestions.
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. Helpfulness and readability for users were the reasons for the iterations above and it seems best to not regress on those improvements with referring GUI users to the command line or dropping the readable list layout. I'll propose replacing the escaped markup with placeholders.
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.
Why not a single placeholder for the whole unordered list? We still have a (shorter) tooltip in the form file, and make translators' life easier :)
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.
SGTM too.
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.
Done in #180
79a2576 doc: update ConnectionType Doxygen documentation (Jon Atack) f3153dc gui: improve markup handling of connection type tooltip (Jon Atack) 4f09615 gui: return inbound {full, block} relay type in peer details (Jon Atack) Pull request description: Three follow-ups to #163: - return relay type for inbound peers - improve markup handling in the tooltip to facilitate translations - update ConnectionType doxygen documentation ![Screenshot from 2021-01-11 08-37-44](https://user-images.githubusercontent.com/2415484/104156081-50e69300-53e0-11eb-9b0f-880cb5626d68.png) ACKs for top commit: hebasto: re-ACK 79a2576, only suggested changes since my [previous](#180 (review)) review. jarolrod: ACK 79a2576, tested on macOS 11.1 with Qt 5.15.2 laanwj: Code review ACK 79a2576 Tree-SHA512: 4a8d8f8bfbaefd68e8d1bf3b20d29e4a8e8cfe97b2f8d59d3a4c338a50b61de0a67d97bd8646c04bd5df5a9679c4954b9b46e7cba24bb89f4d0e44e94cf9d66c
Closes #159.