From 4856f1d6712cdb2eac8712e379fd1e351583d78f Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Tue, 22 Mar 2016 08:40:10 +0100 Subject: [PATCH 1/2] [Qt] Debug window: replace "Build date" with "Datadir" The build date does only makes sense for custom/self-compiled bitcoin-core versions because we are using static build-dates for our deterministic release builds. Having a quick option to get the current datadir is much more valuable for debug purposes. --- src/qt/clientmodel.cpp | 5 +++++ src/qt/clientmodel.h | 1 + src/qt/forms/debugwindow.ui | 7 +++++-- src/qt/rpcconsole.cpp | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index d3edfedff..65637cd61 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -193,6 +193,11 @@ QString ClientModel::formatClientStartupTime() const return QDateTime::fromTime_t(nClientStartupTime).toString(); } +QString ClientModel::dataDir() const +{ + return QString::fromStdString(GetDataDir().string()); +} + void ClientModel::updateBanlist() { banTableModel->refresh(); diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 2fef6131c..db010f05c 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -76,6 +76,7 @@ public: bool isReleaseVersion() const; QString clientName() const; QString formatClientStartupTime() const; + QString dataDir() const; private: OptionsModel *optionsModel; diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index a5ac0a7d2..c17efcf1b 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -141,12 +141,12 @@ - Build date + Datadir - + IBeamCursor @@ -156,6 +156,9 @@ Qt::PlainText + + true + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index e8ee3042d..42112c42f 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -444,7 +444,7 @@ void RPCConsole::setClientModel(ClientModel *model) ui->clientVersion->setText(model->formatFullVersion()); ui->clientUserAgent->setText(model->formatSubVersion()); ui->clientName->setText(model->clientName()); - ui->buildDate->setText(model->formatBuildDate()); + ui->dataDir->setText(model->dataDir()); ui->startupTime->setText(model->formatClientStartupTime()); ui->networkName->setText(QString::fromStdString(Params().NetworkIDString())); From fc737d127fb53dbfd31d3d677e157b27f17d5b09 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Thu, 24 Mar 2016 21:48:45 +0100 Subject: [PATCH 2/2] [Qt] remove unused formatBuildDate method --- src/qt/clientmodel.cpp | 5 ----- src/qt/clientmodel.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 65637cd61..697736cc8 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -173,11 +173,6 @@ QString ClientModel::formatSubVersion() const return QString::fromStdString(strSubVersion); } -QString ClientModel::formatBuildDate() const -{ - return QString::fromStdString(CLIENT_DATE); -} - bool ClientModel::isReleaseVersion() const { return CLIENT_VERSION_IS_RELEASE; diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index db010f05c..109f95a2a 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -72,7 +72,6 @@ public: QString formatFullVersion() const; QString formatSubVersion() const; - QString formatBuildDate() const; bool isReleaseVersion() const; QString clientName() const; QString formatClientStartupTime() const;