Changeset View
Changeset View
Standalone View
Standalone View
src/qt/rpcconsole.h
Show All 11 Lines | |||||
#include <QCompleter> | #include <QCompleter> | ||||
#include <QThread> | #include <QThread> | ||||
#include <QWidget> | #include <QWidget> | ||||
class ClientModel; | class ClientModel; | ||||
class PlatformStyle; | class PlatformStyle; | ||||
class RPCTimerInterface; | class RPCTimerInterface; | ||||
class WalletModel; | |||||
namespace Ui { | namespace Ui { | ||||
class RPCConsole; | class RPCConsole; | ||||
} | } | ||||
QT_BEGIN_NAMESPACE | QT_BEGIN_NAMESPACE | ||||
class QMenu; | class QMenu; | ||||
class QItemSelection; | class QItemSelection; | ||||
QT_END_NAMESPACE | QT_END_NAMESPACE | ||||
/** Local Bitcoin RPC console. */ | /** Local Bitcoin RPC console. */ | ||||
class RPCConsole : public QWidget { | class RPCConsole : public QWidget { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit RPCConsole(const PlatformStyle *platformStyle, QWidget *parent); | explicit RPCConsole(const PlatformStyle *platformStyle, QWidget *parent); | ||||
~RPCConsole(); | ~RPCConsole(); | ||||
static bool | static bool | ||||
RPCParseCommandLine(std::string &strResult, const std::string &strCommand, | RPCParseCommandLine(std::string &strResult, const std::string &strCommand, | ||||
bool fExecute, | bool fExecute, | ||||
std::string *const pstrFilteredOut = nullptr); | std::string *const pstrFilteredOut = nullptr, | ||||
const std::string *walletID = nullptr); | |||||
static bool | static bool | ||||
RPCExecuteCommandLine(std::string &strResult, const std::string &strCommand, | RPCExecuteCommandLine(std::string &strResult, const std::string &strCommand, | ||||
std::string *const pstrFilteredOut = nullptr) { | std::string *const pstrFilteredOut = nullptr, | ||||
return RPCParseCommandLine(strResult, strCommand, true, | const std::string *walletID = nullptr) { | ||||
pstrFilteredOut); | return RPCParseCommandLine(strResult, strCommand, true, pstrFilteredOut, | ||||
walletID); | |||||
} | } | ||||
void setClientModel(ClientModel *model); | void setClientModel(ClientModel *model); | ||||
void addWallet(WalletModel *const walletModel); | |||||
enum MessageClass { MC_ERROR, MC_DEBUG, CMD_REQUEST, CMD_REPLY, CMD_ERROR }; | enum MessageClass { MC_ERROR, MC_DEBUG, CMD_REQUEST, CMD_REPLY, CMD_ERROR }; | ||||
enum TabTypes { | enum TabTypes { | ||||
TAB_INFO = 0, | TAB_INFO = 0, | ||||
TAB_CONSOLE = 1, | TAB_CONSOLE = 1, | ||||
TAB_GRAPH = 2, | TAB_GRAPH = 2, | ||||
TAB_PEERS = 3 | TAB_PEERS = 3 | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | public Q_SLOTS: | ||||
/** Unban a selected node on the Bans tab */ | /** Unban a selected node on the Bans tab */ | ||||
void unbanSelectedNode(); | void unbanSelectedNode(); | ||||
/** set which tab has the focus (is visible) */ | /** set which tab has the focus (is visible) */ | ||||
void setTabFocus(enum TabTypes tabType); | void setTabFocus(enum TabTypes tabType); | ||||
Q_SIGNALS: | Q_SIGNALS: | ||||
// For RPC command executor | // For RPC command executor | ||||
void stopExecutor(); | void stopExecutor(); | ||||
void cmdRequest(const QString &command); | void cmdRequest(const QString &command, const QString &walletID); | ||||
private: | private: | ||||
static QString FormatBytes(quint64 bytes); | static QString FormatBytes(quint64 bytes); | ||||
void startExecutor(); | void startExecutor(); | ||||
void setTrafficGraphRange(int mins); | void setTrafficGraphRange(int mins); | ||||
/** show detailed information on ui about selected node */ | /** show detailed information on ui about selected node */ | ||||
void updateNodeDetail(const CNodeCombinedStats *stats); | void updateNodeDetail(const CNodeCombinedStats *stats); | ||||
Show All 14 Lines | private: | ||||
QList<NodeId> cachedNodeids; | QList<NodeId> cachedNodeids; | ||||
const PlatformStyle *platformStyle; | const PlatformStyle *platformStyle; | ||||
RPCTimerInterface *rpcTimerInterface; | RPCTimerInterface *rpcTimerInterface; | ||||
QMenu *peersTableContextMenu; | QMenu *peersTableContextMenu; | ||||
QMenu *banTableContextMenu; | QMenu *banTableContextMenu; | ||||
int consoleFontSize; | int consoleFontSize; | ||||
QCompleter *autoCompleter; | QCompleter *autoCompleter; | ||||
QThread thread; | QThread thread; | ||||
QString m_last_wallet_id; | |||||
/** Update UI with latest network info from model. */ | /** Update UI with latest network info from model. */ | ||||
void updateNetworkState(); | void updateNetworkState(); | ||||
}; | }; | ||||
#endif // BITCOIN_QT_RPCCONSOLE_H | #endif // BITCOIN_QT_RPCCONSOLE_H |