MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / readyForLaunch

Method readyForLaunch

launcher/LaunchController.cpp:401–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401void LaunchController::readyForLaunch()
402{
403 if (!m_profiler)
404 {
405 m_launcher->proceed();
406 return;
407 }
408
409 QString error;
410 if (!m_profiler->check(&error))
411 {
412 m_launcher->abort();
413 QMessageBox::critical(m_parentWidget, tr("Error!"), tr("Couldn't start profiler: %1").arg(error));
414 emitFailed("Profiler startup failed!");
415 return;
416 }
417 BaseProfiler *profilerInstance = m_profiler->createProfiler(m_launcher->instance(), this);
418
419 connect(profilerInstance, &BaseProfiler::readyToLaunch, [this](const QString & message)
420 {
421 QMessageBox msg;
422 msg.setText(tr("The game launch is delayed until you press the "
423 "button. This is the right time to setup the profiler, as the "
424 "profiler server is running now.\n\n%1").arg(message));
425 msg.setWindowTitle(tr("Waiting."));
426 msg.setIcon(QMessageBox::Information);
427 msg.addButton(tr("Launch"), QMessageBox::AcceptRole);
428 msg.setModal(true);
429 msg.exec();
430 m_launcher->proceed();
431 });
432 connect(profilerInstance, &BaseProfiler::abortLaunch, [this](const QString & message)
433 {
434 QMessageBox msg;
435 msg.setText(tr("Couldn't start the profiler: %1").arg(message));
436 msg.setWindowTitle(tr("Error"));
437 msg.setIcon(QMessageBox::Critical);
438 msg.addButton(QMessageBox::Ok);
439 msg.setModal(true);
440 msg.exec();
441 m_launcher->abort();
442 emitFailed("Profiler startup failed!");
443 });
444 profilerInstance->beginProfiling(m_launcher);
445}
446
447void LaunchController::onSucceeded()
448{

Callers

nothing calls this directly

Calls 9

createProfilerMethod · 0.80
beginProfilingMethod · 0.80
proceedMethod · 0.45
checkMethod · 0.45
abortMethod · 0.45
instanceMethod · 0.45
setTextMethod · 0.45
setIconMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected