From 30d4f5981d3220386bd320534048594fc364d0e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 27 Dec 2013 12:50:24 +0100 Subject: Rearrange logiv for OneSix version change --- gui/MainWindow.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index bafccb1b..d16226eb 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -1026,22 +1026,9 @@ 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 (m_selectedInstance->versionIsCustom()) - { - auto result = CustomMessageBox::selectable( - this, tr("Are you sure?"), - tr("This will remove any library/version customization you did previously. " - "This includes things like Forge install and similar."), - QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Abort, - QMessageBox::Abort)->exec(); - - if (result != QMessageBox::Ok) - return; - } - m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor()); - } + if(!vselect.exec() || !vselect.selectedVersion()) + return; + if (!MMC->accounts()->anyAccountIsValid()) { CustomMessageBox::selectable( @@ -1051,7 +1038,22 @@ void MainWindow::on_actionChangeInstMCVersion_triggered() QMessageBox::Warning)->show(); return; } - auto updateTask = m_selectedInstance->doUpdate(false /*only_prepare*/); + + if (m_selectedInstance->versionIsCustom()) + { + auto result = CustomMessageBox::selectable( + this, tr("Are you sure?"), + tr("This will remove any library/version customization you did previously. " + "This includes things like Forge install and similar."), + QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Abort, + QMessageBox::Abort)->exec(); + + if (result != QMessageBox::Ok) + return; + } + m_selectedInstance->setIntendedVersionId(vselect.selectedVersion()->descriptor()); + + auto updateTask = m_selectedInstance->doUpdate(false); if (!updateTask) { return; -- cgit v1.2.3