Dash Core  0.12.2.1
P2P Digital Currency
RPCConsole Class Reference

#include <rpcconsole.h>

+ Inheritance diagram for RPCConsole:

Public Types

enum  MessageClass {
  MC_ERROR, MC_DEBUG, CMD_REQUEST, CMD_REPLY,
  CMD_ERROR
}
 
enum  TabTypes {
  TAB_INFO = 0, TAB_CONSOLE = 1, TAB_GRAPH = 2, TAB_PEERS = 3,
  TAB_REPAIR = 4
}
 

Public Slots

void clear (bool clearHistory=true)
 
void fontBigger ()
 
void fontSmaller ()
 
void setFontSize (int newSize)
 
void walletSalvage ()
 
void walletRescan ()
 
void walletZaptxes1 ()
 
void walletZaptxes2 ()
 
void walletUpgrade ()
 
void walletReindex ()
 
void message (int category, const QString &message, bool html=false)
 
void setNumConnections (int count)
 
void setNetworkActive (bool networkActive)
 
void setMasternodeCount (const QString &strMasternodes)
 
void setNumBlocks (int count, const QDateTime &blockDate, double nVerificationProgress, bool headers)
 
void setMempoolSize (long numberOfTxs, size_t dynUsage)
 
void browseHistory (int offset)
 
void scrollToEnd ()
 
void peerSelected (const QItemSelection &selected, const QItemSelection &deselected)
 
void peerLayoutAboutToChange ()
 
void peerLayoutChanged ()
 
void disconnectSelectedNode ()
 
void banSelectedNode (int bantime)
 
void unbanSelectedNode ()
 
void setTabFocus (enum TabTypes tabType)
 

Signals

void stopExecutor ()
 
void cmdRequest (const QString &command)
 
void handleRestart (QStringList args)
 

Public Member Functions

 RPCConsole (const PlatformStyle *platformStyle, QWidget *parent)
 
 ~RPCConsole ()
 
void setClientModel (ClientModel *model)
 

Protected Member Functions

virtual bool eventFilter (QObject *obj, QEvent *event)
 
void keyPressEvent (QKeyEvent *)
 

Private Types

enum  ColumnWidths {
  ADDRESS_COLUMN_WIDTH = 170, SUBVERSION_COLUMN_WIDTH = 150, PING_COLUMN_WIDTH = 80, BANSUBNET_COLUMN_WIDTH = 200,
  BANTIME_COLUMN_WIDTH = 250
}
 

Private Slots

void on_lineEdit_returnPressed ()
 
void on_tabWidget_currentChanged (int index)
 
void on_openDebugLogfileButton_clicked ()
 
void on_sldGraphRange_valueChanged (int value)
 
void updateTrafficStats (quint64 totalBytesIn, quint64 totalBytesOut)
 
void resizeEvent (QResizeEvent *event)
 
void showEvent (QShowEvent *event)
 
void hideEvent (QHideEvent *event)
 
void showPeersTableContextMenu (const QPoint &point)
 
void showBanTableContextMenu (const QPoint &point)
 
void showOrHideBanTableIfRequired ()
 
void clearSelectedNode ()
 

Private Member Functions

void startExecutor ()
 
void setTrafficGraphRange (TrafficGraphData::GraphRange range)
 
void buildParameterlist (QString arg)
 
void updateNodeDetail (const CNodeCombinedStats *stats)
 
void updateNetworkState ()
 

Static Private Member Functions

static QString FormatBytes (quint64 bytes)
 

Private Attributes

Ui::RPCConsoleui
 
ClientModelclientModel
 
QStringList history
 
int historyPtr
 
QList< NodeIdcachedNodeids
 
const PlatformStyleplatformStyle
 
RPCTimerInterfacerpcTimerInterface
 
QMenu * peersTableContextMenu
 
QMenu * banTableContextMenu
 
int consoleFontSize
 
QCompleter * autoCompleter
 
QThread thread
 

Detailed Description

Local Bitcoin RPC console.

Definition at line 32 of file rpcconsole.h.

Member Enumeration Documentation

◆ ColumnWidths

Enumerator
ADDRESS_COLUMN_WIDTH 
SUBVERSION_COLUMN_WIDTH 
PING_COLUMN_WIDTH 
BANSUBNET_COLUMN_WIDTH 
BANTIME_COLUMN_WIDTH 

