| 298 | } |
| 299 | |
| 300 | void LaunchController::readyForLaunch() |
| 301 | { |
| 302 | if (!m_profiler) |
| 303 | { |
| 304 | m_launcher->proceed(); |
| 305 | return; |
| 306 | } |
| 307 | |
| 308 | QString error; |
| 309 | if (!m_profiler->check(&error)) |
| 310 | { |
| 311 | m_launcher->abort(); |
| 312 | QMessageBox::critical(m_parentWidget, tr("Error!"), tr("Couldn't start profiler: %1").arg(error)); |
| 313 | emitFailed("Profiler startup failed!"); |
| 314 | return; |
| 315 | } |
| 316 | BaseProfiler *profilerInstance = m_profiler->createProfiler(m_launcher->instance(), this); |
| 317 | |
| 318 | connect(profilerInstance, &BaseProfiler::readyToLaunch, [this](const QString & message) |
| 319 | { |
| 320 | QMessageBox msg; |
| 321 | msg.setText(tr("The game launch is delayed until you press the " |
| 322 | "button. This is the right time to setup the profiler, as the " |
| 323 | "profiler server is running now.\n\n%1").arg(message)); |
| 324 | msg.setWindowTitle(tr("Waiting.")); |
| 325 | msg.setIcon(QMessageBox::Information); |
| 326 | msg.addButton(tr("Launch"), QMessageBox::AcceptRole); |
| 327 | msg.setModal(true); |
| 328 | msg.exec(); |
| 329 | m_launcher->proceed(); |
| 330 | }); |
| 331 | connect(profilerInstance, &BaseProfiler::abortLaunch, [this](const QString & message) |
| 332 | { |
| 333 | QMessageBox msg; |
| 334 | msg.setText(tr("Couldn't start the profiler: %1").arg(message)); |
| 335 | msg.setWindowTitle(tr("Error")); |
| 336 | msg.setIcon(QMessageBox::Critical); |
| 337 | msg.addButton(QMessageBox::Ok); |
| 338 | msg.setModal(true); |
| 339 | msg.exec(); |
| 340 | m_launcher->abort(); |
| 341 | emitFailed("Profiler startup failed!"); |
| 342 | }); |
| 343 | profilerInstance->beginProfiling(m_launcher); |
| 344 | } |
| 345 | |
| 346 | void LaunchController::onSucceeded() |
| 347 | { |
nothing calls this directly
no test coverage detected