66
77#include < qt/guiconstants.h>
88
9+ #include < chainparamsbase.h>
10+ #include < tinyformat.h>
11+
912#include < QApplication>
1013
1114static const struct {
1215 const char *networkId;
1316 const char *appName;
1417 const int iconColorHueShift;
1518 const int iconColorSaturationReduction;
16- const char *titleAddText;
1719} network_styles[] = {
18- {" main" , QAPP_APP_NAME_DEFAULT, 0 , 0 , " " },
19- {" test" , QAPP_APP_NAME_TESTNET, 70 , 30 , QT_TRANSLATE_NOOP ( " SplashScreen " , " [testnet] " ) },
20- {" regtest" , QAPP_APP_NAME_TESTNET, 160 , 30 , " [regtest] " }
20+ {" main" , QAPP_APP_NAME_DEFAULT, 0 , 0 },
21+ {" test" , QAPP_APP_NAME_TESTNET, 70 , 30 },
22+ {" regtest" , QAPP_APP_NAME_TESTNET, 160 , 30 }
2123};
2224static const unsigned network_styles_count = sizeof (network_styles)/sizeof (*network_styles);
2325
@@ -75,8 +77,9 @@ NetworkStyle::NetworkStyle(const QString &_appName, const int iconColorHueShift,
7577 trayAndWindowIcon = QIcon (pixmap.scaled (QSize (256 ,256 )));
7678}
7779
78- const NetworkStyle * NetworkStyle::instantiate (const QString & networkId)
80+ const NetworkStyle* NetworkStyle::instantiate (const std::string& networkId)
7981{
82+ std::string titleAddText = networkId == CBaseChainParams::MAIN ? " " : strprintf (" [%s]" , networkId);
8083 for (unsigned x=0 ; x<network_styles_count; ++x)
8184 {
8285 if (networkId == network_styles[x].networkId )
@@ -85,8 +88,8 @@ const NetworkStyle *NetworkStyle::instantiate(const QString &networkId)
8588 network_styles[x].appName ,
8689 network_styles[x].iconColorHueShift ,
8790 network_styles[x].iconColorSaturationReduction ,
88- network_styles[x]. titleAddText );
91+ titleAddText. c_str () );
8992 }
9093 }
91- return 0 ;
94+ return new NetworkStyle ( strprintf ( " %s-%s " , QAPP_APP_NAME_DEFAULT, networkId). c_str (), 250 , 30 , titleAddText. c_str ()) ;
9295}
0 commit comments