Browse Source

Merge pull request #1263 from Diapolo/RPCCon_ClientStartupTime

GUI: add the client startup time to the debug window...
miguelfreitas
Wladimir J. van der Laan 13 years ago
parent
commit
97ec4e50b1
  1. 6
      src/qt/clientmodel.cpp
  2. 1
      src/qt/clientmodel.h
  3. 126
      src/qt/forms/rpcconsole.ui
  4. 1
      src/qt/rpcconsole.cpp

6
src/qt/clientmodel.cpp

@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
#include "transactiontablemodel.h"
#include "main.h"
static const int64 nClientStartupTime = GetTime();
#include <QDateTime>
@ -98,3 +99,8 @@ QString ClientModel::clientName() const @@ -98,3 +99,8 @@ QString ClientModel::clientName() const
{
return QString::fromStdString(CLIENT_NAME);
}
QDateTime ClientModel::formatClientStartupTime() const
{
return QDateTime::fromTime_t(nClientStartupTime);
}

1
src/qt/clientmodel.h

@ -39,6 +39,7 @@ public: @@ -39,6 +39,7 @@ public:
QString formatFullVersion() const;
QString formatBuildDate() const;
QString clientName() const;
QDateTime formatClientStartupTime() const;
private:
OptionsModel *optionsModel;

126
src/qt/forms/rpcconsole.ui

@ -27,6 +27,19 @@ @@ -27,6 +27,19 @@
<property name="horizontalSpacing">
<number>12</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Client</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
@ -36,6 +49,9 @@ @@ -36,6 +49,9 @@
</item>
<item row="1" column="1">
<widget class="QLabel" name="clientName">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
@ -56,6 +72,9 @@ @@ -56,6 +72,9 @@
</item>
<item row="2" column="1">
<widget class="QLabel" name="clientVersion">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
@ -67,20 +86,53 @@ @@ -67,20 +86,53 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
<item row="3" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Build date</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="buildDate">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>Version</string>
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Startup time</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="startupTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_11">
<property name="font">
<font>
@ -93,15 +145,18 @@ @@ -93,15 +145,18 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Number of connections</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QLabel" name="numberOfConnections">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
@ -113,14 +168,14 @@ @@ -113,14 +168,14 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>On testnet</string>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="7" column="1">
<widget class="QCheckBox" name="isTestNet">
<property name="enabled">
<bool>false</bool>
@ -130,7 +185,7 @@ @@ -130,7 +185,7 @@
</property>
</widget>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_10">
<property name="font">
<font>
@ -143,15 +198,18 @@ @@ -143,15 +198,18 @@
</property>
</widget>
</item>
<item row="8" column="0">
<item row="9" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Current number of blocks</string>
</property>
</widget>
</item>
<item row="8" column="1">
<item row="9" column="1">
<widget class="QLabel" name="numberOfBlocks">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
@ -163,15 +221,18 @@ @@ -163,15 +221,18 @@
</property>
</widget>
</item>
<item row="9" column="0">
<item row="10" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Estimated total blocks</string>
</property>
</widget>
</item>
<item row="9" column="1">
<item row="10" column="1">
<widget class="QLabel" name="totalBlocks">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
@ -183,15 +244,18 @@ @@ -183,15 +244,18 @@
</property>
</widget>
</item>
<item row="10" column="0">
<item row="11" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Last block time</string>
</property>
</widget>
</item>
<item row="10" column="1">
<item row="11" column="1">
<widget class="QLabel" name="lastBlockTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
@ -203,7 +267,7 @@ @@ -203,7 +267,7 @@
</property>
</widget>
</item>
<item row="11" column="0">
<item row="12" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -216,7 +280,7 @@ @@ -216,7 +280,7 @@
</property>
</spacer>
</item>
<item row="12" column="0">
<item row="13" column="0">
<widget class="QLabel" name="labelDebugLogfile">
<property name="font">
<font>
@ -229,7 +293,7 @@ @@ -229,7 +293,7 @@
</property>
</widget>
</item>
<item row="13" column="0">
<item row="14" column="0">
<widget class="QPushButton" name="openDebugLogfileButton">
<property name="toolTip">
<string>Open the Bitcoin debug logfile from the current data directory. This can take a few seconds for large logfiles.</string>
@ -239,7 +303,7 @@ @@ -239,7 +303,7 @@
</property>
</widget>
</item>
<item row="14" column="0">
<item row="15" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
@ -252,20 +316,6 @@ @@ -252,20 +316,6 @@
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Build date</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="buildDate">
<property name="text">
<string>N/A</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_console">
@ -311,7 +361,7 @@ @@ -311,7 +361,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&gt;</string>
<string notr="true">&gt;</string>
</property>
</widget>
</item>

1
src/qt/rpcconsole.cpp

@ -150,6 +150,7 @@ void RPCConsole::setClientModel(ClientModel *model) @@ -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());

Loading…
Cancel
Save