]> Git Repo - VerusCoin.git/blob - src/qt/rpcconsole.h
Update libsecp256k1.
[VerusCoin.git] / src / qt / rpcconsole.h
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.
4
5 #ifndef BITCOIN_QT_RPCCONSOLE_H
6 #define BITCOIN_QT_RPCCONSOLE_H
7
8 #include "guiutil.h"
9 #include "peertablemodel.h"
10
11 #include "net.h"
12
13 #include <QWidget>
14
15 class ClientModel;
16
17 namespace Ui {
18     class RPCConsole;
19 }
20
21 QT_BEGIN_NAMESPACE
22 class QItemSelection;
23 QT_END_NAMESPACE
24
25 /** Local Bitcoin RPC console. */
26 class RPCConsole: public QWidget
27 {
28     Q_OBJECT
29
30 public:
31     explicit RPCConsole(QWidget *parent);
32     ~RPCConsole();
33
34     void setClientModel(ClientModel *model);
35
36     enum MessageClass {
37         MC_ERROR,
38         MC_DEBUG,
39         CMD_REQUEST,
40         CMD_REPLY,
41         CMD_ERROR
42     };
43
44 protected:
45     virtual bool eventFilter(QObject* obj, QEvent *event);
46     void keyPressEvent(QKeyEvent *);
47
48 private slots:
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);
60
61 public slots:
62     void clear();
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 */
71     void scrollToEnd();
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();
76
77 signals:
78     // For RPC command executor
79     void stopExecutor();
80     void cmdRequest(const QString &command);
81
82 private:
83     static QString FormatBytes(quint64 bytes);
84     void startExecutor();
85     void setTrafficGraphRange(int mins);
86     /** show detailed information on ui about selected node */
87     void updateNodeDetail(const CNodeCombinedStats *stats);
88
89     enum ColumnWidths
90     {
91         ADDRESS_COLUMN_WIDTH = 200,
92         SUBVERSION_COLUMN_WIDTH = 100,
93         PING_COLUMN_WIDTH = 80
94     };
95
96     Ui::RPCConsole *ui;
97     ClientModel *clientModel;
98     QStringList history;
99     int historyPtr;
100     NodeId cachedNodeid;
101 };
102
103 #endif // BITCOIN_QT_RPCCONSOLE_H
This page took 0.030029 seconds and 4 git commands to generate.