Definition at line 144 of file rpcconsole.h.

◆ MessageClass

Enumerator
MC_ERROR 
MC_DEBUG 
CMD_REQUEST 
CMD_REPLY 
CMD_ERROR 

Definition at line 42 of file rpcconsole.h.

◆ TabTypes

Enumerator
TAB_INFO 
TAB_CONSOLE 
TAB_GRAPH 
TAB_PEERS 
TAB_REPAIR 

Definition at line 50 of file rpcconsole.h.

Constructor & Destructor Documentation

◆ RPCConsole()

RPCConsole::RPCConsole ( const PlatformStyle platformStyle,
QWidget *  parent 
)
explicit

Definition at line 253 of file rpcconsole.cpp.

◆ ~RPCConsole()

RPCConsole::~RPCConsole ( )

Definition at line 316 of file rpcconsole.cpp.

Member Function Documentation

◆ banSelectedNode

void RPCConsole::banSelectedNode ( int  bantime)
slot

Ban a selected node on the Peers tab

Definition at line 1011 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ browseHistory

void RPCConsole::browseHistory ( int  offset)
slot

Go forward or back in history

Definition at line 745 of file rpcconsole.cpp.

Referenced by eventFilter().

◆ buildParameterlist()

void RPCConsole::buildParameterlist ( QString  arg)
private

Build parameter list for restart

Build command-line parameter list for restart

Definition at line 585 of file rpcconsole.cpp.

Referenced by walletReindex(), walletRescan(), walletSalvage(), walletUpgrade(), walletZaptxes1(), and walletZaptxes2().

◆ clear

void RPCConsole::clear ( bool  clearHistory = true)
slot

Definition at line 606 of file rpcconsole.cpp.

Referenced by RPCConsole(), and setFontSize().

◆ clearSelectedNode

void RPCConsole::clearSelectedNode ( )
privateslot

clear the selected node

Definition at line 1060 of file rpcconsole.cpp.

Referenced by banSelectedNode(), disconnectSelectedNode(), on_tabWidget_currentChanged(), peerLayoutChanged(), and setClientModel().

◆ cmdRequest

void RPCConsole::cmdRequest ( const QString &  command)
signal

Definition at line 374 of file moc_rpcconsole.cpp.

Referenced by on_lineEdit_returnPressed(), and startExecutor().

◆ disconnectSelectedNode

void RPCConsole::disconnectSelectedNode ( )
slot

Disconnect a selected node on the Peers tab

Definition at line 994 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ eventFilter()

bool RPCConsole::eventFilter ( QObject *  obj,
QEvent *  event 
)
protectedvirtual

Definition at line 324 of file rpcconsole.cpp.

◆ fontBigger

void RPCConsole::fontBigger ( )
slot

Definition at line 513 of file rpcconsole.cpp.

Referenced by RPCConsole().

◆ fontSmaller

void RPCConsole::fontSmaller ( )
slot

Definition at line 518 of file rpcconsole.cpp.

Referenced by RPCConsole().

◆ FormatBytes()

QString RPCConsole::FormatBytes ( quint64  bytes)
staticprivate

Definition at line 803 of file rpcconsole.cpp.

Referenced by updateNodeDetail(), and updateTrafficStats().

◆ handleRestart

void RPCConsole::handleRestart ( QStringList  args)
signal

Get restart command-line parameters and handle restart

Definition at line 381 of file moc_rpcconsole.cpp.

Referenced by buildParameterlist().

◆ hideEvent

void RPCConsole::hideEvent ( QHideEvent *  event)
privateslot

Definition at line 969 of file rpcconsole.cpp.

◆ keyPressEvent()

void RPCConsole::keyPressEvent ( QKeyEvent *  event)
protected

Definition at line 649 of file rpcconsole.cpp.

◆ message

void RPCConsole::message ( int  category,
const QString &  message,
bool  html = false 
)
slot

Append the message to the message widget

Definition at line 657 of file rpcconsole.cpp.

Referenced by clear(), on_lineEdit_returnPressed(), and startExecutor().

◆ on_lineEdit_returnPressed

void RPCConsole::on_lineEdit_returnPressed ( )
privateslot

Definition at line 722 of file rpcconsole.cpp.

◆ on_openDebugLogfileButton_clicked

