summaryrefslogtreecommitdiffstats
path: root/application/pages/LegacyJarModPage.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-05 00:42:04 +0200
committerPetr Mrázek <peterix@gmail.com>2015-05-05 00:42:04 +0200
commit49d3705d16dcbfb69995eb731a11944eb9db33fd (patch)
tree29b40be625dcf7e19b273b94e4be9be2e7035a2f /application/pages/LegacyJarModPage.cpp
parentc09dc85090a286305ce4f6faf86a71498a792018 (diff)
downloadMultiMC-49d3705d16dcbfb69995eb731a11944eb9db33fd.tar
MultiMC-49d3705d16dcbfb69995eb731a11944eb9db33fd.tar.gz
MultiMC-49d3705d16dcbfb69995eb731a11944eb9db33fd.tar.lz
MultiMC-49d3705d16dcbfb69995eb731a11944eb9db33fd.tar.xz
MultiMC-49d3705d16dcbfb69995eb731a11944eb9db33fd.zip
GH-899 clean up mod browse buttons and dead legacy forge
Diffstat (limited to 'application/pages/LegacyJarModPage.cpp')
-rw-r--r--application/pages/LegacyJarModPage.cpp50
1 files changed, 7 insertions, 43 deletions
diff --git a/application/pages/LegacyJarModPage.cpp b/application/pages/LegacyJarModPage.cpp
index b403aa8a..60f1057a 100644
--- a/application/pages/LegacyJarModPage.cpp
+++ b/application/pages/LegacyJarModPage.cpp
@@ -29,6 +29,7 @@
#include "minecraft/LegacyInstance.h"
#include "Env.h"
#include "MultiMC.h"
+#include <GuiUtil.h>
LegacyJarModPage::LegacyJarModPage(LegacyInstance *inst, QWidget *parent)
: QWidget(parent), ui(new Ui::LegacyJarModPage), m_inst(inst)
@@ -98,53 +99,16 @@ bool LegacyJarModPage::eventFilter(QObject *obj, QEvent *ev)
return QWidget::eventFilter(obj, ev);
}
-void LegacyJarModPage::on_addForgeBtn_clicked()
-{
- //FIXME: dead. clean up.
- /*
- VersionSelectDialog vselect(MMC->forgelist().get(), tr("Select Forge version"), this);
- vselect.setExactFilter(1, m_inst->intendedVersionId());
- if (vselect.exec() && vselect.selectedVersion())
- {
- ForgeVersionPtr forge =
- std::dynamic_pointer_cast<ForgeVersion>(vselect.selectedVersion());
- if (!forge)
- return;
- auto entry = Env::getInstance().metacache()->resolveEntry("minecraftforge", forge->filename());
- if (entry->stale)
- {
- NetJob *fjob = new NetJob("Forge download");
- auto cacheDl = CacheDownload::make(forge->universal_url, entry);
- fjob->addNetAction(cacheDl);
- ProgressDialog dlg(this);
- dlg.exec(fjob);
- if (dlg.result() == QDialog::Accepted)
- {
- m_jarmods->stopWatching();
- m_jarmods->installMod(QFileInfo(entry->getFullPath()));
- m_jarmods->startWatching();
- }
- else
- {
- // failed to download forge :/
- }
- }
- else
- {
- m_jarmods->stopWatching();
- m_jarmods->installMod(QFileInfo(entry->getFullPath()));
- m_jarmods->startWatching();
- }
- }*/
-}
void LegacyJarModPage::on_addJarBtn_clicked()
{
- //: Title of jar mod selection dialog
- QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Select Jar Mods"));
- for (auto filename : fileNames)
+ auto list = GuiUtil::BrowseForMods("jarmod", tr("Select jar mods"), tr("Minecraft.jar mods (*.zip *.jar)"), this->parentWidget());
+ if(!list.empty())
{
m_jarmods->stopWatching();
- m_jarmods->installMod(QFileInfo(filename));
+ for (auto filename : list)
+ {
+ m_jarmods->installMod(QFileInfo(filename));
+ }
m_jarmods->startWatching();
}
}