Merge branch 'feature_no_firstrun' of https://github.com/robotbrain/MultiMC5 into develop

This commit is contained in:
Petr Mrázek 2013-12-11 00:08:39 +01:00
commit 018f328993

View File

@ -513,7 +513,7 @@ void MainWindow::on_actionAddInstance_triggered()
newInstance->setName(newInstDlg.instName()); newInstance->setName(newInstDlg.instName());
newInstance->setIconKey(newInstDlg.iconKey()); newInstance->setIconKey(newInstDlg.iconKey());
MMC->instances()->add(InstancePtr(newInstance)); MMC->instances()->add(InstancePtr(newInstance));
return; break;
case InstanceFactory::InstExists: case InstanceFactory::InstExists:
{ {
@ -536,6 +536,19 @@ void MainWindow::on_actionAddInstance_triggered()
break; break;
} }
} }
std::shared_ptr<MojangAccountList> accounts = MMC->accounts();
MojangAccountPtr account = accounts->activeAccount();
if(account.get() != nullptr && account->accountStatus() != NotVerified)
{
ProgressDialog loadDialog(this);
auto update = newInstance->doUpdate(false);
connect(update.get(), &Task::failed , [this](QString reason) {
QString error = QString("Instance load failed: %1").arg(reason);
CustomMessageBox::selectable(this, tr("Error"), error, QMessageBox::Warning)->show();
});
loadDialog.exec(update.get());
}
} }
void MainWindow::on_actionCopyInstance_triggered() void MainWindow::on_actionCopyInstance_triggered()