void RPCConsole::on_openDebugLogfileButton_clicked ( )
privateslot

open the debug.log from the current datadir

Definition at line 787 of file rpcconsole.cpp.

◆ on_sldGraphRange_valueChanged

void RPCConsole::on_sldGraphRange_valueChanged ( int  value)
privateslot

change the time range of the network traffic graph

Definition at line 798 of file rpcconsole.cpp.

◆ on_tabWidget_currentChanged

void RPCConsole::on_tabWidget_currentChanged ( int  index)
privateslot

Definition at line 779 of file rpcconsole.cpp.

◆ peerLayoutAboutToChange

void RPCConsole::peerLayoutAboutToChange ( )
slot

Handle selection caching before update

Definition at line 839 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ peerLayoutChanged

void RPCConsole::peerLayoutChanged ( )
slot

Handle updated peer information

Definition at line 850 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ peerSelected

void RPCConsole::peerSelected ( const QItemSelection &  selected,
const QItemSelection &  deselected 
)
slot

Handle selection of peer in peers list

Definition at line 827 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ resizeEvent

void RPCConsole::resizeEvent ( QResizeEvent *  event)
privateslot

Definition at line 953 of file rpcconsole.cpp.

◆ scrollToEnd

void RPCConsole::scrollToEnd ( )
slot

Scroll console view to end

Definition at line 792 of file rpcconsole.cpp.

Referenced by on_lineEdit_returnPressed().

◆ setClientModel()

void RPCConsole::setClientModel ( ClientModel model)

Definition at line 368 of file rpcconsole.cpp.

Referenced by BitcoinGUI::setClientModel().

◆ setFontSize

void RPCConsole::setFontSize ( int  newSize)
slot

Definition at line 523 of file rpcconsole.cpp.

Referenced by fontBigger(), and fontSmaller().

◆ setMasternodeCount

void RPCConsole::setMasternodeCount ( const QString &  strMasternodes)
slot

Set number of masternodes shown in the UI

Definition at line 707 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ setMempoolSize

void RPCConsole::setMempoolSize ( long  numberOfTxs,
size_t  dynUsage 
)
slot

Set size (number of transactions and memory usage) of the mempool in the UI

Definition at line 712 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ setNetworkActive

void RPCConsole::setNetworkActive ( bool  networkActive)
slot

Set network state shown in the UI

Definition at line 694 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ setNumBlocks

void RPCConsole::setNumBlocks ( int  count,
const QDateTime &  blockDate,
double  nVerificationProgress,
bool  headers 
)
slot

Set number of blocks and last block date shown in the UI

Definition at line 699 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ setNumConnections

void RPCConsole::setNumConnections ( int  count)
slot

Set number of connections shown in the UI

Definition at line 686 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ setTabFocus

void RPCConsole::setTabFocus ( enum TabTypes  tabType)
slot

set which tab has the focus (is visible)

Definition at line 1078 of file rpcconsole.cpp.

Referenced by BitcoinGUI::showConsole(), BitcoinGUI::showGraph(), BitcoinGUI::showInfo(), BitcoinGUI::showPeers(), and BitcoinGUI::showRepair().

◆ setTrafficGraphRange()

void RPCConsole::setTrafficGraphRange ( TrafficGraphData::GraphRange  range)
private

Definition at line 815 of file rpcconsole.cpp.

Referenced by on_sldGraphRange_valueChanged(), and RPCConsole().

◆ showBanTableContextMenu

void RPCConsole::showBanTableContextMenu ( const QPoint &  point)
privateslot

Show custom context menu on Bans tab

Definition at line 987 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ showEvent

void RPCConsole::showEvent ( QShowEvent *  event)
privateslot

Definition at line 958 of file rpcconsole.cpp.

◆ showOrHideBanTableIfRequired

void RPCConsole::showOrHideBanTableIfRequired ( )
privateslot

Hides ban table if no bans are present

Definition at line 1068 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ showPeersTableContextMenu

void RPCConsole::showPeersTableContextMenu ( const QPoint &  point)
privateslot

Show custom context menu on Peers tab

Definition at line 980 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ startExecutor()

void RPCConsole::startExecutor ( )
private

Definition at line 758 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ stopExecutor

void RPCConsole::stopExecutor ( )
signal

Definition at line 368 of file moc_rpcconsole.cpp.

