MCPcopy Create free account
hub / github.com/MultiMC/Launcher / readyForLaunch

Method readyForLaunch

launcher/LaunchController.cpp:300–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

298}
299
300void 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
346void LaunchController::onSucceeded()
347{

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