Rearrange logiv for OneSix version change

This commit is contained in:
Petr Mrázek 2013-12-27 12:50:24 +01:00
parent 4bf1cac8d8
commit 30d4f5981d

View File

@ -1026,8 +1026,19 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
VersionSelectDialog vselect(m_selectedInstance->versionList().get(),
tr("Change Minecraft version"), this);
vselect.setFilter(1, "OneSix");
if (vselect.exec() && vselect.selectedVersion())
if(!vselect.exec() || !vselect.selectedVersion())
return;
if (!MMC->accounts()->anyAccountIsValid())
{
CustomMessageBox::selectable(
this, tr("Error"),
tr("MultiMC cannot download Minecraft or update instances unless you have at least "
"one account added.\nPlease add your Mojang or Minecraft account."),
QMessageBox::Warning)->show();
return;
}
if (m_selectedInstance->versionIsCustom())
{
auto result = CustomMessageBox::selectable(
@ -1041,17 +1052,8 @@ void MainWindow::on_actionChangeInstMCVersion_triggered()
return;
}
m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor());
}
if (!MMC->accounts()->anyAccountIsValid())
{
CustomMessageBox::selectable(
this, tr("Error"),
tr("MultiMC cannot download Minecraft or update instances unless you have at least "
"one account added.\nPlease add your Mojang or Minecraft account."),
QMessageBox::Warning)->show();
return;
}
auto updateTask = m_selectedInstance->doUpdate(false /*only_prepare*/);
auto updateTask = m_selectedInstance->doUpdate(false);
if (!updateTask)
{
return;