summaryrefslogtreecommitdiffstats
path: root/application/pages/VersionPage.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/VersionPage.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/VersionPage.cpp')
-rw-r--r--application/pages/VersionPage.cpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp
index 7cb99763..2fb50f0b 100644
--- a/application/pages/VersionPage.cpp
+++ b/application/pages/VersionPage.cpp
@@ -30,6 +30,7 @@
#include "dialogs/ModEditDialogCommon.h"
#include "dialogs/ProgressDialog.h"
+#include <GuiUtil.h>
#include <QAbstractItemModel>
#include <QMessageBox>
@@ -145,36 +146,11 @@ void VersionPage::on_removeLibraryBtn_clicked()
void VersionPage::on_jarmodBtn_clicked()
{
- QFileDialog w;
- QSet<QString> locations;
- QString modsFolder = MMC->settings()->get("CentralModsDir").toString();
- auto f = [&](QStandardPaths::StandardLocation l)
+ auto list = GuiUtil::BrowseForMods("jarmod", tr("Select jar mods"), tr("Minecraft.jar mods (*.zip *.jar)"), this->parentWidget());
+ if(!list.empty())
{
- QString location = QStandardPaths::writableLocation(l);
- QFileInfo finfo(location);
- if (!finfo.exists())
- return;
- locations.insert(location);
- };
- f(QStandardPaths::DesktopLocation);
- f(QStandardPaths::DocumentsLocation);
- f(QStandardPaths::DownloadLocation);
- f(QStandardPaths::HomeLocation);
- QList<QUrl> urls;
- for (auto location : locations)
- {
- urls.append(QUrl::fromLocalFile(location));
+ m_version->installJarMods(list);
}
- urls.append(QUrl::fromLocalFile(modsFolder));
-
- w.setFileMode(QFileDialog::ExistingFiles);
- w.setAcceptMode(QFileDialog::AcceptOpen);
- w.setNameFilter(tr("Minecraft jar mods (*.zip *.jar)"));
- w.setDirectory(modsFolder);
- w.setSidebarUrls(urls);
-
- if (w.exec())
- m_version->installJarMods(w.selectedFiles());
}
void VersionPage::on_resetLibraryOrderBtn_clicked()