To get the current blocksdir is valuable for debug purposes after
merging #12653.

utACK 16d79b064c095accc8a3c1decdf54cdd03554564 (see issue below)
Concept ACK
| Coverage | Change (pull 14374) | Reference (master) |
|---|---|---|
| Lines | +0.0331 % | 87.0471 % |
| Functions | +0.1853 % | 84.1130 % |
| Branches | +0.0171 % | 51.5403 % |
176@@ -177,6 +177,11 @@ QString ClientModel::dataDir() const
177 return GUIUtil::boostPathToQString(GetDataDir());
178 }
179
180+QString ClientModel::blocksDir() const
181+{
182+ return GUIUtil::boostPathToQString(GetBlocksDir());
interfaces::Node method would be better, but for now calling GetBlocksDir() directly is more consistent with existing code. The goal of adding the Node and Wallet interfaces in #10244 was to get rid of accesses to non-GUI global variables from GUI code. But to make the change more minimal, I exempted gArgs and chainparams variables, and instead added some glue code in #10102 to let each process just keep its own copies of these variables. As a result, it’s fine to call functions like GetBlocksDir and GetDataDir from GUI code that access them.
@Sjors @promag Thank you for your reviews.
Should not call
GetBlockDirbut get it frominterfaces::Node?
Agree we need to clarify if
GetBlockDirshould be avoided in favor of adding a method tointerfaces::Node.
Besides GetBlocksDir the ClientModel calls GetDataDir, GetStartupTime and GetTimeMillis as well. All are the thread-safe utilities not from the node code. IMO, using the GetBlocksDir is a safe way.
Nevertheless, I agree with all of you: @ryanofsky’s review will be much appreciated.
To get the current blocksdir is valuable for debug purposes after
merging #12653.
a tooltip that explains this location can be customized using -blocksdir
Done:

126@@ -127,6 +127,9 @@
127 <property name="cursor">
128 <cursorShape>IBeamCursor</cursorShape>
129 </property>
130+ <property name="toolTip">
131+ <string><html><head/><body><p>To specify a non-default location of the data directory use the '&#8209;datadir' option.</p></body></html></string>
<html><head/><body><p>? This probably makes the tooltip hard to translate.
‑ for the non-breaking hyphen character. Otherwise, the tooltip can looks ugly.
This LOC has been generated by Qt Creator and, therefore, the translation should be treated in a correct way. Or did I miss something?
‑? Presumably then you wouldn’t need the html stuff.
This probably makes the tooltip hard to translate.
You are right. I’ve missed this warning Avoid HTML in translation strings @ryanofsky Thank you for your review.
Tooltips are fixed. Please re-review.
utACK 2ab9140c92c7ffd950f9ea6e1e78107a217bb336 but I think it would be better if you just literally wrote the nonbreaking hyphen in the XML as a utf8-encoded character (as suggested previously):
0- <string>To specify a non-default location of the data directory use the '%1' option.</string>
1+ <string>To specify a non-default location of the data directory use the '‑datadir' option.</string>
2- <string>To specify a non-default location of the blocks directory use the '%1' option.</string>
3+ <string>To specify a non-default location of the blocks directory use the '‑blocksdir' option.</string>
Actually I like the %1 approach better. It prevents translators from accidentally breaking the - or worse, translating the actual command.
utACK 2ab9140