Skip to content

Commit 97ec4e5

Browse files
committed
Merge pull request #1263 from Diapolo/RPCCon_ClientStartupTime
GUI: add the client startup time to the debug window...
2 parents 591b5c0 + d2f7778 commit 97ec4e5

File tree

4 files changed

+96
-38
lines changed

4 files changed

+96
-38
lines changed

src/qt/clientmodel.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "transactiontablemodel.h"
66

77
#include "main.h"
8+
static const int64 nClientStartupTime = GetTime();
89

910
#include <QDateTime>
1011

@@ -98,3 +99,8 @@ QString ClientModel::clientName() const
9899
{
99100
return QString::fromStdString(CLIENT_NAME);
100101
}
102+
103+
QDateTime ClientModel::formatClientStartupTime() const
104+
{
105+
return QDateTime::fromTime_t(nClientStartupTime);
106+
}

src/qt/clientmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class ClientModel : public QObject
3939
QString formatFullVersion() const;
4040
QString formatBuildDate() const;
4141
QString clientName() const;
42+
QDateTime formatClientStartupTime() const;
4243

4344
private:
4445
OptionsModel *optionsModel;

src/qt/forms/rpcconsole.ui

Lines changed: 88 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@
2727
<property name="horizontalSpacing">
2828
<number>12</number>
2929
</property>
30+
<item row="0" column="0">
31+
<widget class="QLabel" name="label_9">
32+
<property name="font">
33+
<font>
34+
<weight>75</weight>
35+
<bold>true</bold>
36+
</font>
37+
</property>
38+
<property name="text">
39+
<string>Client</string>
40+
</property>
41+
</widget>
42+
</item>
3043
<item row="1" column="0">
3144
<widget class="QLabel" name="label_5">
3245
<property name="text">
@@ -36,6 +49,9 @@
3649
</item>
3750
<item row="1" column="1">
3851
<widget class="QLabel" name="clientName">
52+
<property name="cursor">
53+
<cursorShape>IBeamCursor</cursorShape>
54+
</property>
3955
<property name="text">
4056
<string>N/A</string>
4157
</property>
@@ -56,6 +72,9 @@
5672
</item>
5773
<item row="2" column="1">
5874
<widget class="QLabel" name="clientVersion">
75+
<property name="cursor">
76+
<cursorShape>IBeamCursor</cursorShape>
77+
</property>
5978
<property name="text">
6079
<string>N/A</string>
6180
</property>
@@ -67,20 +86,53 @@
6786
</property>
6887
</widget>
6988
</item>
70-
<item row="0" column="0">
71-
<widget class="QLabel" name="label_9">
72-
<property name="font">
73-
<font>
74-
<weight>75</weight>
75-
<bold>true</bold>
76-
</font>
89+
<item row="3" column="0">
90+
<widget class="QLabel" name="label_12">
91+
<property name="text">
92+
<string>Build date</string>
93+
</property>
94+
</widget>
95+
</item>
96+
<item row="3" column="1">
97+
<widget class="QLabel" name="buildDate">
98+
<property name="cursor">
99+
<cursorShape>IBeamCursor</cursorShape>
77100
</property>
78101
<property name="text">
79-
<string>Version</string>
102+
<string>N/A</string>
103+
</property>
104+
<property name="textFormat">
105+
<enum>Qt::PlainText</enum>
106+
</property>
107+
<property name="textInteractionFlags">
108+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
80109
</property>
81110
</widget>
82111
</item>
83112
<item row="4" column="0">
113+
<widget class="QLabel" name="label_13">
114+
<property name="text">
115+
<string>Startup time</string>
116+
</property>
117+
</widget>
118+
</item>
119+
<item row="4" column="1">
120+
<widget class="QLabel" name="startupTime">
121+
<property name="cursor">
122+
<cursorShape>IBeamCursor</cursorShape>
123+
</property>
124+
<property name="text">
125+
<string>N/A</string>
126+
</property>
127+
<property name="textFormat">
128+
<enum>Qt::PlainText</enum>
129+
</property>
130+
<property name="textInteractionFlags">
131+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
132+
</property>
133+
</widget>
134+
</item>
135+
<item row="5" column="0">
84136
<widget class="QLabel" name="label_11">
85137
<property name="font">
86138
<font>
@@ -93,15 +145,18 @@
93145
</property>
94146
</widget>
95147
</item>
96-
<item row="5" column="0">
148+
<item row="6" column="0">
97149
<widget class="QLabel" name="label_7">
98150
<property name="text">
99151
<string>Number of connections</string>
100152
</property>
101153
</widget>
102154
</item>
103-
<item row="5" column="1">
155+
<item row="6" column="1">
104156
<widget class="QLabel" name="numberOfConnections">
157+
<property name="cursor">
158+
<cursorShape>IBeamCursor</cursorShape>
159+
</property>
105160
<property name="text">
106161
<string>N/A</string>
107162
</property>
@@ -113,14 +168,14 @@
113168
</property>
114169
</widget>
115170
</item>
116-
<item row="6" column="0">
171+
<item row="7" column="0">
117172
<widget class="QLabel" name="label_8">
118173
<property name="text">
119174
<string>On testnet</string>
120175
</property>
121176
</widget>
122177
</item>
123-
<item row="6" column="1">
178+
<item row="7" column="1">
124179
<widget class="QCheckBox" name="isTestNet">
125180
<property name="enabled">
126181
<bool>false</bool>
@@ -130,7 +185,7 @@
130185
</property>
131186
</widget>
132187
</item>
133-
<item row="7" column="0">
188+
<item row="8" column="0">
134189
<widget class="QLabel" name="label_10">
135190
<property name="font">
136191
<font>
@@ -143,15 +198,18 @@
143198
</property>
144199
</widget>
145200
</item>
146-
<item row="8" column="0">
201+
<item row="9" column="0">
147202
<widget class="QLabel" name="label_3">
148203
<property name="text">
149204
<string>Current number of blocks</string>
150205
</property>
151206
</widget>
152207
</item>
153-
<item row="8" column="1">
208+
<item row="9" column="1">
154209
<widget class="QLabel" name="numberOfBlocks">
210+
<property name="cursor">
211+
<cursorShape>IBeamCursor</cursorShape>
212+
</property>
155213
<property name="text">
156214
<string>N/A</string>
157215
</property>
@@ -163,15 +221,18 @@
163221
</property>
164222
</widget>
165223
</item>
166-
<item row="9" column="0">
224+
<item row="10" column="0">
167225
<widget class="QLabel" name="label_4">
168226
<property name="text">
169227
<string>Estimated total blocks</string>
170228
</property>
171229
</widget>
172230
</item>
173-
<item row="9" column="1">
231+
<item row="10" column="1">
174232
<widget class="QLabel" name="totalBlocks">
233+
<property name="cursor">
234+
<cursorShape>IBeamCursor</cursorShape>
235+
</property>
175236
<property name="text">
176237
<string>N/A</string>
177238
</property>
@@ -183,15 +244,18 @@
183244
</property>
184245
</widget>
185246
</item>
186-
<item row="10" column="0">
247+
<item row="11" column="0">
187248
<widget class="QLabel" name="label_2">
188249
<property name="text">
189250
<string>Last block time</string>
190251
</property>
191252
</widget>
192253
</item>
193-
<item row="10" column="1">
254+
<item row="11" column="1">
194255
<widget class="QLabel" name="lastBlockTime">
256+
<property name="cursor">
257+
<cursorShape>IBeamCursor</cursorShape>
258+
</property>
195259
<property name="text">
196260
<string>N/A</string>
197261
</property>
@@ -203,7 +267,7 @@
203267
</property>
204268
</widget>
205269
</item>
206-
<item row="11" column="0">
270+
<item row="12" column="0">
207271
<spacer name="verticalSpacer_2">
208272
<property name="orientation">
209273
<enum>Qt::Vertical</enum>
@@ -216,7 +280,7 @@
216280
</property>
217281
</spacer>
218282
</item>
219-
<item row="12" column="0">
283+
<item row="13" column="0">
220284
<widget class="QLabel" name="labelDebugLogfile">
221285
<property name="font">
222286
<font>
@@ -229,7 +293,7 @@
229293
</property>
230294
</widget>
231295
</item>
232-
<item row="13" column="0">
296+
<item row="14" column="0">
233297
<widget class="QPushButton" name="openDebugLogfileButton">
234298
<property name="toolTip">
235299
<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 @@
239303
</property>
240304
</widget>
241305
</item>
242-
<item row="14" column="0">
306+
<item row="15" column="0">
243307
<spacer name="verticalSpacer">
244308
<property name="orientation">
245309
<enum>Qt::Vertical</enum>
@@ -252,20 +316,6 @@
252316
</property>
253317
</spacer>
254318
</item>
255-
<item row="3" column="0">
256-
<widget class="QLabel" name="label_12">
257-
<property name="text">
258-
<string>Build date</string>
259-
</property>
260-
</widget>
261-
</item>
262-
<item row="3" column="1">
263-
<widget class="QLabel" name="buildDate">
264-
<property name="text">
265-
<string>N/A</string>
266-
</property>
267-
</widget>
268-
</item>
269319
</layout>
270320
</widget>
271321
<widget class="QWidget" name="tab_console">
@@ -311,7 +361,7 @@
311361
<item>
312362
<widget class="QLabel" name="label">
313363
<property name="text">
314-
<string>&gt;</string>
364+
<string notr="true">&gt;</string>
315365
</property>
316366
</widget>
317367
</item>

src/qt/rpcconsole.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ void RPCConsole::setClientModel(ClientModel *model)
150150
ui->clientVersion->setText(model->formatFullVersion());
151151
ui->clientName->setText(model->clientName());
152152
ui->buildDate->setText(model->formatBuildDate());
153+
ui->startupTime->setText(model->formatClientStartupTime().toString());
153154

154155
setNumConnections(model->getNumConnections());
155156
ui->isTestNet->setChecked(model->isTestNet());

0 commit comments

Comments
 (0)