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

Method finalizeInstance

launcher/ui/MainWindow.cpp:1396–1425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1394}
1395
1396void MainWindow::finalizeInstance(InstancePtr inst)
1397{
1398 view->updateGeometries();
1399 setSelectedInstanceById(inst->id());
1400 if (APPLICATION->accounts()->anyAccountIsValid())
1401 {
1402 ProgressDialog loadDialog(this);
1403 auto update = inst->createUpdateTask(Net::Mode::Online);
1404 connect(update.get(), &Task::failed, [this](QString reason)
1405 {
1406 QString error = QString("Instance load failed: %1").arg(reason);
1407 CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning)->show();
1408 });
1409 if(update)
1410 {
1411 loadDialog.setSkipButton(true, tr("Abort"));
1412 loadDialog.execWithTask(update.get());
1413 }
1414 }
1415 else
1416 {
1417 CustomMessageBox::selectable(
1418 this,
1419 tr("Error"),
1420 tr("The launcher cannot download Minecraft or update instances unless you have at least "
1421 "one account added.\nPlease add your Mojang or Minecraft account."),
1422 QMessageBox::Warning
1423 )->show();
1424 }
1425}
1426
1427void MainWindow::addInstance(QString url)
1428{

Callers

nothing calls this directly

Calls 10

QStringClass · 0.85
selectableFunction · 0.85
updateGeometriesMethod · 0.80
anyAccountIsValidMethod · 0.80
accountsMethod · 0.80
setSkipButtonMethod · 0.80
execWithTaskMethod · 0.80
idMethod · 0.45
createUpdateTaskMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected