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

Method finalizeInstance

launcher/ui/MainWindow.cpp:1414–1443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1412}
1413
1414void MainWindow::finalizeInstance(InstancePtr inst)
1415{
1416 view->updateGeometries();
1417 setSelectedInstanceById(inst->id());
1418 if (APPLICATION->accounts()->anyAccountIsValid())
1419 {
1420 ProgressDialog loadDialog(this);
1421 auto update = inst->createUpdateTask(Net::Mode::Online);
1422 connect(update.get(), &Task::failed, [this](QString reason)
1423 {
1424 QString error = QString("Instance load failed: %1").arg(reason);
1425 CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning)->show();
1426 });
1427 if(update)
1428 {
1429 loadDialog.setSkipButton(true, tr("Abort"));
1430 loadDialog.execWithTask(update.get());
1431 }
1432 }
1433 else
1434 {
1435 CustomMessageBox::selectable(
1436 this,
1437 tr("Error"),
1438 tr("The launcher cannot download Minecraft or update instances unless you have at least "
1439 "one account added.\nPlease add your Mojang or Minecraft account."),
1440 QMessageBox::Warning
1441 )->show();
1442 }
1443}
1444
1445void MainWindow::addInstance(QString url)
1446{

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