PRCYCoin  2.0.0.7rc1
P2P Digital Currency
rpcconsole.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2014 The Bitcoin developers
2 // Distributed under the MIT/X11 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 <QDialog>
14 #include <QCompleter>
15 
16 class ClientModel;
17 class RPCTimerInterface;
18 
19 namespace Ui
20 {
21 class RPCConsole;
22 }
23 
24 QT_BEGIN_NAMESPACE
25 class QItemSelection;
26 class QMenu;
27 QT_END_NAMESPACE
28 
30 class RPCConsole : public QDialog
31 {
32  Q_OBJECT
33 
34 public:
35  explicit RPCConsole(QWidget* parent);
36  ~RPCConsole();
37 
38  void setClientModel(ClientModel* model);
39 
40  enum MessageClass {
46  };
47 
48 protected:
49  virtual bool eventFilter(QObject* obj, QEvent* event);
50 
51 private Q_SLOTS:
53  void on_tabWidget_currentChanged(int index);
57  void on_sldGraphRange_valueChanged(int value);
59  void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut);
60  void resizeEvent(QResizeEvent* event);
61  void showEvent(QShowEvent* event);
62  void hideEvent(QHideEvent* event);
64  void showPeersTableContextMenu(const QPoint& point);
66  void showBanTableContextMenu(const QPoint& point);
70  void clearSelectedNode();
71 
72 public Q_SLOTS:
73  void clear();
74 
76  void walletSalvage();
77  void walletRescan();
78  void walletZaptxes1();
79  void walletZaptxes2();
80  void walletUpgrade();
81  void walletReindex();
82  void walletResync();
83 
84  void reject();
85  void message(int category, const QString& message, bool html = false);
87  void setNumConnections(int count);
89  void setNumBlocks(int count);
91  void setMasternodeCount(const QString& strMasternodes);
93  void browseHistory(int offset);
95  void scrollToEnd();
97  void showInfo();
99  void showConsole();
101  void showNetwork();
103  void showPeers();
105  void showRepair();
107  void showConfEditor();
109  void showMNConfEditor();
111  void peerSelected(const QItemSelection& selected, const QItemSelection& deselected);
113  void peerLayoutChanged();
115  void disconnectSelectedNode();
117  void banSelectedNode(int bantime);
119  void unbanSelectedNode();
121  void showDataDir();
123  void showQtDir();
125  void showBackups();
126 
127 Q_SIGNALS:
128  // For RPC command executor
129  void stopExecutor();
130  void cmdRequest(const QString& command);
132  void handleRestart(QStringList args);
133 
134 private:
135  void startExecutor();
136  void setTrafficGraphRange(int mins);
138  void buildParameterlist(QString arg);
140  void updateNodeDetail(const CNodeCombinedStats* stats);
141 
148  };
149 
150  Ui::RPCConsole* ui;
152  QStringList history;
155  QCompleter *autoCompleter;
159 };
160 
161 #endif // BITCOIN_QT_RPCCONSOLE_H
RPCConsole::walletRescan
void walletRescan()
Restart wallet with "-rescan".
Definition: rpcconsole.cpp:534
NodeId
int64_t NodeId
Definition: net.h:92
RPCConsole::showNetwork
void showNetwork()
Switch to network tab and show.
Definition: rpcconsole.cpp:807
RPCConsole::buildParameterlist
void buildParameterlist(QString arg)
Build parameter list for restart.
Definition: rpcconsole.cpp:585
RPCConsole::eventFilter
virtual bool eventFilter(QObject *obj, QEvent *event)
Definition: rpcconsole.cpp:338
RPCConsole::setNumConnections
void setNumConnections(int count)
Set number of connections shown in the UI.
Definition: rpcconsole.cpp:671
RPCConsole::ADDRESS_COLUMN_WIDTH
@ ADDRESS_COLUMN_WIDTH
Definition: rpcconsole.h:143
RPCConsole::setNumBlocks
void setNumBlocks(int count)
Set number of blocks shown in the UI.
Definition: rpcconsole.cpp:683
RPCConsole::startExecutor
void startExecutor()
Definition: rpcconsole.cpp:732
RPCConsole::walletReindex
void walletReindex()
Restart wallet with "-reindex".
Definition: rpcconsole.cpp:558
RPCTimerInterface
RPC timer "driver".
Definition: server.h:88
RPCConsole::showPeers
void showPeers()
Switch to peers tab and show.
Definition: rpcconsole.cpp:813
RPCConsole::clearSelectedNode
void clearSelectedNode()
clear the selected node
Definition: rpcconsole.cpp:1072
RPCConsole::walletResync
void walletResync()
Restart wallet with "-resync".
Definition: rpcconsole.cpp:564
RPCConsole::CMD_REQUEST
@ CMD_REQUEST
Definition: rpcconsole.h:43
RPCConsole::showOrHideBanTableIfRequired
void showOrHideBanTableIfRequired()
Hides ban table if no bans are present.
Definition: rpcconsole.cpp:1080
RPCConsole::showConsole
void showConsole()
Switch to console tab and show.
Definition: rpcconsole.cpp:801
RPCConsole::RPCConsole
RPCConsole(QWidget *parent)
Definition: rpcconsole.cpp:258
RPCConsole::autoCompleter
QCompleter * autoCompleter
Definition: rpcconsole.h:155
RPCConsole::showConfEditor
void showConfEditor()
Open external (default) editor with prcycoin.conf.
Definition: rpcconsole.cpp:825
RPCConsole::CMD_ERROR
@ CMD_ERROR
Definition: rpcconsole.h:45
RPCConsole::setTrafficGraphRange
void setTrafficGraphRange(int mins)
Definition: rpcconsole.cpp:783
RPCConsole::walletZaptxes1
void walletZaptxes1()
Restart wallet with "-zapwallettxes=1".
Definition: rpcconsole.cpp:540
RPCConsole::showEvent
void showEvent(QShowEvent *event)
Definition: rpcconsole.cpp:950
RPCConsole::message
void message(int category, const QString &message, bool html=false)
Definition: rpcconsole.cpp:655
RPCConsole::cachedNodeid
NodeId cachedNodeid
Definition: rpcconsole.h:154
RPCConsole::stopExecutor
void stopExecutor()
RPCConsole::clear
void clear()
Definition: rpcconsole.cpp:606
RPCConsole::peerLayoutChanged
void peerLayoutChanged()
Handle updated peer information.
Definition: rpcconsole.cpp:847
RPCConsole::reject
void reject()
Definition: rpcconsole.cpp:648
RPCConsole::updateTrafficStats
void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut)
update traffic statistics
Definition: rpcconsole.cpp:789
RPCConsole::MC_DEBUG
@ MC_DEBUG
Definition: rpcconsole.h:42
RPCConsole::scrollToEnd
void scrollToEnd()
Scroll console view to end.
Definition: rpcconsole.cpp:770
RPCConsole::showInfo
void showInfo()
Switch to info tab and show.
Definition: rpcconsole.cpp:795
RPCConsole::showPeersTableContextMenu
void showPeersTableContextMenu(const QPoint &point)
Show custom context menu on Peers tab.
Definition: rpcconsole.cpp:989
RPCConsole::showMNConfEditor
void showMNConfEditor()
Open external (default) editor with masternode.conf.
Definition: rpcconsole.cpp:830
RPCConsole::showRepair
void showRepair()
Switch to wallet-repair tab and show.
Definition: rpcconsole.cpp:819
RPCConsole::resizeEvent
void resizeEvent(QResizeEvent *event)
Definition: rpcconsole.cpp:945
RPCConsole::CMD_REPLY
@ CMD_REPLY
Definition: rpcconsole.h:44
RPCConsole::on_tabWidget_currentChanged
void on_tabWidget_currentChanged(int index)
Definition: rpcconsole.cpp:756
RPCConsole::disconnectSelectedNode
void disconnectSelectedNode()
Disconnect a selected node on the Peers tab.
Definition: rpcconsole.cpp:1003
RPCConsole
Local Bitcoin RPC console.
Definition: rpcconsole.h:30
RPCConsole::MessageClass
MessageClass
Definition: rpcconsole.h:40
RPCConsole::ColumnWidths
ColumnWidths
Definition: rpcconsole.h:142
RPCConsole::BANSUBNET_COLUMN_WIDTH
@ BANSUBNET_COLUMN_WIDTH
Definition: rpcconsole.h:146
RPCConsole::walletZaptxes2
void walletZaptxes2()
Restart wallet with "-zapwallettxes=2".
Definition: rpcconsole.cpp:546
guiutil.h
RPCConsole::MC_ERROR
@ MC_ERROR
Definition: rpcconsole.h:41
RPCConsole::PING_COLUMN_WIDTH
@ PING_COLUMN_WIDTH
Definition: rpcconsole.h:145
RPCConsole::handleRestart
void handleRestart(QStringList args)
Get restart command-line parameters and handle restart.
RPCConsole::showBanTableContextMenu
void showBanTableContextMenu(const QPoint &point)
Show custom context menu on Bans tab.
Definition: rpcconsole.cpp:996
RPCConsole::showQtDir
void showQtDir()
Show Qt Dir folder in default browser.
Definition: rpcconsole.cpp:979
RPCConsole::SUBVERSION_COLUMN_WIDTH
@ SUBVERSION_COLUMN_WIDTH
Definition: rpcconsole.h:144
CNodeCombinedStats
Definition: peertablemodel.h:21
RPCConsole::BANTIME_COLUMN_WIDTH
@ BANTIME_COLUMN_WIDTH
Definition: rpcconsole.h:147
RPCConsole::~RPCConsole
~RPCConsole()
Definition: rpcconsole.cpp:327
RPCConsole::showDataDir
void showDataDir()
Show DataDir folder in default browser.
Definition: rpcconsole.cpp:974
RPCConsole::updateNodeDetail
void updateNodeDetail(const CNodeCombinedStats *stats)
show detailed information on ui about selected node
Definition: rpcconsole.cpp:897
RPCConsole::history
QStringList history
Definition: rpcconsole.h:152
ClientModel
Model for PRCY network client.
Definition: clientmodel.h:44
Ui
Definition: 2faconfirmdialog.h:7
RPCConsole::showBackups
void showBackups()
Show folder with wallet backups in default browser.
Definition: rpcconsole.cpp:984
RPCConsole::on_lineEdit_returnPressed
void on_lineEdit_returnPressed()
Definition: rpcconsole.cpp:697
RPCConsole::peersTableContextMenu
QMenu * peersTableContextMenu
Definition: rpcconsole.h:156
RPCConsole::hideEvent
void hideEvent(QHideEvent *event)
Definition: rpcconsole.cpp:962
RPCConsole::cmdRequest
void cmdRequest(const QString &command)
RPCConsole::on_openDebugLogfileButton_clicked
void on_openDebugLogfileButton_clicked()
open the debug.log from the current datadir
Definition: rpcconsole.cpp:765
RPCConsole::setMasternodeCount
void setMasternodeCount(const QString &strMasternodes)
Set number of masternodes shown in the UI.
Definition: rpcconsole.cpp:692
RPCConsole::walletSalvage
void walletSalvage()
Wallet repair options.
Definition: rpcconsole.cpp:528
RPCConsole::browseHistory
void browseHistory(int offset)
Go forward or back in history.
Definition: rpcconsole.cpp:719
RPCConsole::historyPtr
int historyPtr
Definition: rpcconsole.h:153
RPCConsole::on_sldGraphRange_valueChanged
void on_sldGraphRange_valueChanged(int value)
change the time range of the network traffic graph
Definition: rpcconsole.cpp:776
RPCConsole::setClientModel
void setClientModel(ClientModel *model)
Definition: rpcconsole.cpp:388
peertablemodel.h
RPCConsole::walletUpgrade
void walletUpgrade()
Restart wallet with "-upgradewallet".
Definition: rpcconsole.cpp:552
net.h
RPCConsole::unbanSelectedNode
void unbanSelectedNode()
Unban a selected node on the Bans tab.
Definition: rpcconsole.cpp:1056
RPCConsole::rpcTimerInterface
RPCTimerInterface * rpcTimerInterface
Definition: rpcconsole.h:158
RPCConsole::peerSelected
void peerSelected(const QItemSelection &selected, const QItemSelection &deselected)
Handle selection of peer in peers list.
Definition: rpcconsole.cpp:835
RPCConsole::banSelectedNode
void banSelectedNode(int bantime)
Ban a selected node on the Peers tab.
Definition: rpcconsole.cpp:1024
RPCConsole::clientModel
ClientModel * clientModel
Definition: rpcconsole.h:151
RPCConsole::banTableContextMenu
QMenu * banTableContextMenu
Definition: rpcconsole.h:157
RPCConsole::ui
Ui::RPCConsole * ui
Definition: rpcconsole.h:150