diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-03-14 20:48:57 +0100 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-03-14 20:48:57 +0100 |
commit | e95619fa67239b709522a66b8bb7403bb7b84098 (patch) | |
tree | edee0bdc771e1a958c239abfc8d112c38539aa42 /gui/dialogs | |
parent | e5b4dee1c05d0d6ebc0d7b2dd802b93cb8765e63 (diff) | |
download | MultiMC-e95619fa67239b709522a66b8bb7403bb7b84098.tar MultiMC-e95619fa67239b709522a66b8bb7403bb7b84098.tar.gz MultiMC-e95619fa67239b709522a66b8bb7403bb7b84098.tar.lz MultiMC-e95619fa67239b709522a66b8bb7403bb7b84098.tar.xz MultiMC-e95619fa67239b709522a66b8bb7403bb7b84098.zip |
Pull in BaseInstaller related changes from quickmod
Diffstat (limited to 'gui/dialogs')
-rw-r--r-- | gui/dialogs/OneSixModEditDialog.cpp | 56 |
1 files changed, 4 insertions, 52 deletions
diff --git a/gui/dialogs/OneSixModEditDialog.cpp b/gui/dialogs/OneSixModEditDialog.cpp index b5a0d5aa..7dac68e5 100644 --- a/gui/dialogs/OneSixModEditDialog.cpp +++ b/gui/dialogs/OneSixModEditDialog.cpp @@ -221,44 +221,9 @@ void OneSixModEditDialog::on_forgeBtn_clicked() m_inst->currentVersionId()); if (vselect.exec() && vselect.selectedVersion()) { - ForgeVersionPtr forgeVersion = - std::dynamic_pointer_cast<ForgeVersion>(vselect.selectedVersion()); - if (!forgeVersion) - return; - auto entry = MMC->metacache()->resolveEntry("minecraftforge", forgeVersion->filename); - if (entry->stale) - { - NetJob *fjob = new NetJob("Forge download"); - fjob->addNetAction(CacheDownload::make(forgeVersion->installer_url, entry)); - ProgressDialog dlg(this); - dlg.exec(fjob); - if (dlg.result() == QDialog::Accepted) - { - // install - QString forgePath = entry->getFullPath(); - ForgeInstaller forge(forgePath, forgeVersion->universal_url); - if (!forge.add(m_inst)) - { - QLOG_ERROR() << "Failure installing forge"; - } - } - else - { - // failed to download forge :/ - } - } - else - { - // install - QString forgePath = entry->getFullPath(); - ForgeInstaller forge(forgePath, forgeVersion->universal_url); - if (!forge.add(m_inst)) - { - QLOG_ERROR() << "Failure installing forge"; - } - } + ProgressDialog dialog(this); + dialog.exec(ForgeInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); } - reloadInstanceVersion(); } void OneSixModEditDialog::on_liteloaderBtn_clicked() @@ -281,21 +246,8 @@ void OneSixModEditDialog::on_liteloaderBtn_clicked() m_inst->currentVersionId()); if (vselect.exec() && vselect.selectedVersion()) { - LiteLoaderVersionPtr liteloaderVersion = - std::dynamic_pointer_cast<LiteLoaderVersion>(vselect.selectedVersion()); - if (!liteloaderVersion) - return; - LiteLoaderInstaller liteloader(liteloaderVersion); - if (!liteloader.add(m_inst)) - { - QMessageBox::critical(this, tr("LiteLoader"), - tr("For reasons unknown, the LiteLoader installation failed. " - "Check your MultiMC log files for details.")); - } - else - { - reloadInstanceVersion(); - } + ProgressDialog dialog(this); + dialog.exec(LiteLoaderInstaller().createInstallTask(m_inst, vselect.selectedVersion(), this)); } } |