From 3045704502e8a241b60b847fd52fcbed3129a2e4 Mon Sep 17 00:00:00 2001
From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Date: Tue, 2 Oct 2018 23:12:17 +0300
Subject: [PATCH 1/2] Add "Blocksdir" to Debug window
To get the current blocksdir is valuable for debug purposes after
merging #12653.
---
src/qt/clientmodel.cpp | 5 +++
src/qt/clientmodel.h | 1 +
src/qt/forms/debugwindow.ui | 62 ++++++++++++++++++++++++++-----------
src/qt/rpcconsole.cpp | 1 +
4 files changed, 51 insertions(+), 18 deletions(-)
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index b2cf4b639..183444efa 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -177,6 +177,11 @@ QString ClientModel::dataDir() const
return GUIUtil::boostPathToQString(GetDataDir());
}
+QString ClientModel::blocksDir() const
+{
+ return GUIUtil::boostPathToQString(GetBlocksDir());
+}
+
void ClientModel::updateBanlist()
{
banTableModel->refresh();
diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h
index ed7ecbf73..79e7074cc 100644
--- a/src/qt/clientmodel.h
+++ b/src/qt/clientmodel.h
@@ -69,6 +69,7 @@ public:
bool isReleaseVersion() const;
QString formatClientStartupTime() const;
QString dataDir() const;
+ QString blocksDir() const;
bool getProxyInfo(std::string& ip_port) const;
diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui
index 695ed6122..322a84ee9 100644
--- a/src/qt/forms/debugwindow.ui
+++ b/src/qt/forms/debugwindow.ui
@@ -142,13 +142,39 @@
-
+
+
+ Blocksdir
+
+
+
+ -
+
+
+ IBeamCursor
+
+
+ N/A
+
+
+ Qt::PlainText
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse
+
+
+
+ -
Startup time
- -
+
-
IBeamCursor
@@ -164,7 +190,7 @@
- -
+
-
@@ -177,14 +203,14 @@
- -
+
-
Name
- -
+
-
IBeamCursor
@@ -200,14 +226,14 @@
- -
+
-
Number of connections
- -
+
-
IBeamCursor
@@ -223,7 +249,7 @@
- -
+
-
@@ -236,14 +262,14 @@
- -
+
-
Current number of blocks
- -
+
-
IBeamCursor
@@ -259,14 +285,14 @@
- -
+
-
Last block time
- -
+
-
IBeamCursor
@@ -282,7 +308,7 @@
- -
+
-
@@ -295,14 +321,14 @@
- -
+
-
Current number of transactions
- -
+
-
IBeamCursor
@@ -318,14 +344,14 @@
- -
+
-
Memory usage
- -
+
-
IBeamCursor
@@ -341,7 +367,7 @@
- -
+
-
3
@@ -381,7 +407,7 @@
- -
+
-
Qt::Vertical
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 3857befdf..5bf989314 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -661,6 +661,7 @@ void RPCConsole::setClientModel(ClientModel *model)
ui->clientVersion->setText(model->formatFullVersion());
ui->clientUserAgent->setText(model->formatSubVersion());
ui->dataDir->setText(model->dataDir());
+ ui->blocksDir->setText(model->blocksDir());
ui->startupTime->setText(model->formatClientStartupTime());
ui->networkName->setText(QString::fromStdString(Params().NetworkIDString()));
From 2ab9140c92c7ffd950f9ea6e1e78107a217bb336 Mon Sep 17 00:00:00 2001
From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
Date: Sat, 6 Oct 2018 00:05:51 +0300
Subject: [PATCH 2/2] Add tooltips for both datadir and blocksdir
---
src/qt/forms/debugwindow.ui | 6 ++++++
src/qt/rpcconsole.cpp | 3 +++
2 files changed, 9 insertions(+)
diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui
index 322a84ee9..dca16d6f7 100644
--- a/src/qt/forms/debugwindow.ui
+++ b/src/qt/forms/debugwindow.ui
@@ -127,6 +127,9 @@
IBeamCursor
+
+ To specify a non-default location of the data directory use the '%1' option.
+
N/A
@@ -153,6 +156,9 @@
IBeamCursor
+
+ To specify a non-default location of the blocks directory use the '%1' option.
+
N/A
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp
index 5bf989314..7ec4feabf 100644
--- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -459,6 +459,9 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center());
}
+ QChar nonbreaking_hyphen(8209);
+ ui->dataDir->setToolTip(ui->dataDir->toolTip().arg(QString(nonbreaking_hyphen) + "datadir"));
+ ui->blocksDir->setToolTip(ui->blocksDir->toolTip().arg(QString(nonbreaking_hyphen) + "blocksdir"));
ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME)));
if (platformStyle->getImagesOnButtons()) {