Changeset View
Changeset View
Standalone View
Standalone View
src/qt/rpcconsole.h
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_QT_RPCCONSOLE_H | #ifndef BITCOIN_QT_RPCCONSOLE_H | ||||
#define BITCOIN_QT_RPCCONSOLE_H | #define BITCOIN_QT_RPCCONSOLE_H | ||||
#include "guiutil.h" | #include <qt/guiutil.h> | ||||
#include "peertablemodel.h" | #include <qt/peertablemodel.h> | ||||
#include "net.h" | #include <net.h> | ||||
#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; | class WalletModel; | ||||
namespace interfaces { | |||||
class Node; | |||||
} | |||||
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(interfaces::Node &node, | ||||
const PlatformStyle *platformStyle, QWidget *parent); | |||||
~RPCConsole(); | ~RPCConsole(); | ||||
static bool | static bool | ||||
RPCParseCommandLine(std::string &strResult, const std::string &strCommand, | RPCParseCommandLine(interfaces::Node *node, std::string &strResult, | ||||
bool fExecute, | const std::string &strCommand, bool fExecute, | ||||
std::string *const pstrFilteredOut = nullptr, | std::string *const pstrFilteredOut = nullptr, | ||||
const std::string *walletID = nullptr); | const std::string *walletID = nullptr); | ||||
static bool | static bool | ||||
RPCExecuteCommandLine(std::string &strResult, const std::string &strCommand, | RPCExecuteCommandLine(interfaces::Node &node, std::string &strResult, | ||||
const std::string &strCommand, | |||||
std::string *const pstrFilteredOut = nullptr, | std::string *const pstrFilteredOut = nullptr, | ||||
const std::string *walletID = nullptr) { | const std::string *walletID = nullptr) { | ||||
return RPCParseCommandLine(strResult, strCommand, true, pstrFilteredOut, | return RPCParseCommandLine(&node, strResult, strCommand, true, | ||||
walletID); | pstrFilteredOut, walletID); | ||||
} | } | ||||
void setClientModel(ClientModel *model); | void setClientModel(ClientModel *model); | ||||
void addWallet(WalletModel *const walletModel); | 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 { | ||||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | enum ColumnWidths { | ||||
ADDRESS_COLUMN_WIDTH = 200, | ADDRESS_COLUMN_WIDTH = 200, | ||||
SUBVERSION_COLUMN_WIDTH = 150, | SUBVERSION_COLUMN_WIDTH = 150, | ||||
PING_COLUMN_WIDTH = 80, | PING_COLUMN_WIDTH = 80, | ||||
BANSUBNET_COLUMN_WIDTH = 200, | BANSUBNET_COLUMN_WIDTH = 200, | ||||
BANTIME_COLUMN_WIDTH = 250 | BANTIME_COLUMN_WIDTH = 250 | ||||
}; | }; | ||||
interfaces::Node &m_node; | |||||
Ui::RPCConsole *ui; | Ui::RPCConsole *ui; | ||||
ClientModel *clientModel; | ClientModel *clientModel; | ||||
QStringList history; | QStringList history; | ||||
int historyPtr; | int historyPtr; | ||||
QString cmdBeforeBrowsing; | QString cmdBeforeBrowsing; | ||||
QList<NodeId> cachedNodeids; | QList<NodeId> cachedNodeids; | ||||
const PlatformStyle *platformStyle; | const PlatformStyle *platformStyle; | ||||
RPCTimerInterface *rpcTimerInterface; | RPCTimerInterface *rpcTimerInterface; | ||||
Show All 12 Lines |