Skip to content

Commit fe23553

Browse files
committed
Merge #14374: qt: Add "Blocksdir" to Debug window
2ab9140 Add tooltips for both datadir and blocksdir (Hennadii Stepanov) 3045704 Add "Blocksdir" to Debug window (Hennadii Stepanov) Pull request description: To get the current `blocksdir` is valuable for debug purposes after merging #12653. ![screenshot from 2018-10-02 23-16-52](https://user-images.githubusercontent.com/32963518/46374770-2ef6f580-c69a-11e8-85c2-44a49fa36b28.png) Tree-SHA512: a93f2c00ee19cf6acb499d3bd9bccf4be8ef01c53c44d917ad401aa4797db02cbccb71a9c24e05262ea09345e15f9299381367fdc6951f21dd3788a4a58d2132
2 parents 32c5f18 + 2ab9140 commit fe23553

File tree

4 files changed

+60
-18
lines changed

4 files changed

+60
-18
lines changed

src/qt/clientmodel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ QString ClientModel::dataDir() const
177177
return GUIUtil::boostPathToQString(GetDataDir());
178178
}
179179

180+
QString ClientModel::blocksDir() const
181+
{
182+
return GUIUtil::boostPathToQString(GetBlocksDir());
183+
}
184+
180185
void ClientModel::updateBanlist()
181186
{
182187
banTableModel->refresh();

src/qt/clientmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class ClientModel : public QObject
6969
bool isReleaseVersion() const;
7070
QString formatClientStartupTime() const;
7171
QString dataDir() const;
72+
QString blocksDir() const;
7273

7374
bool getProxyInfo(std::string& ip_port) const;
7475

src/qt/forms/debugwindow.ui

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@
127127
<property name="cursor">
128128
<cursorShape>IBeamCursor</cursorShape>
129129
</property>
130+
<property name="toolTip">
131+
<string>To specify a non-default location of the data directory use the '%1' option.</string>
132+
</property>
130133
<property name="text">
131134
<string>N/A</string>
132135
</property>
@@ -142,13 +145,42 @@
142145
</widget>
143146
</item>
144147
<item row="5" column="0">
148+
<widget class="QLabel" name="label_11">
149+
<property name="text">
150+
<string>Blocksdir</string>
151+
</property>
152+
</widget>
153+
</item>
154+
<item row="5" column="1" colspan="2">
155+
<widget class="QLabel" name="blocksDir">
156+
<property name="cursor">
157+
<cursorShape>IBeamCursor</cursorShape>
158+
</property>
159+
<property name="toolTip">
160+
<string>To specify a non-default location of the blocks directory use the '%1' option.</string>
161+
</property>
162+
<property name="text">
163+
<string>N/A</string>
164+
</property>
165+
<property name="textFormat">
166+
<enum>Qt::PlainText</enum>
167+
</property>
168+
<property name="wordWrap">
169+
<bool>true</bool>
170+
</property>
171+
<property name="textInteractionFlags">
172+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
173+
</property>
174+
</widget>
175+
</item>
176+
<item row="6" column="0">
145177
<widget class="QLabel" name="label_13">
146178
<property name="text">
147179
<string>Startup time</string>
148180
</property>
149181
</widget>
150182
</item>
151-
<item row="5" column="1" colspan="2">
183+
<item row="6" column="1" colspan="2">
152184
<widget class="QLabel" name="startupTime">
153185
<property name="cursor">
154186
<cursorShape>IBeamCursor</cursorShape>
@@ -164,7 +196,7 @@
164196
</property>
165197
</widget>
166198
</item>
167-
<item row="6" column="0">
199+
<item row="7" column="0">
168200
<widget class="QLabel" name="labelNetwork">
169201
<property name="font">
170202
<font>
@@ -177,14 +209,14 @@
177209
</property>
178210
</widget>
179211
</item>
180-
<item row="7" column="0">
212+
<item row="8" column="0">
181213
<widget class="QLabel" name="label_8">
182214
<property name="text">
183215
<string>Name</string>
184216
</property>
185217
</widget>
186218
</item>
187-
<item row="7" column="1" colspan="2">
219+
<item row="8" column="1" colspan="2">
188220
<widget class="QLabel" name="networkName">
189221
<property name="cursor">
190222
<cursorShape>IBeamCursor</cursorShape>
@@ -200,14 +232,14 @@
200232
</property>
201233
</widget>
202234
</item>
203-
<item row="8" column="0">
235+
<item row="9" column="0">
204236
<widget class="QLabel" name="label_7">
205237
<property name="text">
206238
<string>Number of connections</string>
207239
</property>
208240
</widget>
209241
</item>
210-
<item row="8" column="1" colspan="2">
242+
<item row="9" column="1" colspan="2">
211243
<widget class="QLabel" name="numberOfConnections">
212244
<property name="cursor">
213245
<cursorShape>IBeamCursor</cursorShape>
@@ -223,7 +255,7 @@
223255
</property>
224256
</widget>
225257
</item>
226-
<item row="9" column="0">
258+
<item row="10" column="0">
227259
<widget class="QLabel" name="label_10">
228260
<property name="font">
229261
<font>
@@ -236,14 +268,14 @@
236268
</property>
237269
</widget>
238270
</item>
239-
<item row="10" column="0">
271+
<item row="11" column="0">
240272
<widget class="QLabel" name="label_3">
241273
<property name="text">
242274
<string>Current number of blocks</string>
243275
</property>
244276
</widget>
245277
</item>
246-
<item row="10" column="1" colspan="2">
278+
<item row="11" column="1" colspan="2">
247279
<widget class="QLabel" name="numberOfBlocks">
248280
<property name="cursor">
249281
<cursorShape>IBeamCursor</cursorShape>
@@ -259,14 +291,14 @@
259291
</property>
260292
</widget>
261293
</item>
262-
<item row="11" column="0">
294+
<item row="12" column="0">
263295
<widget class="QLabel" name="labelLastBlockTime">
264296
<property name="text">
265297
<string>Last block time</string>
266298
</property>
267299
</widget>
268300
</item>
269-
<item row="11" column="1" colspan="2">
301+
<item row="12" column="1" colspan="2">
270302
<widget class="QLabel" name="lastBlockTime">
271303
<property name="cursor">
272304
<cursorShape>IBeamCursor</cursorShape>
@@ -282,7 +314,7 @@
282314
</property>
283315
</widget>
284316
</item>
285-
<item row="12" column="0">
317+
<item row="13" column="0">
286318
<widget class="QLabel" name="labelMempoolTitle">
287319
<property name="font">
288320
<font>
@@ -295,14 +327,14 @@
295327
</property>
296328
</widget>
297329
</item>
298-
<item row="13" column="0">
330+
<item row="14" column="0">
299331
<widget class="QLabel" name="labelNumberOfTransactions">
300332
<property name="text">
301333
<string>Current number of transactions</string>
302334
</property>
303335
</widget>
304336
</item>
305-
<item row="13" column="1">
337+
<item row="14" column="1">
306338
<widget class="QLabel" name="mempoolNumberTxs">
307339
<property name="cursor">
308340
<cursorShape>IBeamCursor</cursorShape>
@@ -318,14 +350,14 @@
318350
</property>
319351
</widget>
320352
</item>
321-
<item row="14" column="0">
353+
<item row="15" column="0">
322354
<widget class="QLabel" name="labelMemoryUsage">
323355
<property name="text">
324356
<string>Memory usage</string>
325357
</property>
326358
</widget>
327359
</item>
328-
<item row="14" column="1">
360+
<item row="15" column="1">
329361
<widget class="QLabel" name="mempoolSize">
330362
<property name="cursor">
331363
<cursorShape>IBeamCursor</cursorShape>
@@ -341,7 +373,7 @@
341373
</property>
342374
</widget>
343375
</item>
344-
<item row="12" column="2" rowspan="3">
376+
<item row="13" column="2" rowspan="3">
345377
<layout class="QVBoxLayout" name="verticalLayoutDebugButton">
346378
<property name="spacing">
347379
<number>3</number>
@@ -381,7 +413,7 @@
381413
</item>
382414
</layout>
383415
</item>
384-
<item row="15" column="0">
416+
<item row="16" column="0">
385417
<spacer name="verticalSpacer">
386418
<property name="orientation">
387419
<enum>Qt::Vertical</enum>

src/qt/rpcconsole.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
459459
move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center());
460460
}
461461

462+
QChar nonbreaking_hyphen(8209);
463+
ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
464+
ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
462465
ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME)));
463466

464467
if (platformStyle->getImagesOnButtons()) {
@@ -662,6 +665,7 @@ void RPCConsole::setClientModel(ClientModel *model)
662665
ui->clientVersion->setText(model->formatFullVersion());
663666
ui->clientUserAgent->setText(model->formatSubVersion());
664667
ui->dataDir->setText(model->dataDir());
668+
ui->blocksDir->setText(model->blocksDir());
665669
ui->startupTime->setText(model->formatClientStartupTime());
666670
ui->networkName->setText(QString::fromStdString(Params().NetworkIDString()));
667671

0 commit comments

Comments
 (0)