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

Method updateNetworkState

src/qt/bitcoingui.cpp:910–941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

908#endif // ENABLE_WALLET
909
910void BitcoinGUI::updateNetworkState()
911{
912 int count = clientModel->getNumConnections();
913 QString icon;
914 switch(count)
915 {
916 case 0: icon = ":/icons/connect_0"; break;
917 case 1: case 2: case 3: icon = ":/icons/connect_1"; break;
918 case 4: case 5: case 6: icon = ":/icons/connect_2"; break;
919 case 7: case 8: case 9: icon = ":/icons/connect_3"; break;
920 default: icon = ":/icons/connect_4"; break;
921 }
922
923 QString tooltip;
924
925 if (m_node.getNetworkActive()) {
926 //: A substring of the tooltip.
927 tooltip = tr("%n active connection(s) to %1 network", "", count).arg("Liquid");
928 } else {
929 //: A substring of the tooltip.
930 tooltip = tr("Network activity disabled.");
931 icon = ":/icons/network_disabled";
932 }
933
934 // Don't word-wrap this (fixed-width) tooltip
935 tooltip = QLatin1String("<nobr>") + tooltip + QLatin1String("<br>") +
936 //: A substring of the tooltip. "More actions" are available via the context menu.
937 tr("Click for more actions.") + QLatin1String("</nobr>");
938 connectionsControl->setToolTip(tooltip);
939
940 connectionsControl->setThemedPixmap(icon, STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE);
941}
942
943void BitcoinGUI::setNumConnections(int count)
944{

Callers

nothing calls this directly

Calls 3

getNumConnectionsMethod · 0.80
getNetworkActiveMethod · 0.80
setThemedPixmapMethod · 0.80

Tested by

no test coverage detected