MCPcopy Create free account
hub / github.com/ElementsProject/elements / RPCConsole

Method RPCConsole

src/qt/rpcconsole.cpp:474–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformStyle, QWidget *parent) :
475 QWidget(parent),
476 m_node(node),
477 ui(new Ui::RPCConsole),
478 platformStyle(_platformStyle)
479{
480 ui->setupUi(this);
481 QSettings settings;
482#ifdef ENABLE_WALLET
483 if (WalletModel::isWalletEnabled()) {
484 // RPCConsole widget is a window.
485 if (!restoreGeometry(settings.value("RPCConsoleWindowGeometry").toByteArray())) {
486 // Restore failed (perhaps missing setting), center the window
487 move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
488 }
489 ui->splitter->restoreState(settings.value("RPCConsoleWindowPeersTabSplitterSizes").toByteArray());
490 } else
491#endif // ENABLE_WALLET
492 {
493 // RPCConsole is a child widget.
494 ui->splitter->restoreState(settings.value("RPCConsoleWidgetPeersTabSplitterSizes").toByteArray());
495 }
496
497 m_peer_widget_header_state = settings.value("PeersTabPeerHeaderState").toByteArray();
498 m_banlist_widget_header_state = settings.value("PeersTabBanlistHeaderState").toByteArray();
499
500 constexpr QChar nonbreaking_hyphen(8209);
501 const std::vector<QString> CONNECTION_TYPE_DOC{
502 //: Explanatory text for an inbound peer connection.
503 tr("Inbound: initiated by peer"),
504 /*: Explanatory text for an outbound peer connection that
505 relays all network information. This is the default behavior for
506 outbound connections. */
507 tr("Outbound Full Relay: default"),
508 /*: Explanatory text for an outbound peer connection that relays
509 network information about blocks and not transactions or addresses. */
510 tr("Outbound Block Relay: does not relay transactions or addresses"),
511 /*: Explanatory text for an outbound peer connection that was
512 established manually through one of several methods. The numbered
513 arguments are stand-ins for the methods available to establish
514 manual connections. */
515 tr("Outbound Manual: added using RPC %1 or %2/%3 configuration options")
516 .arg("addnode")
517 .arg(QString(nonbreaking_hyphen) + "addnode")
518 .arg(QString(nonbreaking_hyphen) + "connect"),
519 /*: Explanatory text for a short-lived outbound peer connection that
520 is used to test the aliveness of known addresses. */
521 tr("Outbound Feeler: short-lived, for testing addresses"),
522 /*: Explanatory text for a short-lived outbound peer connection that is used
523 to request addresses from a peer. */
524 tr("Outbound Address Fetch: short-lived, for soliciting addresses")};
525 const QString list{"<ul><li>" + Join(CONNECTION_TYPE_DOC, QString("</li><li>")) + "</li></ul>"};
526 ui->peerConnectionTypeLabel->setToolTip(ui->peerConnectionTypeLabel->toolTip().arg(list));
527 const QString hb_list{"<ul><li>\""
528 + ts.to + "\"" + tr("we selected the peer for high bandwidth relay") + "</li><li>\""
529 + ts.from + "\"" + tr("the peer selected us for high bandwidth relay") + "</li><li>\""
530 + ts.no + "\"" + tr("no high bandwidth relay selected") + "</li></ul>"};
531 ui->peerHighBandwidthLabel->setToolTip(ui->peerHighBandwidthLabel->toolTip().arg(hb_list));

Callers

nothing calls this directly

Calls 9

JoinFunction · 0.85
AddButtonShortcutFunction · 0.85
clearFunction · 0.85
QFontClass · 0.85
getImagesOnButtonsMethod · 0.80
SingleColorIconMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected