summaryrefslogtreecommitdiffstats
path: root/application/pages/VersionPage.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2018-01-05 04:26:46 +0100
committerPetr Mrázek <peterix@gmail.com>2018-01-05 04:26:46 +0100
commit0636c03d7c08a90de5180e20dd6106c4cac34a23 (patch)
tree0e969118c1ae557dbdc2377452638ee9460f94a8 /application/pages/VersionPage.cpp
parentee341b78baf679ba7eac868ce72e313c8e49775f (diff)
downloadMultiMC-0636c03d7c08a90de5180e20dd6106c4cac34a23.tar
MultiMC-0636c03d7c08a90de5180e20dd6106c4cac34a23.tar.gz
MultiMC-0636c03d7c08a90de5180e20dd6106c4cac34a23.tar.lz
MultiMC-0636c03d7c08a90de5180e20dd6106c4cac34a23.tar.xz
MultiMC-0636c03d7c08a90de5180e20dd6106c4cac34a23.zip
GH-2087 remove the revert to vanilla functionality, add file download button to version page
Diffstat (limited to 'application/pages/VersionPage.cpp')
-rw-r--r--application/pages/VersionPage.cpp41
1 files changed, 13 insertions, 28 deletions
diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp
index 50cc825f..57e1709b 100644
--- a/application/pages/VersionPage.cpp
+++ b/application/pages/VersionPage.cpp
@@ -324,54 +324,39 @@ void VersionPage::on_changeVersionBtn_clicked()
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;
- }
-
qDebug() << "Change" << uid << "to" << vselect.selectedVersion()->descriptor();
bool important = false;
if(uid == "net.minecraft")
{
important = true;
- if (!m_profile->isVanilla())
- {
- 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_profile->revertToVanilla();
- reloadComponentList();
- }
}
m_profile->setComponentVersion(uid, vselect.selectedVersion()->descriptor(), important);
- doUpdate();
+ m_profile->resolve(Net::Mode::Online);
m_container->refreshContainer();
}
-int VersionPage::doUpdate()
+void VersionPage::on_downloadBtn_clicked()
{
+ 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_inst->createUpdateTask(Net::Mode::Online);
if (!updateTask)
{
- return 1;
+ return;
}
ProgressDialog tDialog(this);
connect(updateTask.get(), SIGNAL(failed(QString)), SLOT(onGameUpdateError(QString)));
int ret = tDialog.execWithTask(updateTask.get());
updateButtons();
m_container->refreshContainer();
- return ret;
}
void VersionPage::on_forgeBtn_clicked()