| 1394 | } |
| 1395 | |
| 1396 | void 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 | |
| 1427 | void MainWindow::addInstance(QString url) |
| 1428 | { |
nothing calls this directly
no test coverage detected