Skip to content

Commit

Permalink
Merge bitcoin#14374: qt: Add "Blocksdir" to Debug window
Browse files Browse the repository at this point in the history
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 bitcoin#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
  • Loading branch information
laanwj authored and Munkybooty committed Jul 22, 2021
1 parent 6862fe4 commit 29c0104
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 35 deletions.
5 changes: 5 additions & 0 deletions src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ QString ClientModel::dataDir() const
return GUIUtil::boostPathToQString(GetDataDir());
}

QString ClientModel::blocksDir() const
{
return GUIUtil::boostPathToQString(GetBlocksDir());
}

void ClientModel::updateBanlist()
{
banTableModel->refresh();
Expand Down
1 change: 1 addition & 0 deletions src/qt/clientmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class ClientModel : public QObject
bool isReleaseVersion() const;
QString formatClientStartupTime() const;
QString dataDir() const;
QString blocksDir() const;

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

Expand Down
102 changes: 67 additions & 35 deletions src/qt/forms/debugwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="toolTip">
<string>To specify a non-default location of the data directory use the '%1' option.</string>
</property>
<property name="text">
<string>N/A</string>
</property>
Expand All @@ -199,13 +202,42 @@
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Blocksdir</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<widget class="QLabel" name="blocksDir">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="toolTip">
<string>To specify a non-default location of the blocks directory use the '%1' option.</string>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Startup time</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<item row="6" column="1" colspan="2">
<widget class="QLabel" name="startupTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -221,21 +253,21 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QLabel" name="labelNetwork">
<property name="text">
<string>Network</string>
</property>
</widget>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="7" column="1" colspan="2">
<item row="8" column="1" colspan="2">
<widget class="QLabel" name="networkName">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -251,14 +283,14 @@
</property>
</widget>
</item>
<item row="8" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Number of connections</string>
</property>
</widget>
</item>
<item row="8" column="1" colspan="2">
<item row="9" column="1" colspan="2">
<widget class="QLabel" name="numberOfConnections">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -274,14 +306,14 @@
</property>
</widget>
</item>
<item row="9" column="0">
<item row="10" column="0">
<widget class="QLabel" name="masternodeCountLabel">
<property name="text">
<string>Number of Masternodes</string>
</property>
</widget>
</item>
<item row="9" column="1">
<item row="10" column="1">
<widget class="QLabel" name="masternodeCount">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -297,21 +329,21 @@
</property>
</widget>
</item>
<item row="10" column="0">
<item row="11" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Block chain</string>
</property>
</widget>
</item>
<item row="11" column="0">
<item row="12" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Current block height</string>
</property>
</widget>
</item>
<item row="11" column="1" colspan="2">
<item row="12" column="1" colspan="2">
<widget class="QLabel" name="numberOfBlocks">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -327,14 +359,14 @@
</property>
</widget>
</item>
<item row="12" column="0">
<item row="13" column="0">
<widget class="QLabel" name="labelLastBlockTime">
<property name="text">
<string>Last block time</string>
</property>
</widget>
</item>
<item row="12" column="1" colspan="2">
<item row="13" column="1" colspan="2">
<widget class="QLabel" name="lastBlockTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -350,14 +382,14 @@
</property>
</widget>
</item>
<item row="13" column="0">
<item row="14" column="0">
<widget class="QLabel" name="lastBlockHashLabel">
<property name="text">
<string>Last block hash</string>
</property>
</widget>
</item>
<item row="13" column="1">
<item row="14" column="1">
<widget class="QLabel" name="lastBlockHash">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -373,21 +405,21 @@
</property>
</widget>
</item>
<item row="14" column="0">
<item row="15" column="0">
<widget class="QLabel" name="labelMempoolTitle">
<property name="text">
<string>Memory Pool</string>
</property>
</widget>
</item>
<item row="15" column="0">
<item row="16" column="0">
<widget class="QLabel" name="labelNumberOfTransactions">
<property name="text">
<string>Current number of transactions</string>
</property>
</widget>
</item>
<item row="15" column="1">
<item row="16" column="1">
<widget class="QLabel" name="mempoolNumberTxs">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -403,14 +435,14 @@
</property>
</widget>
</item>
<item row="16" column="0">
<item row="17" column="0">
<widget class="QLabel" name="labelMemoryUsage">
<property name="text">
<string>Memory usage</string>
</property>
</widget>
</item>
<item row="16" column="1">
<item row="17" column="1">
<widget class="QLabel" name="mempoolSize">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -426,7 +458,7 @@
</property>
</widget>
</item>
<item row="13" column="2" rowspan="3">
<item row="16" column="2" rowspan="3">
<layout class="QVBoxLayout" name="verticalLayoutDebugButton">
<property name="spacing">
<number>3</number>
Expand Down Expand Up @@ -467,26 +499,13 @@
</layout>
</item>
<item row="18" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="17" column="0">
<widget class="QLabel" name="labelInstantSendLockCount">
<property name="text">
<string>InstantSend locks</string>
</property>
</widget>
</item>
<item row="17" column="1">
<item row="18" column="1">
<widget class="QLabel" name="instantSendLockCount">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
Expand All @@ -502,6 +521,19 @@
</property>
</widget>
</item>
<item row="19" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="pageConsole">
Expand Down
4 changes: 4 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ RPCConsole::RPCConsole(interfaces::Node& node, QWidget* parent, Qt::WindowFlags
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)));

setButtonIcons();
Expand Down Expand Up @@ -700,6 +703,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()));

Expand Down

0 comments on commit 29c0104

Please sign in to comment.