Referenced by setClientModel(), and startExecutor().

◆ unbanSelectedNode

void RPCConsole::unbanSelectedNode ( )
slot

Unban a selected node on the Bans tab

Definition at line 1038 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ updateNetworkState()

void RPCConsole::updateNetworkState ( )
private

Update UI with latest network info from model.

Definition at line 673 of file rpcconsole.cpp.

Referenced by setClientModel(), setNetworkActive(), and setNumConnections().

◆ updateNodeDetail()

void RPCConsole::updateNodeDetail ( const CNodeCombinedStats stats)
private

show detailed information on ui about selected node

Definition at line 907 of file rpcconsole.cpp.

Referenced by peerLayoutChanged(), and peerSelected().

◆ updateTrafficStats

void RPCConsole::updateTrafficStats ( quint64  totalBytesIn,
quint64  totalBytesOut 
)
privateslot

update traffic statistics

Definition at line 821 of file rpcconsole.cpp.

Referenced by setClientModel().

◆ walletReindex

void RPCConsole::walletReindex ( )
slot

Restart wallet with "-reindex"

Definition at line 579 of file rpcconsole.cpp.

Referenced by RPCConsole().

◆ walletRescan

void RPCConsole::walletRescan ( )
slot

Restart wallet with "-rescan"

Definition at line 555 of file rpcconsole.cpp.

Referenced by RPCConsole().

◆ walletSalvage

void RPCConsole::walletSalvage ( )
slot

Wallet repair options

Restart wallet with "-salvagewallet"

Definition at line 549 of file rpcconsole.cpp.

◆ walletUpgrade

void RPCConsole::walletUpgrade ( )
slot

Restart wallet with "-upgradewallet"

Definition at line 573 of file rpcconsole.cpp.

Referenced by RPCConsole().

◆ walletZaptxes1

void RPCConsole::walletZaptxes1 ( )
slot

Restart wallet with "-zapwallettxes=1"

Definition at line 561 of file rpcconsole.cpp.

Referenced by RPCConsole().

◆ walletZaptxes2

void RPCConsole::walletZaptxes2 ( )
slot

Restart wallet with "-zapwallettxes=2"

Definition at line 567 of file rpcconsole.cpp.

Referenced by RPCConsole().

Member Data Documentation

◆ autoCompleter

QCompleter* RPCConsole::autoCompleter
private

Definition at line 164 of file rpcconsole.h.

Referenced by eventFilter(), and setClientModel().

◆ banTableContextMenu

QMenu* RPCConsole::banTableContextMenu
private

Definition at line 162 of file rpcconsole.h.

Referenced by setClientModel(), and showBanTableContextMenu().

◆ cachedNodeids

QList<NodeId> RPCConsole::cachedNodeids
private

Definition at line 158 of file rpcconsole.h.

Referenced by clearSelectedNode(), peerLayoutAboutToChange(), and peerLayoutChanged().

◆ clientModel

◆ consoleFontSize

int RPCConsole::consoleFontSize
private

Definition at line 163 of file rpcconsole.h.

Referenced by clear(), fontBigger(), fontSmaller(), RPCConsole(), and setFontSize().

◆ history

QStringList RPCConsole::history
private

Definition at line 156 of file rpcconsole.h.

Referenced by browseHistory(), clear(), and on_lineEdit_returnPressed().

◆ historyPtr

int RPCConsole::historyPtr
private

Definition at line 157 of file rpcconsole.h.

Referenced by browseHistory(), clear(), and on_lineEdit_returnPressed().

◆ peersTableContextMenu

QMenu* RPCConsole::peersTableContextMenu
private

Definition at line 161 of file rpcconsole.h.

Referenced by setClientModel(), and showPeersTableContextMenu().

◆ platformStyle

const PlatformStyle* RPCConsole::platformStyle
private

Definition at line 159 of file rpcconsole.h.

Referenced by RPCConsole().

◆ rpcTimerInterface

RPCTimerInterface* RPCConsole::rpcTimerInterface
private

Definition at line 160 of file rpcconsole.h.

Referenced by RPCConsole(), and ~RPCConsole().

◆ thread

QThread RPCConsole::thread
private

Definition at line 165 of file rpcconsole.h.

Referenced by setClientModel(), and startExecutor().

◆ ui


The documentation for this class was generated from the following files: