summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/MainWindow.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp
index f115f090..80bde381 100644
--- a/gui/MainWindow.cpp
+++ b/gui/MainWindow.cpp
@@ -513,7 +513,7 @@ void MainWindow::on_actionAddInstance_triggered()
newInstance->setName(newInstDlg.instName());
newInstance->setIconKey(newInstDlg.iconKey());
MMC->instances()->add(InstancePtr(newInstance));
- return;
+ break;
case InstanceFactory::InstExists:
{
@@ -536,6 +536,19 @@ void MainWindow::on_actionAddInstance_triggered()
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()