summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-04-05 22:00:32 +0200
committerPetr Mrázek <peterix@gmail.com>2015-04-13 00:15:23 +0200
commit9df2f1fa5c455e4e75caf3f5ae6dbe4c34b77d51 (patch)
tree3fa8c4ca4f1a0333bbf4183edba7f6f9a98f1f0e
parentfe540e5dda903156b1037559752fc5332375f465 (diff)
downloadMultiMC-9df2f1fa5c455e4e75caf3f5ae6dbe4c34b77d51.tar
MultiMC-9df2f1fa5c455e4e75caf3f5ae6dbe4c34b77d51.tar.gz
MultiMC-9df2f1fa5c455e4e75caf3f5ae6dbe4c34b77d51.tar.lz
MultiMC-9df2f1fa5c455e4e75caf3f5ae6dbe4c34b77d51.tar.xz
MultiMC-9df2f1fa5c455e4e75caf3f5ae6dbe4c34b77d51.zip
NOISSUE fix legacy edit instance
-rw-r--r--application/CMakeLists.txt6
-rw-r--r--application/InstancePageProvider.h21
-rw-r--r--application/pages/LegacyJarModPage.cpp (renamed from gui/pages/LegacyJarModPage.cpp)18
-rw-r--r--application/pages/LegacyJarModPage.h (renamed from gui/pages/LegacyJarModPage.h)2
-rw-r--r--application/pages/LegacyJarModPage.ui (renamed from gui/pages/LegacyJarModPage.ui)6
-rw-r--r--application/pages/LegacyUpgradePage.cpp (renamed from gui/pages/LegacyUpgradePage.cpp)2
-rw-r--r--application/pages/LegacyUpgradePage.h (renamed from gui/pages/LegacyUpgradePage.h)6
-rw-r--r--application/pages/LegacyUpgradePage.ui (renamed from gui/pages/LegacyUpgradePage.ui)0
-rw-r--r--logic/minecraft/LegacyInstance.cpp33
9 files changed, 44 insertions, 50 deletions
diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt
index 9e94cdad..3643feee 100644
--- a/application/CMakeLists.txt
+++ b/application/CMakeLists.txt
@@ -177,6 +177,10 @@ SET(MULTIMC_SOURCES
pages/ScreenshotsPage.h
pages/OtherLogsPage.cpp
pages/OtherLogsPage.h
+ pages/LegacyJarModPage.cpp
+ pages/LegacyJarModPage.h
+ pages/LegacyUpgradePage.cpp
+ pages/LegacyUpgradePage.h
# GUI - global settings pages
pages/global/AccountListPage.cpp
@@ -266,6 +270,8 @@ SET(MULTIMC_UIS
pages/NotesPage.ui
pages/ScreenshotsPage.ui
pages/OtherLogsPage.ui
+ pages/LegacyJarModPage.ui
+ pages/LegacyUpgradePage.ui
# Global settings pages
pages/global/AccountListPage.ui
diff --git a/application/InstancePageProvider.h b/application/InstancePageProvider.h
index a19e21c8..9cc97c4a 100644
--- a/application/InstancePageProvider.h
+++ b/application/InstancePageProvider.h
@@ -1,5 +1,6 @@
#pragma once
#include "minecraft/OneSixInstance.h"
+#include "minecraft/LegacyInstance.h"
#include "pages/BasePage.h"
#include "pages/VersionPage.h"
#include "pages/ModFolderPage.h"
@@ -10,8 +11,10 @@
#include "pages/InstanceSettingsPage.h"
#include "pages/OtherLogsPage.h"
#include "pages/BasePageProvider.h"
+#include "pages/LegacyJarModPage.h"
#include <pathutils.h>
+
class InstancePageProvider : public QObject, public BasePageProvider
{
Q_OBJECT
@@ -40,6 +43,24 @@ public:
values.append(new InstanceSettingsPage(onesix.get()));
values.append(new OtherLogsPage(onesix->minecraftRoot()));
}
+ std::shared_ptr<LegacyInstance> legacy = std::dynamic_pointer_cast<LegacyInstance>(inst);
+ if(legacy)
+ {
+ QList<BasePage *> values;
+ // FIXME: actually implement the legacy instance upgrade, then enable this.
+ //values.append(new LegacyUpgradePage(this));
+ values.append(new LegacyJarModPage(legacy.get()));
+ values.append(new ModFolderPage(legacy.get(), legacy->loaderModList(), "mods", "loadermods", tr("Loader mods"),
+ "Loader-mods"));
+ values.append(new ModFolderPage(legacy.get(), legacy->coreModList(), "coremods", "coremods", tr("Core mods"),
+ "Loader-mods"));
+ values.append(new TexturePackPage(legacy.get()));
+ values.append(new NotesPage(legacy.get()));
+ values.append(new ScreenshotsPage(PathCombine(legacy->minecraftRoot(), "screenshots")));
+ values.append(new InstanceSettingsPage(legacy.get()));
+ values.append(new OtherLogsPage(legacy->minecraftRoot()));
+ return values;
+ }
return values;
}
diff --git a/gui/pages/LegacyJarModPage.cpp b/application/pages/LegacyJarModPage.cpp
index 55a8300f..b403aa8a 100644
--- a/gui/pages/LegacyJarModPage.cpp
+++ b/application/pages/LegacyJarModPage.cpp
@@ -22,14 +22,12 @@
#include <pathutils.h>
-#include "gui/dialogs/VersionSelectDialog.h"
-#include "gui/dialogs/ProgressDialog.h"
-#include "gui/dialogs/ModEditDialogCommon.h"
-#include "logic/minecraft/ModList.h"
-#include "logic/minecraft/LegacyInstance.h"
-#include "logic/forge/ForgeVersion.h"
-#include "logic/forge/ForgeVersionList.h"
-#include "logic/Env.h"
+#include "dialogs/VersionSelectDialog.h"
+#include "dialogs/ProgressDialog.h"
+#include "dialogs/ModEditDialogCommon.h"
+#include "minecraft/ModList.h"
+#include "minecraft/LegacyInstance.h"
+#include "Env.h"
#include "MultiMC.h"
LegacyJarModPage::LegacyJarModPage(LegacyInstance *inst, QWidget *parent)
@@ -102,6 +100,8 @@ bool LegacyJarModPage::eventFilter(QObject *obj, QEvent *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())
@@ -135,7 +135,7 @@ void LegacyJarModPage::on_addForgeBtn_clicked()
m_jarmods->installMod(QFileInfo(entry->getFullPath()));
m_jarmods->startWatching();
}
- }
+ }*/
}
void LegacyJarModPage::on_addJarBtn_clicked()
{
diff --git a/gui/pages/LegacyJarModPage.h b/application/pages/LegacyJarModPage.h
index e1ffd5d6..d1e31a0c 100644
--- a/gui/pages/LegacyJarModPage.h
+++ b/application/pages/LegacyJarModPage.h
@@ -17,7 +17,7 @@
#include <QWidget>
-#include "logic/net/NetJob.h"
+#include "net/NetJob.h"
#include "BasePage.h"
#include <MultiMC.h>
diff --git a/gui/pages/LegacyJarModPage.ui b/application/pages/LegacyJarModPage.ui
index 50edfc8e..e99fac9a 100644
--- a/gui/pages/LegacyJarModPage.ui
+++ b/application/pages/LegacyJarModPage.ui
@@ -152,18 +152,18 @@
<customwidget>
<class>ModListView</class>
<extends>QTreeView</extends>
- <header>gui/widgets/ModListView.h</header>
+ <header>widgets/ModListView.h</header>
</customwidget>
<customwidget>
<class>MCModInfoFrame</class>
<extends>QFrame</extends>
- <header>gui/widgets/MCModInfoFrame.h</header>
+ <header>widgets/MCModInfoFrame.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>LineSeparator</class>
<extends>QWidget</extends>
- <header>gui/widgets/LineSeparator.h</header>
+ <header>widgets/LineSeparator.h</header>
<container>1</container>
</customwidget>
</customwidgets>
diff --git a/gui/pages/LegacyUpgradePage.cpp b/application/pages/LegacyUpgradePage.cpp
index bb94d82a..49998c50 100644
--- a/gui/pages/LegacyUpgradePage.cpp
+++ b/application/pages/LegacyUpgradePage.cpp
@@ -1,7 +1,7 @@
#include "LegacyUpgradePage.h"
#include "ui_LegacyUpgradePage.h"
-#include "logic/minecraft/LegacyInstance.h"
+#include "minecraft/LegacyInstance.h"
LegacyUpgradePage::LegacyUpgradePage(LegacyInstance *inst, QWidget *parent)
: QWidget(parent), ui(new Ui::LegacyUpgradePage), m_inst(inst)
diff --git a/gui/pages/LegacyUpgradePage.h b/application/pages/LegacyUpgradePage.h
index b604da19..108b1024 100644
--- a/gui/pages/LegacyUpgradePage.h
+++ b/application/pages/LegacyUpgradePage.h
@@ -17,9 +17,9 @@
#include <QWidget>
-#include "logic/minecraft/OneSixInstance.h"
-#include "logic/net/NetJob.h"
-#include "gui/pages/BasePage.h"
+#include "minecraft/OneSixInstance.h"
+#include "net/NetJob.h"
+#include "pages/BasePage.h"
#include <MultiMC.h>
namespace Ui
diff --git a/gui/pages/LegacyUpgradePage.ui b/application/pages/LegacyUpgradePage.ui
index 8d676eae..8d676eae 100644
--- a/gui/pages/LegacyUpgradePage.ui
+++ b/application/pages/LegacyUpgradePage.ui
diff --git a/logic/minecraft/LegacyInstance.cpp b/logic/minecraft/LegacyInstance.cpp
index a330842d..282504b3 100644
--- a/logic/minecraft/LegacyInstance.cpp
+++ b/logic/minecraft/LegacyInstance.cpp
@@ -26,15 +26,6 @@
#include "icons/IconList.h"
#include "minecraft/MinecraftProcess.h"
#include "minecraft/ModList.h"
-/*
-#include "gui/pages/LegacyUpgradePage.h"
-#include "gui/pages/ModFolderPage.h"
-#include "gui/pages/LegacyJarModPage.h"
-#include <gui/pages/TexturePackPage.h>
-#include <gui/pages/InstanceSettingsPage.h>
-#include <gui/pages/NotesPage.h>
-#include <gui/pages/ScreenshotsPage.h>
-*/
LegacyInstance::LegacyInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir)
: MinecraftInstance(globalSettings, settings, rootDir)
@@ -56,30 +47,6 @@ LegacyInstance::LegacyInstance(SettingsObjectPtr globalSettings, SettingsObjectP
settings->registerSetting("CustomBaseJar", "");
}
-/*
-QList<BasePage *> LegacyInstance::getPages()
-{
- QList<BasePage *> values;
- // FIXME: actually implement the legacy instance upgrade, then enable this.
- //values.append(new LegacyUpgradePage(this));
- values.append(new LegacyJarModPage(this));
- values.append(new ModFolderPage(this, loaderModList(), "mods", "loadermods", tr("Loader mods"),
- "Loader-mods"));
- values.append(new ModFolderPage(this, coreModList(), "coremods", "coremods", tr("Core mods"),
- "Loader-mods"));
- values.append(new TexturePackPage(this));
- values.append(new NotesPage(this));
- values.append(new ScreenshotsPage(PathCombine(minecraftRoot(), "screenshots")));
- values.append(new InstanceSettingsPage(this));
- return values;
-}
-
-QString LegacyInstance::dialogTitle()
-{
- return tr("Edit Instance (%1)").arg(name());
-}
-*/
-
QString LegacyInstance::baseJar() const
{
bool customJar = m_settings->get("UseCustomBaseJar").toBool();