summaryrefslogtreecommitdiffstats
path: root/application/pages/WorldListPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'application/pages/WorldListPage.cpp')
-rw-r--r--application/pages/WorldListPage.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/application/pages/WorldListPage.cpp b/application/pages/WorldListPage.cpp
index 8b95b2b0..be1d58b8 100644
--- a/application/pages/WorldListPage.cpp
+++ b/application/pages/WorldListPage.cpp
@@ -25,6 +25,7 @@
#include "MultiMC.h"
+#include <GuiUtil.h>
WorldListPage::WorldListPage(BaseInstance *inst, std::shared_ptr<WorldList> worlds, QString id,
QString iconName, QString displayName, QString helpPage,
@@ -67,8 +68,6 @@ WorldListPage::~WorldListPage()
bool WorldListPage::shouldDisplay() const
{
- if (m_inst)
- return !m_inst->isRunning();
return true;
}
@@ -200,3 +199,20 @@ void WorldListPage::worldChanged(const QModelIndex &current, const QModelIndex &
ui->mcEditBtn->setEnabled(enable);
ui->rmWorldBtn->setEnabled(enable);
}
+
+void WorldListPage::on_addBtn_clicked()
+{
+ auto list = GuiUtil::BrowseForFiles(
+ m_helpName,
+ tr("Select a Minecraft world zip"),
+ tr("Minecraft World Zip File (*.zip)"), QString(), this->parentWidget());
+ if (!list.empty())
+ {
+ m_worlds->stopWatching();
+ for (auto filename : list)
+ {
+ m_worlds->installWorld(QFileInfo(filename));
+ }
+ m_worlds->startWatching();
+ }
+} \ No newline at end of file