Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoin.cpp
Show First 20 Lines • Show All 649 Lines • ▼ Show 20 Lines | #endif | ||||
/// 7. Determine network (and switch to network specific options) | /// 7. Determine network (and switch to network specific options) | ||||
// - Do not call Params() before this step. | // - Do not call Params() before this step. | ||||
// - Do this after parsing the configuration file, as the network can be | // - Do this after parsing the configuration file, as the network can be | ||||
// switched there. | // switched there. | ||||
// - QSettings() will use the new application name after this, resulting in | // - QSettings() will use the new application name after this, resulting in | ||||
// network-specific settings. | // network-specific settings. | ||||
// - Needs to be done before createOptionsModel. | // - Needs to be done before createOptionsModel. | ||||
// Check for -testnet or -regtest parameter (Params() calls are only valid | // Check for -chain, -testnet or -regtest parameter (Params() calls are only | ||||
// after this clause) | // valid after this clause) | ||||
try { | try { | ||||
node->selectParams(gArgs.GetChainName()); | node->selectParams(gArgs.GetChainName()); | ||||
} catch (std::exception &e) { | } catch (std::exception &e) { | ||||
node->initError(strprintf("%s\n", e.what())); | node->initError(strprintf("%s\n", e.what())); | ||||
QMessageBox::critical(nullptr, PACKAGE_NAME, | QMessageBox::critical(nullptr, PACKAGE_NAME, | ||||
QObject::tr("Error: %1").arg(e.what())); | QObject::tr("Error: %1").arg(e.what())); | ||||
return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
} | } | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
// Parse URIs on command line -- this can affect Params() | // Parse URIs on command line -- this can affect Params() | ||||
PaymentServer::ipcParseCommandLine(*node, argc, argv); | PaymentServer::ipcParseCommandLine(*node, argc, argv); | ||||
#endif | #endif | ||||
QScopedPointer<const NetworkStyle> networkStyle(NetworkStyle::instantiate( | QScopedPointer<const NetworkStyle> networkStyle( | ||||
QString::fromStdString(Params().NetworkIDString()))); | NetworkStyle::instantiate(Params().NetworkIDString())); | ||||
assert(!networkStyle.isNull()); | assert(!networkStyle.isNull()); | ||||
// Allow for separate UI settings for testnets | // Allow for separate UI settings for testnets | ||||
QApplication::setApplicationName(networkStyle->getAppName()); | QApplication::setApplicationName(networkStyle->getAppName()); | ||||
// Re-initialize translations after changing application name (language in | // Re-initialize translations after changing application name (language in | ||||
// network-specific settings can be different) | // network-specific settings can be different) | ||||
initTranslations(qtTranslatorBase, qtTranslator, translatorBase, | initTranslations(qtTranslatorBase, qtTranslator, translatorBase, | ||||
translator); | translator); | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |