From 49d3705d16dcbfb69995eb731a11944eb9db33fd Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Tue, 5 May 2015 00:42:04 +0200 Subject: GH-899 clean up mod browse buttons and dead legacy forge --- application/pages/ModFolderPage.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'application/pages/ModFolderPage.cpp') diff --git a/application/pages/ModFolderPage.cpp b/application/pages/ModFolderPage.cpp index 94575e10..dbedbc25 100644 --- a/application/pages/ModFolderPage.cpp +++ b/application/pages/ModFolderPage.cpp @@ -28,6 +28,7 @@ #include "MultiMC.h" #include "dialogs/CustomMessageBox.h" #include "dialogs/ModEditDialogCommon.h" +#include #include "minecraft/ModList.h" #include "minecraft/Mod.h" #include "minecraft/VersionFilterData.h" @@ -121,14 +122,22 @@ bool ModFolderPage::eventFilter(QObject *obj, QEvent *ev) void ModFolderPage::on_addModBtn_clicked() { - QStringList fileNames = QFileDialog::getOpenFileNames( - this, QApplication::translate("ModFolderPage", "Select Loader Mods"), MMC->settings()->get("CentralModsDir").toString()); - for (auto filename : fileNames) + auto list = GuiUtil::BrowseForMods( + m_helpName, + tr("Select %1", + "Select whatever type of files the page contains. Example: 'Loader Mods'") + .arg(m_displayName), + tr("%1 (*.zip *.jar)").arg(m_displayName), this->parentWidget()); + if (!list.empty()) { m_mods->stopWatching(); - m_mods->installMod(QFileInfo(filename)); + for (auto filename : list) + { + m_mods->installMod(QFileInfo(filename)); + } m_mods->startWatching(); } + } void ModFolderPage::on_rmModBtn_clicked() { -- cgit