5 #if defined(HAVE_CONFIG_H) 30 #include <QAbstractButton> 31 #include <QAbstractItemModel> 35 #include <QKeySequence> 36 #include <QLatin1String> 39 #include <QMessageBox> 44 #include <QStringList> 45 #include <QStyledItemDelegate> 61 {
"cmd-request",
":/icons/tx_input"},
62 {
"cmd-reply",
":/icons/tx_output"},
63 {
"cmd-error",
":/icons/tx_output"},
64 {
"misc",
":/icons/tx_inout"},
71 const QStringList historyFilter = QStringList()
75 <<
"signmessagewithprivkey" 76 <<
"signrawtransactionwithkey" 78 <<
"walletpassphrasechange" 111 timer.setSingleShot(
true);
112 connect(&
timer, &QTimer::timeout, [
this]{
func(); });
125 const char *
Name()
override {
return "Qt"; }
137 : QStyledItemDelegate(parent) {}
139 QString
displayText(
const QVariant& value,
const QLocale& locale)
const override 143 return value.toString() + QLatin1String(
" ");
147 #include <qt/rpcconsole.moc> 171 std::vector< std::vector<std::string> > stack;
172 stack.push_back(std::vector<std::string>());
177 STATE_EATING_SPACES_IN_ARG,
178 STATE_EATING_SPACES_IN_BRACKETS,
183 STATE_ESCAPE_DOUBLEQUOTED,
184 STATE_COMMAND_EXECUTED,
185 STATE_COMMAND_EXECUTED_INNER
186 } state = STATE_EATING_SPACES;
189 unsigned nDepthInsideSensitive = 0;
190 size_t filter_begin_pos = 0, chpos;
191 std::vector<std::pair<size_t, size_t>> filter_ranges;
193 auto add_to_current_stack = [&](
const std::string& strArg) {
194 if (stack.back().empty() && (!nDepthInsideSensitive) && historyFilter.contains(QString::fromStdString(strArg), Qt::CaseInsensitive)) {
195 nDepthInsideSensitive = 1;
196 filter_begin_pos = chpos;
200 stack.
push_back(std::vector<std::string>());
202 stack.back().push_back(strArg);
205 auto close_out_params = [&]() {
206 if (nDepthInsideSensitive) {
207 if (!--nDepthInsideSensitive) {
209 filter_ranges.push_back(std::make_pair(filter_begin_pos, chpos));
210 filter_begin_pos = 0;
216 std::string strCommandTerminated = strCommand;
217 if (strCommandTerminated.back() !=
'\n')
218 strCommandTerminated +=
"\n";
219 for (chpos = 0; chpos < strCommandTerminated.size(); ++chpos)
221 char ch = strCommandTerminated[chpos];
224 case STATE_COMMAND_EXECUTED_INNER:
225 case STATE_COMMAND_EXECUTED:
227 bool breakParsing =
true;
230 case '[': curarg.clear(); state = STATE_COMMAND_EXECUTED_INNER;
break;
232 if (state == STATE_COMMAND_EXECUTED_INNER)
240 if (curarg.size() && fExecute)
246 const auto parsed{ToIntegral<size_t>(curarg)};
248 throw std::runtime_error(
"Invalid result query");
250 subelement = lastResult[parsed.value()];
255 throw std::runtime_error(
"Invalid result query");
256 lastResult = subelement;
259 state = STATE_COMMAND_EXECUTED;
263 breakParsing =
false;
269 if (lastResult.
isStr())
272 curarg = lastResult.
write(2);
278 add_to_current_stack(curarg);
284 state = STATE_EATING_SPACES;
291 case STATE_EATING_SPACES_IN_ARG:
292 case STATE_EATING_SPACES_IN_BRACKETS:
293 case STATE_EATING_SPACES:
296 case '"': state = STATE_DOUBLEQUOTED;
break;
297 case '\'': state = STATE_SINGLEQUOTED;
break;
298 case '\\': state = STATE_ESCAPE_OUTER;
break;
299 case '(':
case ')':
case '\n':
300 if (state == STATE_EATING_SPACES_IN_ARG)
301 throw std::runtime_error(
"Invalid Syntax");
302 if (state == STATE_ARGUMENT)
304 if (ch ==
'(' && stack.size() && stack.back().size() > 0)
306 if (nDepthInsideSensitive) {
307 ++nDepthInsideSensitive;
309 stack.push_back(std::vector<std::string>());
314 throw std::runtime_error(
"Invalid Syntax");
316 add_to_current_stack(curarg);
318 state = STATE_EATING_SPACES_IN_BRACKETS;
320 if ((ch ==
')' || ch ==
'\n') && stack.size() > 0)
325 UniValue params =
RPCConvertValues(stack.back()[0], std::vector<std::string>(stack.back().begin() + 1, stack.back().end()));
326 std::string method = stack.back()[0];
330 QByteArray encodedName = QUrl::toPercentEncoding(wallet_model->
getWalletName());
331 uri =
"/wallet/"+std::string(encodedName.constData(), encodedName.length());
335 lastResult =
node->executeRpc(method, params, uri);
338 state = STATE_COMMAND_EXECUTED;
342 case ' ':
case ',':
case '\t':
343 if(state == STATE_EATING_SPACES_IN_ARG && curarg.empty() && ch ==
',')
344 throw std::runtime_error(
"Invalid Syntax");
346 else if(state == STATE_ARGUMENT)
348 add_to_current_stack(curarg);
351 if ((state == STATE_EATING_SPACES_IN_BRACKETS || state == STATE_ARGUMENT) && ch ==
',')
353 state = STATE_EATING_SPACES_IN_ARG;
356 state = STATE_EATING_SPACES;
358 default: curarg += ch; state = STATE_ARGUMENT;
361 case STATE_SINGLEQUOTED:
364 case '\'': state = STATE_ARGUMENT;
break;
365 default: curarg += ch;
368 case STATE_DOUBLEQUOTED:
371 case '"': state = STATE_ARGUMENT;
break;
372 case '\\': state = STATE_ESCAPE_DOUBLEQUOTED;
break;
373 default: curarg += ch;
376 case STATE_ESCAPE_OUTER:
377 curarg += ch; state = STATE_ARGUMENT;
379 case STATE_ESCAPE_DOUBLEQUOTED:
380 if(ch !=
'"' && ch !=
'\\') curarg +=
'\\';
381 curarg += ch; state = STATE_DOUBLEQUOTED;
385 if (pstrFilteredOut) {
386 if (STATE_COMMAND_EXECUTED == state) {
390 *pstrFilteredOut = strCommand;
391 for (
auto i = filter_ranges.rbegin(); i != filter_ranges.rend(); ++i) {
392 pstrFilteredOut->replace(i->first, i->second - i->first,
"(…)");
397 case STATE_COMMAND_EXECUTED:
398 if (lastResult.
isStr())
399 strResult = lastResult.
get_str();
401 strResult = lastResult.
write(2);
404 case STATE_EATING_SPACES:
416 std::string executableCommand =
command.toStdString() +
"\n";
419 if(executableCommand ==
"help-console\n") {
421 "This console accepts RPC commands using the standard syntax.\n" 422 " example: getblockhash 0\n\n" 424 "This console can also accept RPC commands using the parenthesized syntax.\n" 425 " example: getblockhash(0)\n\n" 427 "Commands may be nested when specified with the parenthesized syntax.\n" 428 " example: getblock(getblockhash(0) 1)\n\n" 430 "A space or a comma can be used to delimit arguments for either syntax.\n" 431 " example: getblockhash 0\n" 432 " getblockhash,0\n\n" 434 "Named results can be queried with a non-quoted key string in brackets using the parenthesized syntax.\n" 435 " example: getblock(getblockhash(0) 1)[tx]\n\n" 437 "Results without keys can be queried with an integer in brackets using the parenthesized syntax.\n" 438 " example: getblock(getblockhash(0),1)[tx][0]\n\n")));
456 catch (
const std::runtime_error&)
461 catch (
const std::exception& e)
471 platformStyle(_platformStyle)
478 if (!restoreGeometry(settings.value(
"RPCConsoleWindowGeometry").toByteArray())) {
480 move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
482 ui->
splitter->restoreState(settings.value(
"RPCConsoleWindowPeersTabSplitterSizes").toByteArray());
484 #endif // ENABLE_WALLET 487 ui->
splitter->restoreState(settings.value(
"RPCConsoleWidgetPeersTabSplitterSizes").toByteArray());
493 constexpr QChar nonbreaking_hyphen(8209);
496 tr(
"Inbound: initiated by peer"),
500 tr(
"Outbound Full Relay: default"),
503 tr(
"Outbound Block Relay: does not relay transactions or addresses"),
508 tr(
"Outbound Manual: added using RPC %1 or %2/%3 configuration options")
510 .arg(QString(nonbreaking_hyphen) +
"addnode")
511 .arg(QString(nonbreaking_hyphen) +
"connect"),
514 tr(
"Outbound Feeler: short-lived, for testing addresses"),
517 tr(
"Outbound Address Fetch: short-lived, for soliciting addresses")};
520 const QString hb_list{
"<ul><li>\"" 521 +
ts.
to +
"\" – " + tr(
"we selected the peer for high bandwidth relay") +
"</li><li>\"" 522 +
ts.
from +
"\" – " + tr(
"the peer selected us for high bandwidth relay") +
"</li><li>\"" 523 +
ts.
no +
"\" – " + tr(
"no high bandwidth relay selected") +
"</li></ul>"};
525 ui->
dataDir->setToolTip(
ui->
dataDir->toolTip().arg(QString(nonbreaking_hyphen) +
"datadir"));
553 connect(
ui->
clearButton, &QAbstractButton::clicked, [
this] { clear(); });
583 settings.setValue(
"RPCConsoleWindowGeometry", saveGeometry());
584 settings.setValue(
"RPCConsoleWindowPeersTabSplitterSizes",
ui->
splitter->saveState());
586 #endif // ENABLE_WALLET 589 settings.setValue(
"RPCConsoleWidgetPeersTabSplitterSizes",
ui->
splitter->saveState());
602 if(event->type() == QEvent::KeyPress)
604 QKeyEvent *keyevt =
static_cast<QKeyEvent*
>(event);
605 int key = keyevt->key();
606 Qt::KeyboardModifiers mod = keyevt->modifiers();
612 case Qt::Key_PageDown:
622 QApplication::sendEvent(
ui->
lineEdit, keyevt);
631 (!mod && !keyevt->text().isEmpty() && key != Qt::Key_Tab) ||
632 ((mod & Qt::ControlModifier) && key == Qt::Key_V) ||
633 ((mod & Qt::ShiftModifier) && key == Qt::Key_Insert)))
636 QApplication::sendEvent(
ui->
lineEdit, keyevt);
641 return QWidget::eventFilter(obj, event);
648 bool wallet_enabled{
false};
651 #endif // ENABLE_WALLET 652 if (model && !wallet_enabled) {
679 ui->
peerWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
680 ui->
peerWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
681 ui->
peerWidget->setContextMenuPolicy(Qt::CustomContextMenu);
689 ui->
peerWidget->horizontalHeader()->setStretchLastSection(
true);
713 ui->
banlistWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
714 ui->
banlistWidget->setSelectionMode(QAbstractItemView::SingleSelection);
751 QStringList wordList;
753 for (
size_t i = 0; i < commandList.size(); ++i)
755 wordList << commandList[i].c_str();
756 wordList << (
"help " + commandList[i]).c_str();
759 wordList <<
"help-console";
762 autoCompleter->setModelSorting(QCompleter::CaseSensitivelySortedModel);
779 void RPCConsole::addWallet(
WalletModel *
const walletModel)
793 void RPCConsole::removeWallet(
WalletModel *
const walletModel)
810 default:
return "misc";
836 str.replace(QString(
"font-size:%1pt").arg(
consoleFontSize), QString(
"font-size:%1pt").arg(newSize));
860 QTextDocument::ImageResource,
874 "td.time { color: #808080; font-size: %2; padding-top: 3px; } " 875 "td.message { font-family: %1; font-size: %2; white-space:pre-wrap; } " 876 "td.cmd-request { color: #006060; } " 877 "td.cmd-error { color: red; } " 878 ".secwarning { color: red; }" 879 "b { color: #006060; } " 883 static const QString welcome_message =
887 tr(
"Welcome to the %1 RPC console.\n" 888 "Use up and down arrows to navigate history, and %2 to clear screen.\n" 889 "Use %3 and %4 to increase or decrease the font size.\n" 890 "Type %5 for an overview of available commands.\n" 891 "For more information on using this console, type %6.\n" 893 "%7WARNING: Scammers have been active, telling users to type" 894 " commands here, stealing their wallet contents. Do not use this console" 895 " without fully understanding the ramifications of a command.%8")
897 "<b>" +
ui->
clearButton->shortcut().toString(QKeySequence::NativeText) +
"</b>",
901 "<b>help-console</b>",
902 "<span class=\"secwarning\">",
917 if (e->type() == QEvent::PaletteChange) {
925 QTextDocument::ImageResource,
931 QWidget::changeEvent(e);
936 QTime time = QTime::currentTime();
937 QString timeString = time.toString();
939 out +=
"<table><tr><td class=\"time\" width=\"65\">" + timeString +
"</td>";
940 out +=
"<td class=\"icon\" width=\"32\"><img src=\"" +
categoryClass(category) +
"\"></td>";
941 out +=
"<td class=\"message " +
categoryClass(category) +
"\" valign=\"middle\">";
946 out +=
"</td></tr></table>";
957 connections +=
" (" + tr(
"Network activity disabled") +
")";
988 if (dynUsage < 1000000)
989 ui->
mempoolSize->setText(QString::number(dynUsage/1000.0,
'f', 2) +
" KB");
991 ui->
mempoolSize->setText(QString::number(dynUsage/1000000.0,
'f', 2) +
" MB");
1002 std::string strFilteredCmd;
1007 throw std::runtime_error(
"Invalid command line");
1009 }
catch (
const std::exception& e) {
1010 QMessageBox::critical(
this,
"Error", QString(
"Error: ") + QString::fromStdString(e.what()));
1015 if (
cmd == QLatin1String(
"stop")) {
1028 #ifdef ENABLE_WALLET 1033 message(
CMD_REQUEST, tr(
"Executing command using \"%1\" wallet").arg(wallet_model->getWalletName()));
1039 #endif // ENABLE_WALLET 1046 QMetaObject::invokeMethod(
m_executor, [
this,
cmd, wallet_model] {
1050 cmd = QString::fromStdString(strFilteredCmd);
1103 connect(&
thread, &QThread::finished,
m_executor, &RPCExecutor::deleteLater);
1128 scrollbar->setValue(scrollbar->maximum());
1133 const int multiplier = 5;
1134 int mins = value * multiplier;
1155 ui->
peerHeading->setText(tr(
"Select a peer to view detailed information."));
1160 QString peerAddrDetails(QString::fromStdString(stats->nodeStats.m_addr_name) +
" ");
1161 peerAddrDetails += tr(
"(peer: %1)").arg(QString::number(stats->nodeStats.nodeid));
1162 if (!stats->nodeStats.addrLocal.empty())
1163 peerAddrDetails +=
"<br />" + tr(
"via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal));
1165 QString bip152_hb_settings;
1166 if (stats->nodeStats.m_bip152_highbandwidth_to) bip152_hb_settings =
ts.
to;
1167 if (stats->nodeStats.m_bip152_highbandwidth_from) bip152_hb_settings += (bip152_hb_settings.isEmpty() ?
ts.
from : QLatin1Char(
'/') +
ts.
from);
1168 if (bip152_hb_settings.isEmpty()) bip152_hb_settings =
ts.
no;
1170 const auto time_now{GetTime<std::chrono::seconds>()};
1181 ui->
peerVersion->setText(QString::number(stats->nodeStats.nVersion));
1182 ui->
peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer));
1188 QStringList permissions;
1190 permissions.append(QString::fromStdString(permission));
1194 ui->
peerMappedAS->setText(stats->nodeStats.m_mapped_as != 0 ? QString::number(stats->nodeStats.m_mapped_as) :
ts.
na);
1198 if (stats->fNodeStateStatsAvailable) {
1201 if (stats->nodeStateStats.nSyncHeight > -1) {
1202 ui->
peerSyncHeight->setText(QString(
"%1").arg(stats->nodeStateStats.nSyncHeight));
1207 if (stats->nodeStateStats.nCommonHeight > -1) {
1208 ui->
peerCommonHeight->setText(QString(
"%1").arg(stats->nodeStateStats.nCommonHeight));
1212 ui->
peerHeight->setText(QString::number(stats->nodeStateStats.m_starting_height));
1225 QWidget::resizeEvent(event);
1230 QWidget::showEvent(event);
1246 QWidget::hideEvent(event);
1258 if (index.isValid())
1265 if (index.isValid())
1273 for(
int i = 0; i < nodes.count(); i++)
1276 NodeId id = nodes.at(i).data().toLongLong();
1292 m_node.
ban(stats->nodeStats.addr, bantime);
1307 for(
int i = 0; i < nodes.count(); i++)
1310 QString strNode = nodes.at(i).data().toString();
QTableView * banlistWidget
QString formatClientStartupTime() const
QString formatPingTime(std::chrono::microseconds ping_time)
Format a CNodeStats.m_last_ping_time into a user-readable string or display N/A, if 0...
void push_back(UniValue val)
QString formatSubVersion() const
Local Bitcoin RPC console.
QString cmdBeforeBrowsing
virtual bool getNetworkActive()=0
Get network active.
QLabel * peerAddrRelayEnabled
QPushButton * openDebugLogfileButton
static bool isWalletEnabled()
void on_lineEdit_returnPressed()
QLabel * numberOfConnections
RPCExecutor(interfaces::Node &node)
QToolButton * clearButton
QString blocksDir() const
void showPeersTableContextMenu(const QPoint &point)
Show custom context menu on Peers tab.
virtual bool unban(const CSubNet &ip)=0
Unban node.
WalletModel * m_last_wallet_model
void updateDetailWidget()
show detailed information on ui about selected node
virtual void rpcUnsetTimerInterface(RPCTimerInterface *iface)=0
Unset RPC timer interface.
void setClientModel(ClientModel *model=nullptr, int bestblock_height=0, int64_t bestblock_date=0, double verification_progress=0.0)
QLabel * peerCommonHeight
QLabel * peerConnectionTypeLabel
QTextEdit * messagesWidget
interfaces::Node & m_node
void ThreadRename(std::string &&)
Rename a thread both in terms of an internal (in-memory) name as well as its system thread name...
void setNetworkActive(bool networkActive)
Set network state shown in the UI.
void scrollToEnd()
Scroll console view to end.
QString formatBytes(uint64_t bytes)
QString formatTimeOffset(int64_t nTimeOffset)
Format a CNodeCombinedStats.nTimeOffset into a user-readable string.
void networkActiveChanged(bool networkActive)
static QString categoryClass(int category)
void clearSelectedNode()
clear the selected node
const struct @8 ICON_MAPPING[]
RPCConsole(interfaces::Node &node, const PlatformStyle *platformStyle, QWidget *parent)
const std::string & get_str() const
QString HtmlEscape(const QString &str, bool fMultiLine)
QFont fixedPitchFont(bool use_embedded_font)
void changeEvent(QEvent *e) override
PeerTableModel * getPeerTableModel()
void disconnectSelectedNode()
Disconnect a selected node on the Peers tab.
QLabel * peerHighBandwidthLabel
void on_tabWidget_currentChanged(int index)
void setupUi(QWidget *RPCConsole)
void numConnectionsChanged(int count)
QString formatDurationStr(std::chrono::seconds dur)
Convert seconds into a QString with days, hours, mins, secs.
QLabel * mempoolNumberTxs
virtual bool ban(const CNetAddr &net_addr, int64_t ban_time_offset)=0
Ban node.
QWidget * peersTabRightPanel
virtual void rpcSetTimerInterfaceIfUnset(RPCTimerInterface *iface)=0
Set RPC timer interface if unset.
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
QString tabTitle(TabTypes tab_type) const
void alertsChanged(const QString &warnings)
void clear(bool keep_prompt=false)
const UniValue & find_value(const UniValue &obj, const std::string &name)
QPushButton * btnClearTrafficGraph
UniValue RPCConvertValues(const std::string &strMethod, const std::vector< std::string > &strParams)
Convert positional arguments to command-specific RPC representation.
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
const PlatformStyle *const platformStyle
void reply(int category, const QString &command)
struct RPCConsole::TranslatedStrings ts
QMenu * peersTableContextMenu
QString NetworkToQString(Network net)
Convert enum Network to QString.
void browseHistory(int offset)
Go forward or back in history.
void resizeEvent(QResizeEvent *event) override
QLabel * WalletSelectorLabel
void message(int category, const QString &msg)
Append the message to the message widget.
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
Class for handling RPC timers (used for e.g.
QLabel * peerAddrProcessed
QByteArray m_banlist_widget_header_state
const int CONSOLE_HISTORY
void handleCloseWindowShortcut(QWidget *w)
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
QToolButton * fontBiggerButton
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, SyncType header, SynchronizationState sync_state)
QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction)
Convert enum ConnectionType to QString.
BanTableModel * getBanTableModel()
interfaces::Node & node() const
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
RPCTimerInterface * rpcTimerInterface
virtual bool disconnectByAddress(const CNetAddr &net_addr)=0
Disconnect node by address.
void updateNetworkState()
Update UI with latest network info from model.
QByteArray m_peer_widget_header_state
QString displayText(const QVariant &value, const QLocale &locale) const override
QString getWalletName() const
~QtRPCTimerInterface()=default
void on_openDebugLogfileButton_clicked()
open the debug.log from the current datadir
const char * Name() override
Implementation name.
void copyEntryData(const QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
QtRPCTimerBase(std::function< void()> &_func, int64_t millis)
Model for Bitcoin network client.
void unbanSelectedNode()
Unban a selected node on the Bans tab.
ClientModel * clientModel
TrafficGraphWidget * trafficGraph
QMenu * banTableContextMenu
void setTrafficGraphRange(int mins)
QKeySequence tabShortcut(TabTypes tab_type) const
bool IsEscapeOrBack(int key)
void showOrHideBanTableIfRequired()
Hides ban table if no bans are present.
const std::vector< std::string > CONNECTION_TYPE_DOC
void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut)
update traffic statistics
QList< NodeId > cachedNodeids
void setMempoolSize(long numberOfTxs, size_t dynUsage)
Set size (number of transactions and memory usage) of the mempool in the UI.
void setFontSize(int newSize)
std::function< void()> func
PeerIdViewDelegate(QObject *parent=nullptr)
void setNumConnections(int count)
Set number of connections shown in the UI.
const CChainParams & Params()
Return the currently selected parameters.
QToolButton * fontSmallerButton
static bool RPCParseCommandLine(interfaces::Node *node, std::string &strResult, const std::string &strCommand, bool fExecute, std::string *const pstrFilteredOut=nullptr, const WalletModel *wallet_model=nullptr)
Split shell command line into a list of arguments and optionally execute the command(s).
interfaces::Node & m_node
Interface to Bitcoin wallet from Qt view code.
auto Join(const C &container, const S &separator, UnaryOp unary_op)
Join all container items.
virtual std::vector< std::string > listRpcCommands()=0
List rpc commands.
~QtRPCTimerBase()=default
QString formatServicesStr(quint64 mask)
Format CNodeStats.nServices bitmask into a user-readable string.
void on_sldGraphRange_valueChanged(int value)
change the time range of the network traffic graph
void banSelectedNode(int bantime)
Ban a selected node on the Peers tab.
void setNumBlocks(int count, const QDateTime &blockDate, double nVerificationProgress, SyncType synctype)
Set number of blocks and last block date shown in the UI.
void updateAlerts(const QString &warnings)
Opaque base class for timers returned by NewTimerFunc.
const int INITIAL_TRAFFIC_GRAPH_MINS
QString TimeDurationField(std::chrono::seconds time_now, std::chrono::seconds time_at_event) const
Helper for the output of a time duration field.
const char fontSizeSettingsKey[]
bool LookupSubNet(const std::string &subnet_str, CSubNet &subnet_out)
Parse and resolve a specified subnet string into the appropriate internal representation.
RPCTimerBase * NewTimer(std::function< void()> &func, int64_t millis) override
Factory function for timers.
QString getDisplayName() const
void request(const QString &command, const WalletModel *wallet_model)
void mempoolSizeChanged(long count, size_t mempoolSizeInBytes)
const QSize FONT_RANGE(4, 40)
QLabel * peerConnectionType
static bool RPCExecuteCommandLine(interfaces::Node &node, std::string &strResult, const std::string &strCommand, std::string *const pstrFilteredOut=nullptr, const WalletModel *wallet_model=nullptr)
QLabel * peerAddrRateLimited
PeerTableSortProxy * peerTableSortProxy()
virtual bool disconnectById(NodeId id)=0
Disconnect node by id.
QComboBox * WalletSelector
void showEvent(QShowEvent *event) override
QCompleter * autoCompleter
void AddButtonShortcut(QAbstractButton *button, const QKeySequence &shortcut)
Connects an additional shortcut to a QAbstractButton.
Top-level interface for a bitcoin node (bitcoind process).
QLabel * peerHighBandwidth
void showBanTableContextMenu(const QPoint &point)
Show custom context menu on Bans tab.
void keyPressEvent(QKeyEvent *) override
void hideEvent(QHideEvent *event) override
virtual bool eventFilter(QObject *obj, QEvent *event) override
static std::vector< std::string > ToStrings(NetPermissionFlags flags)
QList< QModelIndex > getEntryData(const QAbstractItemView *view, int column)
Return a field of the currently selected entry as a QString.
QString formatFullVersion() const