summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-27 12:50:24 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-27 12:50:24 +0100
commit30d4f5981d3220386bd320534048594fc364d0e9 (patch)
tree5b17ed615d0358af20b86c698a308725454f22a4 /gui
parent4bf1cac8d89809106819c86543ef8efbf78f163f (diff)
downloadMultiMC-30d4f5981d3220386bd320534048594fc364d0e9.tar
MultiMC-30d4f5981d3220386bd320534048594fc364d0e9.tar.gz
MultiMC-30d4f5981d3220386bd320534048594fc364d0e9.tar.lz
MultiMC-30d4f5981d3220386bd320534048594fc364d0e9.tar.xz
MultiMC-30d4f5981d3220386bd320534048594fc364d0e9.zip
Rearrange logiv for OneSix version change
Diffstat (limited to 'gui')
-rw-r--r--gui/MainWindow.cpp36
1 files 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;