| 367 | } |
| 368 | |
| 369 | void LaunchController::readyForLaunch() |
| 370 | { |
| 371 | if (!m_profiler) { |
| 372 | m_launcher->proceed(); |
| 373 | return; |
| 374 | } |
| 375 | |
| 376 | QString error; |
| 377 | if (!m_profiler->check(&error)) { |
| 378 | m_launcher->abort(); |
| 379 | emitFailed("Profiler startup failed!"); |
| 380 | QMessageBox::critical(m_parentWidget, tr("Error!"), tr("Profiler check for %1 failed: %2").arg(m_profiler->name(), error)); |
| 381 | return; |
| 382 | } |
| 383 | BaseProfiler* profilerInstance = m_profiler->createProfiler(m_launcher->instance(), this); |
| 384 | |
| 385 | connect(profilerInstance, &BaseProfiler::readyToLaunch, [this](const QString& message) { |
| 386 | QMessageBox msg(m_parentWidget); |
| 387 | msg.setText(tr("The game launch is delayed until you press the " |
| 388 | "button. This is the right time to setup the profiler, as the " |
| 389 | "profiler server is running now.\n\n%1") |
| 390 | .arg(message)); |
| 391 | msg.setWindowTitle(tr("Waiting.")); |
| 392 | msg.setIcon(QMessageBox::Information); |
| 393 | msg.addButton(tr("&Launch"), QMessageBox::AcceptRole); |
| 394 | msg.exec(); |
| 395 | m_launcher->proceed(); |
| 396 | }); |
| 397 | connect(profilerInstance, &BaseProfiler::abortLaunch, [this](const QString& message) { |
| 398 | QMessageBox msg; |
| 399 | msg.setText(tr("Couldn't start the profiler: %1").arg(message)); |
| 400 | msg.setWindowTitle(tr("Error")); |
| 401 | msg.setIcon(QMessageBox::Critical); |
| 402 | msg.addButton(QMessageBox::Ok); |
| 403 | msg.setModal(true); |
| 404 | msg.exec(); |
| 405 | m_launcher->abort(); |
| 406 | emitFailed("Profiler startup failed!"); |
| 407 | }); |
| 408 | profilerInstance->beginProfiling(m_launcher); |
| 409 | } |
| 410 | |
| 411 | void LaunchController::onSucceeded() |
| 412 | { |
nothing calls this directly
no test coverage detected