1 // Copyright (c) 2011-2014 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_QT_RPCCONSOLE_H
6 #define BITCOIN_QT_RPCCONSOLE_H
9 #include "peertablemodel.h"
25 /** Local Bitcoin RPC console. */
26 class RPCConsole: public QWidget
31 explicit RPCConsole(QWidget *parent);
34 void setClientModel(ClientModel *model);
45 virtual bool eventFilter(QObject* obj, QEvent *event);
46 void keyPressEvent(QKeyEvent *);
49 void on_lineEdit_returnPressed();
50 void on_tabWidget_currentChanged(int index);
51 /** open the debug.log from the current datadir */
52 void on_openDebugLogfileButton_clicked();
53 /** change the time range of the network traffic graph */
54 void on_sldGraphRange_valueChanged(int value);
55 /** update traffic statistics */
56 void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut);
57 void resizeEvent(QResizeEvent *event);
58 void showEvent(QShowEvent *event);
59 void hideEvent(QHideEvent *event);
63 void message(int category, const QString &message, bool html = false);
64 /** Set number of connections shown in the UI */
65 void setNumConnections(int count);
66 /** Set number of blocks and last block date shown in the UI */
67 void setNumBlocks(int count, const QDateTime& blockDate);
68 /** Go forward or back in history */
69 void browseHistory(int offset);
70 /** Scroll console view to end */
72 /** Handle selection of peer in peers list */
73 void peerSelected(const QItemSelection &selected, const QItemSelection &deselected);
74 /** Handle updated peer information */
75 void peerLayoutChanged();
78 // For RPC command executor
80 void cmdRequest(const QString &command);
83 static QString FormatBytes(quint64 bytes);
85 void setTrafficGraphRange(int mins);
86 /** show detailed information on ui about selected node */
87 void updateNodeDetail(const CNodeCombinedStats *stats);
91 ADDRESS_COLUMN_WIDTH = 200,
92 SUBVERSION_COLUMN_WIDTH = 100,
93 PING_COLUMN_WIDTH = 80
97 ClientModel *clientModel;
103 #endif // BITCOIN_QT_RPCCONSOLE_H