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

Method finalizeInstance

launcher/ui/MainWindow.cpp:1729–1755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1727}
1728
1729void MainWindow::finalizeInstance(InstancePtr inst)
1730{
1731 view->updateGeometries();
1732 setSelectedInstanceById(inst->id());
1733 if (APPLICATION->accounts()->drmCheck()) {
1734 ProgressDialog loadDialog(this);
1735 auto update = inst->createUpdateTask(Net::Mode::Online);
1736 connect(update.get(), &Task::failed, [this](QString reason)
1737 {
1738 QString error = QString("Instance load failed: %1").arg(reason);
1739 CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning)->show();
1740 });
1741 if(update)
1742 {
1743 loadDialog.setSkipButton(true, tr("Abort"));
1744 loadDialog.execWithTask(update.get());
1745 }
1746 } else {
1747 CustomMessageBox::selectable(
1748 this,
1749 tr("Error"),
1750 tr("The launcher cannot download Minecraft or update instances unless you have at least "
1751 "one account added.\nPlease add your Mojang or Minecraft account."),
1752 QMessageBox::Warning
1753 )->show();
1754 }
1755}
1756
1757void MainWindow::addInstance(QString url)
1758{

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected