5#if defined(HAVE_CONFIG_H)
37#include <QAbstractButton>
38#include <QAbstractItemModel>
42#include <QLatin1String>
51#include <QStyledItemDelegate>
65 {
"cmd-request",
":/icons/tx_input"},
66 {
"cmd-reply",
":/icons/tx_output"},
67 {
"cmd-error",
":/icons/tx_output"},
68 {
"misc",
":/icons/tx_inout"},
75const QStringList historyFilter = QStringList()
79 <<
"signmessagewithprivkey"
80 <<
"signrawtransactionwithkey"
82 <<
"walletpassphrasechange"
99 void reply(
int category,
const QString &command);
115 timer.setSingleShot(
true);
116 connect(&
timer, &QTimer::timeout, [
this]{
func(); });
129 const char *
Name()
override {
return "Qt"; }
141 : QStyledItemDelegate(parent) {}
143 QString
displayText(
const QVariant& value,
const QLocale& locale)
const override
147 return value.toString() + QLatin1String(
" ");
151#include <qt/rpcconsole.moc>
175 std::vector< std::vector<std::string> > stack;
176 stack.push_back(std::vector<std::string>());
181 STATE_EATING_SPACES_IN_ARG,
182 STATE_EATING_SPACES_IN_BRACKETS,
187 STATE_ESCAPE_DOUBLEQUOTED,
188 STATE_COMMAND_EXECUTED,
189 STATE_COMMAND_EXECUTED_INNER
190 } state = STATE_EATING_SPACES;
193 unsigned nDepthInsideSensitive = 0;
194 size_t filter_begin_pos = 0, chpos;
195 std::vector<std::pair<size_t, size_t>> filter_ranges;
197 auto add_to_current_stack = [&](
const std::string& strArg) {
198 if (stack.back().empty() && (!nDepthInsideSensitive) && historyFilter.contains(QString::fromStdString(strArg), Qt::CaseInsensitive)) {
199 nDepthInsideSensitive = 1;
200 filter_begin_pos = chpos;
204 stack.
push_back(std::vector<std::string>());
206 stack.back().push_back(strArg);
209 auto close_out_params = [&]() {
210 if (nDepthInsideSensitive) {
211 if (!--nDepthInsideSensitive) {
213 filter_ranges.push_back(std::make_pair(filter_begin_pos, chpos));
214 filter_begin_pos = 0;
220 std::string strCommandTerminated = strCommand;
221 if (strCommandTerminated.back() !=
'\n')
222 strCommandTerminated +=
"\n";
223 for (chpos = 0; chpos < strCommandTerminated.size(); ++chpos)
225 char ch = strCommandTerminated[chpos];
228 case STATE_COMMAND_EXECUTED_INNER:
229 case STATE_COMMAND_EXECUTED:
231 bool breakParsing =
true;
234 case '[': curarg.clear(); state = STATE_COMMAND_EXECUTED_INNER;
break;
236 if (state == STATE_COMMAND_EXECUTED_INNER)
244 if (curarg.size() && fExecute)
250 const auto parsed{ToIntegral<size_t>(curarg)};
252 throw std::runtime_error(
"Invalid result query");
254 subelement = lastResult[parsed.value()];
259 throw std::runtime_error(
"Invalid result query");
260 lastResult = subelement;
263 state = STATE_COMMAND_EXECUTED;
267 breakParsing =
false;
273 if (lastResult.
isStr())
276 curarg = lastResult.
write(2);
282 add_to_current_stack(curarg);
288 state = STATE_EATING_SPACES;
295 case STATE_EATING_SPACES_IN_ARG:
296 case STATE_EATING_SPACES_IN_BRACKETS:
297 case STATE_EATING_SPACES:
300 case '"': state = STATE_DOUBLEQUOTED;
break;
301 case '\'': state = STATE_SINGLEQUOTED;
break;
302 case '\\': state = STATE_ESCAPE_OUTER;
break;
303 case '(':
case ')':
case '\n':
304 if (state == STATE_EATING_SPACES_IN_ARG)
305 throw std::runtime_error(
"Invalid Syntax");
306 if (state == STATE_ARGUMENT)
308 if (ch ==
'(' && stack.size() && stack.back().size() > 0)
310 if (nDepthInsideSensitive) {
311 ++nDepthInsideSensitive;
313 stack.push_back(std::vector<std::string>());
318 throw std::runtime_error(
"Invalid Syntax");
320 add_to_current_stack(curarg);
322 state = STATE_EATING_SPACES_IN_BRACKETS;
324 if ((ch ==
')' || ch ==
'\n') && stack.size() > 0)
329 UniValue params =
RPCConvertValues(stack.back()[0], std::vector<std::string>(stack.back().begin() + 1, stack.back().end()));
330 std::string method = stack.back()[0];
334 QByteArray encodedName = QUrl::toPercentEncoding(wallet_model->
getWalletName());
335 uri =
"/wallet/"+std::string(encodedName.constData(), encodedName.length());
339 lastResult =
node->executeRpc(method, params, uri);
342 state = STATE_COMMAND_EXECUTED;
346 case ' ':
case ',':
case '\t':
347 if(state == STATE_EATING_SPACES_IN_ARG && curarg.empty() && ch ==
',')
348 throw std::runtime_error(
"Invalid Syntax");
350 else if(state == STATE_ARGUMENT)
352 add_to_current_stack(curarg);
355 if ((state == STATE_EATING_SPACES_IN_BRACKETS || state == STATE_ARGUMENT) && ch ==
',')
357 state = STATE_EATING_SPACES_IN_ARG;
360 state = STATE_EATING_SPACES;
362 default: curarg += ch; state = STATE_ARGUMENT;
365 case STATE_SINGLEQUOTED:
368 case '\'': state = STATE_ARGUMENT;
break;
369 default: curarg += ch;
372 case STATE_DOUBLEQUOTED:
375 case '"': state = STATE_ARGUMENT;
break;
376 case '\\': state = STATE_ESCAPE_DOUBLEQUOTED;
break;
377 default: curarg += ch;
380 case STATE_ESCAPE_OUTER:
381 curarg += ch; state = STATE_ARGUMENT;
383 case STATE_ESCAPE_DOUBLEQUOTED:
384 if(ch !=
'"' && ch !=
'\\') curarg +=
'\\';
385 curarg += ch; state = STATE_DOUBLEQUOTED;
389 if (pstrFilteredOut) {
390 if (STATE_COMMAND_EXECUTED == state) {
394 *pstrFilteredOut = strCommand;
395 for (
auto i = filter_ranges.rbegin(); i != filter_ranges.rend(); ++i) {
396 pstrFilteredOut->replace(i->first, i->second - i->first,
"(…)");
401 case STATE_COMMAND_EXECUTED:
402 if (lastResult.
isStr())
403 strResult = lastResult.
get_str();
405 strResult = lastResult.
write(2);
408 case STATE_EATING_SPACES:
420 std::string executableCommand = command.toStdString() +
"\n";
423 if(executableCommand ==
"help-console\n") {
425 "This console accepts RPC commands using the standard syntax.\n"
426 " example: getblockhash 0\n\n"
428 "This console can also accept RPC commands using the parenthesized syntax.\n"
429 " example: getblockhash(0)\n\n"
431 "Commands may be nested when specified with the parenthesized syntax.\n"
432 " example: getblock(getblockhash(0) 1)\n\n"
434 "A space or a comma can be used to delimit arguments for either syntax.\n"
435 " example: getblockhash 0\n"
436 " getblockhash,0\n\n"
438 "Named results can be queried with a non-quoted key string in brackets using the parenthesized syntax.\n"
439 " example: getblock(getblockhash(0) 1)[tx]\n\n"
441 "Results without keys can be queried with an integer in brackets using the parenthesized syntax.\n"
442 " example: getblock(getblockhash(0),1)[tx][0]\n\n")));
460 catch (
const std::runtime_error&)
465 catch (
const std::exception& e)
475 platformStyle(_platformStyle)
482 if (!restoreGeometry(settings.value(
"RPCConsoleWindowGeometry").toByteArray())) {
484 move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
486 ui->
splitter->restoreState(settings.value(
"RPCConsoleWindowPeersTabSplitterSizes").toByteArray());
491 ui->
splitter->restoreState(settings.value(
"RPCConsoleWidgetPeersTabSplitterSizes").toByteArray());
497 constexpr QChar nonbreaking_hyphen(8209);
500 tr(
"Inbound: initiated by peer"),
504 tr(
"Outbound Full Relay: default"),
507 tr(
"Outbound Block Relay: does not relay transactions or addresses"),
512 tr(
"Outbound Manual: added using RPC %1 or %2/%3 configuration options")
514 .arg(QString(nonbreaking_hyphen) +
"addnode")
515 .arg(QString(nonbreaking_hyphen) +
"connect"),
518 tr(
"Outbound Feeler: short-lived, for testing addresses"),
521 tr(
"Outbound Address Fetch: short-lived, for soliciting addresses")};
524 const QString hb_list{
"<ul><li>\""
525 +
ts.
to +
"\" – " + tr(
"we selected the peer for high bandwidth relay") +
"</li><li>\""
526 +
ts.
from +
"\" – " + tr(
"the peer selected us for high bandwidth relay") +
"</li><li>\""
527 +
ts.
no +
"\" – " + tr(
"no high bandwidth relay selected") +
"</li></ul>"};
529 ui->
dataDir->setToolTip(
ui->
dataDir->toolTip().arg(QString(nonbreaking_hyphen) +
"datadir"));
557 connect(
ui->
clearButton, &QAbstractButton::clicked, [
this] { clear(); });
587 settings.setValue(
"RPCConsoleWindowGeometry", saveGeometry());
588 settings.setValue(
"RPCConsoleWindowPeersTabSplitterSizes",
ui->
splitter->saveState());
593 settings.setValue(
"RPCConsoleWidgetPeersTabSplitterSizes",
ui->
splitter->saveState());
606 if(event->type() == QEvent::KeyPress)
608 QKeyEvent *keyevt =
static_cast<QKeyEvent*
>(event);
609 int key = keyevt->key();
610 Qt::KeyboardModifiers mod = keyevt->modifiers();
616 case Qt::Key_PageDown:
627 QApplication::postEvent(
ui->
lineEdit,
new QKeyEvent(*keyevt));
636 (!mod && !keyevt->text().isEmpty() && key != Qt::Key_Tab) ||
637 ((mod & Qt::ControlModifier) && key == Qt::Key_V) ||
638 ((mod & Qt::ShiftModifier) && key == Qt::Key_Insert)))
641 QApplication::postEvent(
ui->
lineEdit,
new QKeyEvent(*keyevt));
646 return QWidget::eventFilter(obj, event);
653 bool wallet_enabled{
false};
657 if (model && !wallet_enabled) {
669 setNumBlocks(bestblock_height, QDateTime::fromSecsSinceEpoch(bestblock_date), verification_progress,
false);
684 ui->
peerWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
685 ui->
peerWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
686 ui->
peerWidget->setContextMenuPolicy(Qt::CustomContextMenu);
693 ui->
peerWidget->horizontalHeader()->setStretchLastSection(
true);
712 connect(model->
getPeerTableModel(), &QAbstractItemModel::dataChanged, [
this] { updateDetailWidget(); });
717 ui->
banlistWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
718 ui->
banlistWidget->setSelectionMode(QAbstractItemView::SingleSelection);
754 QStringList wordList;
756 for (
size_t i = 0; i < commandList.size(); ++i)
758 wordList << commandList[i].c_str();
759 wordList << (
"help " + commandList[i]).c_str();
762 wordList <<
"help-console";
765 autoCompleter->setModelSorting(QCompleter::CaseSensitivelySortedModel);
813 default:
return "misc";
839 str.replace(QString(
"font-size:%1pt").arg(
consoleFontSize), QString(
"font-size:%1pt").arg(newSize));
863 QTextDocument::ImageResource,
873 "td.time { color: #808080; font-size: %2; padding-top: 3px; } "
874 "td.message { font-family: %1; font-size: %2; white-space:pre-wrap; } "
875 "td.cmd-request { color: #006060; } "
876 "td.cmd-error { color: red; } "
877 ".secwarning { color: red; }"
878 "b { color: #006060; } "
882 static const QString welcome_message =
886 tr(
"Welcome to the %1 RPC console.\n"
887 "Use up and down arrows to navigate history, and %2 to clear screen.\n"
888 "Use %3 and %4 to increase or decrease the font size.\n"
889 "Type %5 for an overview of available commands.\n"
890 "For more information on using this console, type %6.\n"
892 "%7WARNING: Scammers have been active, telling users to type"
893 " commands here, stealing their wallet contents. Do not use this console"
894 " without fully understanding the ramifications of a command.%8")
896 "<b>" +
ui->
clearButton->shortcut().toString(QKeySequence::NativeText) +
"</b>",
900 "<b>help-console</b>",
901 "<span class=\"secwarning\">",
909 if(windowType() != Qt::Widget && event->key() == Qt::Key_Escape)
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")) {
1046 cmd = QString::fromStdString(strFilteredCmd);
1087 executor->moveToThread(&
thread);
1090 connect(executor, &
RPCExecutor::reply,
this, [
this](
int category,
const QString& command) {
1102 connect(&
thread, &QThread::finished, executor, &RPCExecutor::deleteLater);
1107 QTimer::singleShot(0, executor, []() {
1127 scrollbar->setValue(scrollbar->maximum());
1132 const int multiplier = 5;
1133 int mins = value * multiplier;
1154 ui->
peerHeading->setText(tr(
"Select a peer to view detailed information."));
1159 QString peerAddrDetails(QString::fromStdString(stats->nodeStats.m_addr_name) +
" ");
1160 peerAddrDetails += tr(
"(peer: %1)").arg(QString::number(stats->nodeStats.nodeid));
1161 if (!stats->nodeStats.addrLocal.empty())
1162 peerAddrDetails +=
"<br />" + tr(
"via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal));
1166 QString bip152_hb_settings;
1167 if (stats->nodeStats.m_bip152_highbandwidth_to) bip152_hb_settings =
ts.
to;
1168 if (stats->nodeStats.m_bip152_highbandwidth_from) bip152_hb_settings += (bip152_hb_settings.isEmpty() ?
ts.
from : QLatin1Char(
'/') +
ts.
from);
1169 if (bip152_hb_settings.isEmpty()) bip152_hb_settings =
ts.
no;
1182 ui->
peerVersion->setText(QString::number(stats->nodeStats.nVersion));
1183 ui->
peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer));
1189 QStringList permissions;
1191 permissions.append(QString::fromStdString(permission));
1195 ui->
peerMappedAS->setText(stats->nodeStats.m_mapped_as != 0 ? QString::number(stats->nodeStats.m_mapped_as) :
ts.
na);
1199 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));
1221 QWidget::resizeEvent(event);
1226 QWidget::showEvent(event);
1242 QWidget::hideEvent(event);
1254 if (index.isValid())
1261 if (index.isValid())
1269 for(
int i = 0; i < nodes.count(); i++)
1272 NodeId id = nodes.at(i).data().toLongLong();
1288 m_node.
ban(stats->nodeStats.addr, bantime);
1303 for(
int i = 0; i < nodes.count(); i++)
1306 QString strNode = nodes.at(i).data().toString();
const CChainParams & Params()
Return the currently selected parameters.
Model for Bitcoin network client.
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
QString blocksDir() const
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
PeerTableModel * getPeerTableModel()
PeerTableSortProxy * peerTableSortProxy()
void numConnectionsChanged(int count)
void numBlocksChanged(int count, const QDateTime &blockDate, double nVerificationProgress, bool header, SynchronizationState sync_state)
QString formatClientStartupTime() const
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
BanTableModel * getBanTableModel()
void alertsChanged(const QString &warnings)
QString formatFullVersion() const
QString formatSubVersion() const
void mempoolSizeChanged(long count, size_t mempoolSizeInBytes)
void networkActiveChanged(bool networkActive)
interfaces::Node & node() const
static std::vector< std::string > ToStrings(NetPermissionFlags flags)
QString displayText(const QVariant &value, const QLocale &locale) const override
PeerIdViewDelegate(QObject *parent=nullptr)
Class for handling RPC timers (used for e.g.
std::function< void()> func
QtRPCTimerBase(std::function< void()> &_func, int64_t millis)
const char * Name() override
Implementation name.
RPCTimerBase * NewTimer(std::function< void()> &func, int64_t millis) override
Factory function for timers.
Local Bitcoin RPC console.
QMenu * peersTableContextMenu
RPCConsole(interfaces::Node &node, const PlatformStyle *platformStyle, QWidget *parent)
struct RPCConsole::TranslatedStrings ts
void cmdRequest(const QString &command, const WalletModel *wallet_model)
void browseHistory(int offset)
Go forward or back in history.
QByteArray m_banlist_widget_header_state
RPCTimerInterface * rpcTimerInterface
void on_lineEdit_returnPressed()
void message(int category, const QString &msg)
Append the message to the message widget.
void setFontSize(int newSize)
void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut)
update traffic statistics
void setTrafficGraphRange(int mins)
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).
const PlatformStyle *const platformStyle
void updateDetailWidget()
show detailed information on ui about selected node
void showEvent(QShowEvent *event) override
void resizeEvent(QResizeEvent *event) override
static bool RPCExecuteCommandLine(interfaces::Node &node, std::string &strResult, const std::string &strCommand, std::string *const pstrFilteredOut=nullptr, const WalletModel *wallet_model=nullptr)
QString tabTitle(TabTypes tab_type) const
void updateNetworkState()
Update UI with latest network info from model.
void clear(bool keep_prompt=false)
void disconnectSelectedNode()
Disconnect a selected node on the Peers tab.
@ SUBVERSION_COLUMN_WIDTH
QCompleter * autoCompleter
void setMempoolSize(long numberOfTxs, size_t dynUsage)
Set size (number of transactions and memory usage) of the mempool in the UI.
void setNumBlocks(int count, const QDateTime &blockDate, double nVerificationProgress, bool headers)
Set number of blocks and last block date shown in the UI.
void hideEvent(QHideEvent *event) override
QKeySequence tabShortcut(TabTypes tab_type) const
void showPeersTableContextMenu(const QPoint &point)
Show custom context menu on Peers tab.
QList< NodeId > cachedNodeids
interfaces::Node & m_node
void unbanSelectedNode()
Unban a selected node on the Bans tab.
void updateAlerts(const QString &warnings)
void clearSelectedNode()
clear the selected node
void on_sldGraphRange_valueChanged(int value)
change the time range of the network traffic graph
void setNumConnections(int count)
Set number of connections shown in the UI.
ClientModel * clientModel
void banSelectedNode(int bantime)
Ban a selected node on the Peers tab.
void scrollToEnd()
Scroll console view to end.
void keyPressEvent(QKeyEvent *) override
void on_tabWidget_currentChanged(int index)
void setNetworkActive(bool networkActive)
Set network state shown in the UI.
QString cmdBeforeBrowsing
void addWallet(WalletModel *const walletModel)
virtual bool eventFilter(QObject *obj, QEvent *event) override
void on_openDebugLogfileButton_clicked()
open the debug.log from the current datadir
void removeWallet(WalletModel *const walletModel)
void showBanTableContextMenu(const QPoint &point)
Show custom context menu on Bans tab.
void setClientModel(ClientModel *model=nullptr, int bestblock_height=0, int64_t bestblock_date=0, double verification_progress=0.0)
void setTabFocus(enum TabTypes tabType)
set which tab has the focus (is visible)
QByteArray m_peer_widget_header_state
void changeEvent(QEvent *e) override
WalletModel * m_last_wallet_model
void showOrHideBanTableIfRequired()
Hides ban table if no bans are present.
QString TimeDurationField(uint64_t time_now, uint64_t time_at_event) const
Helper for the output of a time duration field.
QMenu * banTableContextMenu
void reply(int category, const QString &command)
RPCExecutor(interfaces::Node &node)
interfaces::Node & m_node
void request(const QString &command, const WalletModel *wallet_model)
Opaque base class for timers returned by NewTimerFunc.
QLabel * peerConnectionTypeLabel
QWidget * peersTabRightPanel
QPushButton * openDebugLogfileButton
QToolButton * fontBiggerButton
TrafficGraphWidget * trafficGraph
QTableView * banlistWidget
QLabel * peerHighBandwidthLabel
QComboBox * WalletSelector
QLabel * numberOfConnections
QLabel * WalletSelectorLabel
QPushButton * btnClearTrafficGraph
QLabel * peerCommonHeight
QLabel * peerHighBandwidth
QToolButton * fontSmallerButton
QLabel * peerConnectionType
void setupUi(QWidget *RPCConsole)
QToolButton * clearButton
QLabel * mempoolNumberTxs
QTextEdit * messagesWidget
const std::string & get_str() const
std::string write(unsigned int prettyIndent=0, unsigned int indentLevel=0) const
bool push_back(const UniValue &val)
Interface to Bitcoin wallet from Qt view code.
QString getDisplayName() const
static bool isWalletEnabled()
QString getWalletName() const
Top-level interface for a bitcoin node (bitcoind process).
virtual void rpcSetTimerInterfaceIfUnset(RPCTimerInterface *iface)=0
Set RPC timer interface if unset.
virtual bool disconnectById(NodeId id)=0
Disconnect node by id.
virtual bool ban(const CNetAddr &net_addr, int64_t ban_time_offset)=0
Ban node.
virtual std::vector< std::string > listRpcCommands()=0
List rpc commands.
virtual void rpcUnsetTimerInterface(RPCTimerInterface *iface)=0
Unset RPC timer interface.
virtual bool getNetworkActive()=0
Get network active.
virtual bool unban(const CSubNet &ip)=0
Unban node.
virtual bool disconnectByAddress(const CNetAddr &net_addr)=0
Disconnect node by address.
UniValue RPCConvertValues(const std::string &strMethod, const std::vector< std::string > &strParams)
Convert positional arguments to command-specific RPC representation.
QString NetworkToQString(Network net)
Convert enum Network to QString.
QString HtmlEscape(const QString &str, bool fMultiLine)
QList< QModelIndex > getEntryData(const QAbstractItemView *view, int column)
Return a field of the currently selected entry as a QString.
QFont fixedPitchFont(bool use_embedded_font)
QString formatBytes(uint64_t bytes)
void AddButtonShortcut(QAbstractButton *button, const QKeySequence &shortcut)
Connects an additional shortcut to a QAbstractButton.
void handleCloseWindowShortcut(QWidget *w)
void copyEntryData(const QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
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.
QString formatDurationStr(int secs)
Convert seconds into a QString with days, hours, mins, secs.
QString formatTimeOffset(int64_t nTimeOffset)
Format a CNodeCombinedStats.nTimeOffset into a user-readable string.
QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction)
Convert enum ConnectionType to QString.
QString formatServicesStr(quint64 mask)
Format CNodeStats.nServices bitmask into a user-readable string.
void ThreadRename(std::string &&)
Rename a thread both in terms of an internal (in-memory) name as well as its system thread name.
bool LookupSubNet(const std::string &strSubnet, CSubNet &ret, DNSLookupFn dns_lookup_function)
Parse and resolve a specified subnet string into the appropriate internal representation.
const std::vector< std::string > CONNECTION_TYPE_DOC
const int INITIAL_TRAFFIC_GRAPH_MINS
const struct @8 ICON_MAPPING[]
const QSize FONT_RANGE(4, 40)
const int CONSOLE_HISTORY
static QString categoryClass(int category)
const char fontSizeSettingsKey[]
auto Join(const std::vector< T > &list, const BaseType &separator, UnaryOp unary_op) -> decltype(unary_op(list.at(0)))
Join a list of items.
int64_t GetTimeSeconds()
Returns the system time (not mockable)
const UniValue & find_value(const UniValue &obj, const std::string &name)