MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / readyForLaunch

Method readyForLaunch

launcher/LaunchController.cpp:369–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void 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
411void LaunchController::onSucceeded()
412{

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected