| 1727 | } |
| 1728 | |
| 1729 | void 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 | |
| 1757 | void MainWindow::addInstance(QString url) |
| 1758 | { |
nothing calls this directly
no test coverage detected