summaryrefslogtreecommitdiffstats
path: root/application/pages/ModFolderPage.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/ModFolderPage.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/ModFolderPage.cpp')
-rw-r--r--application/pages/ModFolderPage.cpp17
1 files changed, 13 insertions, 4 deletions
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 <GuiUtil.h>
#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()
{