| 460 | } |
| 461 | |
| 462 | void BitcoinApplication::initializeResult(bool success) |
| 463 | { |
| 464 | qDebug() << __func__ << ": Initialization result: " << success; |
| 465 | // Set exit result. |
| 466 | returnValue = success ? EXIT_SUCCESS : EXIT_FAILURE; |
| 467 | if(success) |
| 468 | { |
| 469 | // Log this only after AppInitMain finishes, as then logging setup is guaranteed complete |
| 470 | qWarning() << "Platform customization:" << platformStyle->getName(); |
| 471 | #ifdef ENABLE_WALLET |
| 472 | PaymentServer::LoadRootCAs(); |
| 473 | paymentServer->setOptionsModel(optionsModel); |
| 474 | #endif |
| 475 | |
| 476 | clientModel = new ClientModel(m_node, optionsModel); |
| 477 | window->setClientModel(clientModel); |
| 478 | |
| 479 | #ifdef ENABLE_WALLET |
| 480 | m_handler_load_wallet = m_node.handleLoadWallet([this](std::unique_ptr<interfaces::Wallet> wallet) { |
| 481 | WalletModel* wallet_model = new WalletModel(std::move(wallet), m_node, platformStyle, optionsModel, nullptr); |
| 482 | // Fix wallet model thread affinity. |
| 483 | wallet_model->moveToThread(thread()); |
| 484 | QMetaObject::invokeMethod(this, "addWallet", Qt::QueuedConnection, Q_ARG(WalletModel*, wallet_model)); |
| 485 | }); |
| 486 | |
| 487 | for (auto& wallet : m_node.getWallets()) { |
| 488 | addWallet(new WalletModel(std::move(wallet), m_node, platformStyle, optionsModel)); |
| 489 | } |
| 490 | #endif |
| 491 | |
| 492 | // If -min option passed, start window minimized. |
| 493 | if(gArgs.GetBoolArg("-min", false)) |
| 494 | { |
| 495 | window->showMinimized(); |
| 496 | } |
| 497 | else |
| 498 | { |
| 499 | window->show(); |
| 500 | } |
| 501 | Q_EMIT splashFinished(window); |
| 502 | |
| 503 | #ifdef ENABLE_WALLET |
| 504 | // Now that initialization/startup is done, process any command-line |
| 505 | // bitcoin: URIs or payment requests: |
| 506 | connect(paymentServer, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), |
| 507 | window, SLOT(handlePaymentRequest(SendCoinsRecipient))); |
| 508 | connect(window, SIGNAL(receivedURI(QString)), |
| 509 | paymentServer, SLOT(handleURIOrFile(QString))); |
| 510 | connect(paymentServer, SIGNAL(message(QString,QString,unsigned int)), |
| 511 | window, SLOT(message(QString,QString,unsigned int))); |
| 512 | QTimer::singleShot(100, paymentServer, SLOT(uiReady())); |
| 513 | #endif |
| 514 | pollShutdownTimer->start(200); |
| 515 | } else { |
| 516 | Q_EMIT splashFinished(window); // Make sure splash screen doesn't stick around during shutdown |
| 517 | quit(); // Exit first main loop invocation |
| 518 | } |
| 519 | } |
nothing calls this directly
no test coverage detected