| 377 | } |
| 378 | |
| 379 | void BitcoinApplication::initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info) |
| 380 | { |
| 381 | qDebug() << __func__ << ": Initialization result: " << success; |
| 382 | |
| 383 | if (!success || m_node->shutdownRequested()) { |
| 384 | requestShutdown(); |
| 385 | return; |
| 386 | } |
| 387 | |
| 388 | delete m_splash; |
| 389 | m_splash = nullptr; |
| 390 | |
| 391 | // Log this only after AppInitMain finishes, as then logging setup is guaranteed complete |
| 392 | qInfo() << "Platform customization:" << platformStyle->getName(); |
| 393 | clientModel = new ClientModel(node(), optionsModel); |
| 394 | window->setClientModel(clientModel, &tip_info); |
| 395 | |
| 396 | // If '-min' option passed, start window minimized (iconified) or minimized to tray |
| 397 | bool start_minimized = gArgs.GetBoolArg("-min", false); |
| 398 | #ifdef ENABLE_WALLET |
| 399 | if (WalletModel::isWalletEnabled()) { |
| 400 | m_wallet_controller = new WalletController(*clientModel, platformStyle, this); |
| 401 | window->setWalletController(m_wallet_controller, /*show_loading_minimized=*/start_minimized); |
| 402 | if (paymentServer) { |
| 403 | paymentServer->setOptionsModel(optionsModel); |
| 404 | } |
| 405 | } |
| 406 | #endif // ENABLE_WALLET |
| 407 | |
| 408 | // Show or minimize window |
| 409 | if (!start_minimized) { |
| 410 | window->show(); |
| 411 | } else if (clientModel->getOptionsModel()->getMinimizeToTray() && window->hasTrayIcon()) { |
| 412 | // do nothing as the window is managed by the tray icon |
| 413 | } else { |
| 414 | window->showMinimized(); |
| 415 | } |
| 416 | Q_EMIT windowShown(window); |
| 417 | |
| 418 | #ifdef ENABLE_WALLET |
| 419 | // Now that initialization/startup is done, process any command-line |
| 420 | // bitcoin: URIs or payment requests: |
| 421 | if (paymentServer) { |
| 422 | connect(paymentServer, &PaymentServer::receivedPaymentRequest, window, &BitcoinGUI::handlePaymentRequest); |
| 423 | connect(window, &BitcoinGUI::receivedURI, paymentServer, &PaymentServer::handleURIOrFile); |
| 424 | connect(paymentServer, &PaymentServer::message, [this](const QString& title, const QString& message, unsigned int style) { |
| 425 | window->message(title, message, style); |
| 426 | }); |
| 427 | QTimer::singleShot(100ms, paymentServer, &PaymentServer::uiReady); |
| 428 | } |
| 429 | #endif |
| 430 | pollShutdownTimer->start(SHUTDOWN_POLLING_DELAY); |
| 431 | } |
| 432 | |
| 433 | void BitcoinApplication::handleRunawayException(const QString &message) |
| 434 | { |
nothing calls this directly
no test coverage detected