| 1412 | } |
| 1413 | |
| 1414 | void 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 | |
| 1445 | void MainWindow::addInstance(QString url) |
| 1446 | { |
nothing calls this directly
no test coverage detected