From d2f7778cc7a2258b55f779584c9ca47c8c4b12b9 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Sat, 12 May 2012 00:28:58 +0200 Subject: [PATCH] add the client startup time to the debug window / rename Version label to Client, which is better suiting now / add IBeamCursor for selectable text on the information page / make ">" sign on RPC page untranslatable / re-order XML-file tags to match real GUI element order --- src/qt/clientmodel.cpp | 6 ++ src/qt/clientmodel.h | 1 + src/qt/forms/rpcconsole.ui | 126 ++++++++++++++++++++++++++----------- src/qt/rpcconsole.cpp | 1 + 4 files changed, 96 insertions(+), 38 deletions(-) diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index d7172fd9..85ab0361 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -5,6 +5,7 @@ #include "transactiontablemodel.h" #include "main.h" +static const int64 nClientStartupTime = GetTime(); #include @@ -98,3 +99,8 @@ QString ClientModel::clientName() const { return QString::fromStdString(CLIENT_NAME); } + +QDateTime ClientModel::formatClientStartupTime() const +{ + return QDateTime::fromTime_t(nClientStartupTime); +} diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 74e0c068..67835db7 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -39,6 +39,7 @@ public: QString formatFullVersion() const; QString formatBuildDate() const; QString clientName() const; + QDateTime formatClientStartupTime() const; private: OptionsModel *optionsModel; diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index 02164f76..e8f01ff2 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -27,6 +27,19 @@ 12 + + + + + 75 + true + + + + Client + + + @@ -36,6 +49,9 @@ + + IBeamCursor + N/A @@ -56,6 +72,9 @@ + + IBeamCursor + N/A @@ -67,20 +86,53 @@ - - - - - 75 - true - + + + + Build date + + + + + + + IBeamCursor - Version + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + Startup time + + + + + + + IBeamCursor + + + N/A + + + Qt::PlainText + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + @@ -93,15 +145,18 @@ - + Number of connections - + + + IBeamCursor + N/A @@ -113,14 +168,14 @@ - + On testnet - + false @@ -130,7 +185,7 @@ - + @@ -143,15 +198,18 @@ - + Current number of blocks - + + + IBeamCursor + N/A @@ -163,15 +221,18 @@ - + Estimated total blocks - + + + IBeamCursor + N/A @@ -183,15 +244,18 @@ - + Last block time - + + + IBeamCursor + N/A @@ -203,7 +267,7 @@ - + Qt::Vertical @@ -216,7 +280,7 @@ - + @@ -229,7 +293,7 @@ - + Open the Bitcoin debug logfile from the current data directory. This can take a few seconds for large logfiles. @@ -239,7 +303,7 @@ - + Qt::Vertical @@ -252,20 +316,6 @@ - - - - Build date - - - - - - - N/A - - - @@ -311,7 +361,7 @@ - > + > diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 9254fe4c..5a035888 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -150,6 +150,7 @@ void RPCConsole::setClientModel(ClientModel *model) ui->clientVersion->setText(model->formatFullVersion()); ui->clientName->setText(model->clientName()); ui->buildDate->setText(model->formatBuildDate()); + ui->startupTime->setText(model->formatClientStartupTime().toString()); setNumConnections(model->getNumConnections()); ui->isTestNet->setChecked(model->isTestNet());