From 253067c782955380bbf66ac0475dc954375b1ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 17 Aug 2013 13:40:51 +0200 Subject: [PATCH] Move all the things (YES. Move them.) Also, implemented some basic modlist logic, to be wired up. --- CMakeLists.txt | 124 +++++++++++++----- backend/CMakeLists.txt | 120 ----------------- backend/LegacyInstance_p.h | 10 -- depends/classparser/CMakeLists.txt | 41 ++++++ .../classparser/include/classparser_config.h | 11 +- .../classparser/include}/javautils.h | 1 + .../classparser/src}/annotations.cpp | 0 .../classparser/src}/annotations.h | 0 {java => depends/classparser/src}/classfile.h | 0 {java => depends/classparser/src}/constants.h | 0 {java => depends/classparser/src}/errors.h | 0 .../classparser/src}/javaendian.h | 0 .../classparser/src}/javautils.cpp | 0 {java => depends/classparser/src}/membuffer.h | 0 .../groupview}/CMakeLists.txt | 2 +- .../include/categorizedsortfilterproxymodel.h | 2 +- .../groupview}/include/categorizedview.h | 2 +- .../groupview}/include/categorydrawer.h | 2 +- .../groupview/include/groupview_config.h | 0 .../src/categorizedsortfilterproxymodel.cpp | 0 .../src/categorizedsortfilterproxymodel_p.h | 0 .../groupview}/src/categorizedview.cpp | 0 .../groupview}/src/categorizedview_p.h | 0 .../groupview}/src/categorydrawer.cpp | 0 {launcher => depends/launcher}/CMakeLists.txt | 2 +- {launcher => depends/launcher}/MCFrame.java | 0 .../launcher}/MultiMCLauncher.java | 0 {launcher => depends/launcher}/UseJava.cmake | 0 .../launcher}/UseJavaClassFilelist.cmake | 0 .../launcher}/UseJavaSymlinks.cmake | 0 .../launcher}/net/minecraft/Launcher.java | 0 .../simplericity/macify/eawt/Application.java | 0 .../macify/eawt/ApplicationAdapter.java | 0 .../macify/eawt/ApplicationEvent.java | 0 .../macify/eawt/ApplicationListener.java | 0 .../macify/eawt/DefaultApplication.java | 0 {patchlib => depends/patchlib}/CMakeLists.txt | 0 {patchlib => depends/patchlib}/LICENSE-bzip2 | 0 {patchlib => depends/patchlib}/blocksort.c | 0 {patchlib => depends/patchlib}/bspatch.c | 0 {patchlib => depends/patchlib}/bspatch.h | 0 {patchlib => depends/patchlib}/bzlib.c | 0 {patchlib => depends/patchlib}/bzlib.h | 0 .../patchlib}/bzlib_private.h | 0 {patchlib => depends/patchlib}/compress.c | 0 {patchlib => depends/patchlib}/crctable.c | 0 {patchlib => depends/patchlib}/decompress.c | 0 {patchlib => depends/patchlib}/huffman.c | 0 {patchlib => depends/patchlib}/randtable.c | 0 {quazip => depends/quazip}/CMakeLists.txt | 0 {quazip => depends/quazip}/JlCompress.cpp | 0 {quazip => depends/quazip}/JlCompress.h | 0 {quazip => depends/quazip}/crypt.h | 0 {quazip => depends/quazip}/ioapi.h | 0 {quazip => depends/quazip}/qioapi.cpp | 0 {quazip => depends/quazip}/quaadler32.cpp | 0 {quazip => depends/quazip}/quaadler32.h | 0 {quazip => depends/quazip}/quachecksum32.h | 0 {quazip => depends/quazip}/quacrc32.cpp | 0 {quazip => depends/quazip}/quacrc32.h | 0 {quazip => depends/quazip}/quagzipfile.cpp | 0 {quazip => depends/quazip}/quagzipfile.h | 0 {quazip => depends/quazip}/quaziodevice.cpp | 0 {quazip => depends/quazip}/quaziodevice.h | 0 {quazip => depends/quazip}/quazip.cpp | 0 {quazip => depends/quazip}/quazip.h | 0 {quazip => depends/quazip}/quazip_global.h | 0 {quazip => depends/quazip}/quazipdir.cpp | 0 {quazip => depends/quazip}/quazipdir.h | 0 {quazip => depends/quazip}/quazipfile.cpp | 0 {quazip => depends/quazip}/quazipfile.h | 0 {quazip => depends/quazip}/quazipfileinfo.h | 0 {quazip => depends/quazip}/quazipnewinfo.cpp | 0 {quazip => depends/quazip}/quazipnewinfo.h | 0 {quazip => depends/quazip}/unzip.c | 0 {quazip => depends/quazip}/unzip.h | 0 {quazip => depends/quazip}/zip.c | 0 {quazip => depends/quazip}/zip.h | 0 .../settings}/CMakeLists.txt | 0 .../settings}/include/basicsettingsobject.h | 0 .../settings}/include/inifile.h | 0 .../settings}/include/inisettingsobject.h | 0 .../settings}/include/keyring.h | 0 .../settings}/include/libsettings_config.h | 0 .../settings}/include/overridesetting.h | 0 .../settings}/include/setting.h | 0 .../settings}/include/settingsobject.h | 0 .../settings}/src/basicsettingsobject.cpp | 0 .../settings}/src/inifile.cpp | 0 .../settings}/src/inisettingsobject.cpp | 0 .../settings}/src/keyring.cpp | 0 .../settings}/src/overridesetting.cpp | 0 .../settings}/src/setting.cpp | 0 .../settings}/src/settingsobject.cpp | 0 .../settings}/src/stubkeyring.cpp | 0 .../settings}/src/stubkeyring.h | 0 {libutil => depends/util}/CMakeLists.txt | 0 {libutil => depends/util}/include/apputils.h | 0 {libutil => depends/util}/include/cmdutils.h | 0 .../util}/include/libutil_config.h | 0 {libutil => depends/util}/include/osutils.h | 0 {libutil => depends/util}/include/pathutils.h | 0 {libutil => depends/util}/include/siglist.h | 0 .../util}/include/siglist_impl.h | 0 {libutil => depends/util}/include/userutils.h | 0 {libutil => depends/util}/src/cmdutils.cpp | 0 {libutil => depends/util}/src/osutils.cpp | 0 {libutil => depends/util}/src/pathutils.cpp | 0 {libutil => depends/util}/src/userutils.cpp | 0 gui/IconPickerDialog.cpp | 2 +- ...editdialog.cpp => LegacyModEditDialog.cpp} | 9 +- ...ymodeditdialog.h => LegacyModEditDialog.h} | 11 +- ...odeditdialog.ui => LegacyModEditDialog.ui} | 2 +- gui/consolewindow.h | 2 +- gui/instancemodel.cpp | 4 +- gui/instancemodel.h | 2 +- gui/lwjglselectdialog.cpp | 2 +- gui/mainwindow.cpp | 31 ++--- gui/mainwindow.h | 6 +- gui/modeditdialog.cpp | 2 +- gui/modeditdialog.h | 2 +- gui/modeditdialog.ui | 2 +- gui/newinstancedialog.cpp | 12 +- gui/newinstancedialog.h | 2 +- gui/taskdialog.cpp | 2 +- gui/versionselectdialog.cpp | 6 +- gui/versionselectdialog.h | 2 +- java/test.cpp | 35 ----- {backend => logic}/BaseInstance.cpp | 2 +- {backend => logic}/BaseInstance.h | 8 +- {backend => logic}/BaseInstance_p.h | 0 {backend => logic}/BaseUpdate.cpp | 0 {backend => logic}/BaseUpdate.h | 3 +- logic/CMakeLists.txt | 24 ++++ {backend => logic}/IconListModel.cpp | 0 {backend => logic}/IconListModel.h | 0 {backend => logic}/InstanceFactory.cpp | 0 {backend => logic}/InstanceFactory.h | 3 +- {backend => logic}/InstanceVersion.h | 3 +- {backend => logic}/LegacyForge.cpp | 0 {backend => logic}/LegacyForge.h | 0 {backend => logic}/LegacyInstance.cpp | 45 +++++++ {backend => logic}/LegacyInstance.h | 12 +- logic/LegacyInstance_p.h | 15 +++ {backend => logic}/LegacyUpdate.cpp | 0 {backend => logic}/LegacyUpdate.h | 3 +- {backend => logic}/MinecraftProcess.cpp | 0 {backend => logic}/MinecraftProcess.h | 6 +- {backend => logic}/MinecraftVersion.h | 4 +- {backend => logic}/Mod.cpp | 0 {backend => logic}/Mod.h | 4 +- {backend => logic}/ModList.cpp | 58 +++++++- {backend => logic}/ModList.h | 48 +++---- {backend => logic}/NostalgiaInstance.cpp | 0 {backend => logic}/NostalgiaInstance.h | 2 +- {backend => logic}/OneSixAssets.cpp | 0 {backend => logic}/OneSixAssets.h | 0 {backend => logic}/OneSixInstance.cpp | 7 + {backend => logic}/OneSixInstance.h | 4 +- {backend => logic}/OneSixInstance_p.h | 0 {backend => logic}/OneSixUpdate.cpp | 0 {backend => logic}/OneSixUpdate.h | 3 +- {backend => logic}/OneSixVersion.cpp | 0 {backend => logic}/OneSixVersion.h | 0 {backend => logic}/VersionFactory.cpp | 0 {backend => logic}/VersionFactory.h | 0 {backend => logic}/lists/InstVersionList.cpp | 4 +- {backend => logic}/lists/InstVersionList.h | 5 +- {backend => logic}/lists/InstanceList.cpp | 6 +- {backend => logic}/lists/InstanceList.h | 5 +- {backend => logic}/lists/LwjglVersionList.cpp | 2 +- {backend => logic}/lists/LwjglVersionList.h | 6 +- .../lists/MinecraftVersionList.cpp | 2 +- .../lists/MinecraftVersionList.h | 7 +- {backend => logic}/net/DownloadJob.cpp | 0 {backend => logic}/net/DownloadJob.h | 0 {backend => logic}/net/JobQueue.h | 0 {backend => logic}/net/NetWorker.cpp | 0 {backend => logic}/net/NetWorker.h | 0 {backend => logic}/tasks/LoginTask.cpp | 2 +- {backend => logic}/tasks/LoginTask.h | 3 +- {backend => logic}/tasks/Task.cpp | 0 {backend => logic}/tasks/Task.h | 4 +- main.cpp | 6 +- 184 files changed, 414 insertions(+), 345 deletions(-) delete mode 100644 backend/CMakeLists.txt delete mode 100644 backend/LegacyInstance_p.h create mode 100644 depends/classparser/CMakeLists.txt rename backend/libmmc_config.h => depends/classparser/include/classparser_config.h (83%) rename {java => depends/classparser/include}/javautils.h (96%) rename {java => depends/classparser/src}/annotations.cpp (100%) rename {java => depends/classparser/src}/annotations.h (100%) rename {java => depends/classparser/src}/classfile.h (100%) rename {java => depends/classparser/src}/constants.h (100%) rename {java => depends/classparser/src}/errors.h (100%) rename {java => depends/classparser/src}/javaendian.h (100%) rename {java => depends/classparser/src}/javautils.cpp (100%) rename {java => depends/classparser/src}/membuffer.h (100%) rename {libgroupview => depends/groupview}/CMakeLists.txt (96%) rename {libgroupview => depends/groupview}/include/categorizedsortfilterproxymodel.h (99%) rename {libgroupview => depends/groupview}/include/categorizedview.h (99%) rename {libgroupview => depends/groupview}/include/categorydrawer.h (99%) rename libgroupview/include/libgroupview_config.h => depends/groupview/include/groupview_config.h (100%) rename {libgroupview => depends/groupview}/src/categorizedsortfilterproxymodel.cpp (100%) rename {libgroupview => depends/groupview}/src/categorizedsortfilterproxymodel_p.h (100%) rename {libgroupview => depends/groupview}/src/categorizedview.cpp (100%) rename {libgroupview => depends/groupview}/src/categorizedview_p.h (100%) rename {libgroupview => depends/groupview}/src/categorydrawer.cpp (100%) rename {launcher => depends/launcher}/CMakeLists.txt (90%) rename {launcher => depends/launcher}/MCFrame.java (100%) rename {launcher => depends/launcher}/MultiMCLauncher.java (100%) rename {launcher => depends/launcher}/UseJava.cmake (100%) rename {launcher => depends/launcher}/UseJavaClassFilelist.cmake (100%) rename {launcher => depends/launcher}/UseJavaSymlinks.cmake (100%) rename {launcher => depends/launcher}/net/minecraft/Launcher.java (100%) rename {launcher => depends/launcher}/org/simplericity/macify/eawt/Application.java (100%) rename {launcher => depends/launcher}/org/simplericity/macify/eawt/ApplicationAdapter.java (100%) rename {launcher => depends/launcher}/org/simplericity/macify/eawt/ApplicationEvent.java (100%) rename {launcher => depends/launcher}/org/simplericity/macify/eawt/ApplicationListener.java (100%) rename {launcher => depends/launcher}/org/simplericity/macify/eawt/DefaultApplication.java (100%) rename {patchlib => depends/patchlib}/CMakeLists.txt (100%) rename {patchlib => depends/patchlib}/LICENSE-bzip2 (100%) rename {patchlib => depends/patchlib}/blocksort.c (100%) rename {patchlib => depends/patchlib}/bspatch.c (100%) rename {patchlib => depends/patchlib}/bspatch.h (100%) rename {patchlib => depends/patchlib}/bzlib.c (100%) rename {patchlib => depends/patchlib}/bzlib.h (100%) rename {patchlib => depends/patchlib}/bzlib_private.h (100%) rename {patchlib => depends/patchlib}/compress.c (100%) rename {patchlib => depends/patchlib}/crctable.c (100%) rename {patchlib => depends/patchlib}/decompress.c (100%) rename {patchlib => depends/patchlib}/huffman.c (100%) rename {patchlib => depends/patchlib}/randtable.c (100%) rename {quazip => depends/quazip}/CMakeLists.txt (100%) rename {quazip => depends/quazip}/JlCompress.cpp (100%) rename {quazip => depends/quazip}/JlCompress.h (100%) rename {quazip => depends/quazip}/crypt.h (100%) rename {quazip => depends/quazip}/ioapi.h (100%) rename {quazip => depends/quazip}/qioapi.cpp (100%) rename {quazip => depends/quazip}/quaadler32.cpp (100%) rename {quazip => depends/quazip}/quaadler32.h (100%) rename {quazip => depends/quazip}/quachecksum32.h (100%) rename {quazip => depends/quazip}/quacrc32.cpp (100%) rename {quazip => depends/quazip}/quacrc32.h (100%) rename {quazip => depends/quazip}/quagzipfile.cpp (100%) rename {quazip => depends/quazip}/quagzipfile.h (100%) rename {quazip => depends/quazip}/quaziodevice.cpp (100%) rename {quazip => depends/quazip}/quaziodevice.h (100%) rename {quazip => depends/quazip}/quazip.cpp (100%) rename {quazip => depends/quazip}/quazip.h (100%) rename {quazip => depends/quazip}/quazip_global.h (100%) rename {quazip => depends/quazip}/quazipdir.cpp (100%) rename {quazip => depends/quazip}/quazipdir.h (100%) rename {quazip => depends/quazip}/quazipfile.cpp (100%) rename {quazip => depends/quazip}/quazipfile.h (100%) rename {quazip => depends/quazip}/quazipfileinfo.h (100%) rename {quazip => depends/quazip}/quazipnewinfo.cpp (100%) rename {quazip => depends/quazip}/quazipnewinfo.h (100%) rename {quazip => depends/quazip}/unzip.c (100%) rename {quazip => depends/quazip}/unzip.h (100%) rename {quazip => depends/quazip}/zip.c (100%) rename {quazip => depends/quazip}/zip.h (100%) rename {libsettings => depends/settings}/CMakeLists.txt (100%) rename {libsettings => depends/settings}/include/basicsettingsobject.h (100%) rename {libsettings => depends/settings}/include/inifile.h (100%) rename {libsettings => depends/settings}/include/inisettingsobject.h (100%) rename {libsettings => depends/settings}/include/keyring.h (100%) rename {libsettings => depends/settings}/include/libsettings_config.h (100%) rename {libsettings => depends/settings}/include/overridesetting.h (100%) rename {libsettings => depends/settings}/include/setting.h (100%) rename {libsettings => depends/settings}/include/settingsobject.h (100%) rename {libsettings => depends/settings}/src/basicsettingsobject.cpp (100%) rename {libsettings => depends/settings}/src/inifile.cpp (100%) rename {libsettings => depends/settings}/src/inisettingsobject.cpp (100%) rename {libsettings => depends/settings}/src/keyring.cpp (100%) rename {libsettings => depends/settings}/src/overridesetting.cpp (100%) rename {libsettings => depends/settings}/src/setting.cpp (100%) rename {libsettings => depends/settings}/src/settingsobject.cpp (100%) rename {libsettings => depends/settings}/src/stubkeyring.cpp (100%) rename {libsettings => depends/settings}/src/stubkeyring.h (100%) rename {libutil => depends/util}/CMakeLists.txt (100%) rename {libutil => depends/util}/include/apputils.h (100%) rename {libutil => depends/util}/include/cmdutils.h (100%) rename {libutil => depends/util}/include/libutil_config.h (100%) rename {libutil => depends/util}/include/osutils.h (100%) rename {libutil => depends/util}/include/pathutils.h (100%) rename {libutil => depends/util}/include/siglist.h (100%) rename {libutil => depends/util}/include/siglist_impl.h (100%) rename {libutil => depends/util}/include/userutils.h (100%) rename {libutil => depends/util}/src/cmdutils.cpp (100%) rename {libutil => depends/util}/src/osutils.cpp (100%) rename {libutil => depends/util}/src/pathutils.cpp (100%) rename {libutil => depends/util}/src/userutils.cpp (100%) rename gui/{legacymodeditdialog.cpp => LegacyModEditDialog.cpp} (81%) rename gui/{legacymodeditdialog.h => LegacyModEditDialog.h} (87%) rename gui/{legacymodeditdialog.ui => LegacyModEditDialog.ui} (99%) delete mode 100644 java/test.cpp rename {backend => logic}/BaseInstance.cpp (99%) rename {backend => logic}/BaseInstance.h (96%) rename {backend => logic}/BaseInstance_p.h (100%) rename {backend => logic}/BaseUpdate.cpp (100%) rename {backend => logic}/BaseUpdate.h (93%) create mode 100644 logic/CMakeLists.txt rename {backend => logic}/IconListModel.cpp (100%) rename {backend => logic}/IconListModel.h (100%) rename {backend => logic}/InstanceFactory.cpp (100%) rename {backend => logic}/InstanceFactory.h (96%) rename {backend => logic}/InstanceVersion.h (96%) rename {backend => logic}/LegacyForge.cpp (100%) rename {backend => logic}/LegacyForge.h (100%) rename {backend => logic}/LegacyInstance.cpp (85%) rename {backend => logic}/LegacyInstance.h (89%) create mode 100644 logic/LegacyInstance_p.h rename {backend => logic}/LegacyUpdate.cpp (100%) rename {backend => logic}/LegacyUpdate.h (94%) rename {backend => logic}/MinecraftProcess.cpp (100%) rename {backend => logic}/MinecraftProcess.h (94%) rename {backend => logic}/MinecraftVersion.h (94%) rename {backend => logic}/Mod.cpp (100%) rename {backend => logic}/Mod.h (94%) rename {backend => logic}/ModList.cpp (88%) rename {backend => logic}/ModList.h (55%) rename {backend => logic}/NostalgiaInstance.cpp (100%) rename {backend => logic}/NostalgiaInstance.h (71%) rename {backend => logic}/OneSixAssets.cpp (100%) rename {backend => logic}/OneSixAssets.h (100%) rename {backend => logic}/OneSixInstance.cpp (97%) rename {backend => logic}/OneSixInstance.h (88%) rename {backend => logic}/OneSixInstance_p.h (100%) rename {backend => logic}/OneSixUpdate.cpp (100%) rename {backend => logic}/OneSixUpdate.h (93%) rename {backend => logic}/OneSixVersion.cpp (100%) rename {backend => logic}/OneSixVersion.h (100%) rename {backend => logic}/VersionFactory.cpp (100%) rename {backend => logic}/VersionFactory.h (100%) rename {backend => logic}/lists/InstVersionList.cpp (96%) rename {backend => logic}/lists/InstVersionList.h (96%) rename {backend => logic}/lists/InstanceList.cpp (98%) rename {backend => logic}/lists/InstanceList.h (94%) rename {backend => logic}/lists/LwjglVersionList.cpp (99%) rename {backend => logic}/lists/LwjglVersionList.h (95%) rename {backend => logic}/lists/MinecraftVersionList.cpp (99%) rename {backend => logic}/lists/MinecraftVersionList.h (92%) rename {backend => logic}/net/DownloadJob.cpp (100%) rename {backend => logic}/net/DownloadJob.h (100%) rename {backend => logic}/net/JobQueue.h (100%) rename {backend => logic}/net/NetWorker.cpp (100%) rename {backend => logic}/net/NetWorker.h (100%) rename {backend => logic}/tasks/LoginTask.cpp (98%) rename {backend => logic}/tasks/LoginTask.h (94%) rename {backend => logic}/tasks/Task.cpp (100%) rename {backend => logic}/tasks/Task.h (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d907e152..84d8a6f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,33 +43,28 @@ find_package(ZLIB REQUIRED) ######## Included Libs ######## # Add quazip -add_subdirectory(quazip) -include_directories(quazip ${ZLIB_INCLUDE_DIRS}) +add_subdirectory(depends/quazip) +include_directories(depends/quazip ${ZLIB_INCLUDE_DIRS}) # Add bspatch -add_subdirectory(patchlib) -include_directories(patchlib) +add_subdirectory(depends/patchlib) +include_directories(depends/patchlib) # Add the java launcher -add_subdirectory(launcher) - +add_subdirectory(depends/launcher) ######## MultiMC Libs ######## # Add the util library. -add_subdirectory(libutil) +add_subdirectory(depends/util) include_directories(${LIBUTIL_INCLUDE_DIR}) # Add the settings library. -add_subdirectory(libsettings) +add_subdirectory(depends/settings) include_directories(${LIBSETTINGS_INCLUDE_DIR}) -# Add the instance library. -add_subdirectory(backend) -include_directories(${LIBMULTIMC_INCLUDE_DIR}) - # Add the group view library. -add_subdirectory(libgroupview) +add_subdirectory(depends/groupview) include_directories(${LIBGROUPVIEW_INCLUDE_DIR}) @@ -164,7 +159,6 @@ AppSettings.h gui/mainwindow.h gui/modeditdialog.h -gui/legacymodeditdialog.h gui/settingsdialog.h gui/newinstancedialog.h gui/logindialog.h @@ -178,14 +172,51 @@ gui/versionselectdialog.h gui/lwjglselectdialog.h gui/instancesettings.h gui/IconPickerDialog.h +gui/LegacyModEditDialog.h -java/annotations.h -java/classfile.h -java/constants.h -java/javaendian.h -java/errors.h -java/javautils.h -java/membuffer.h +# Base classes and infrastructure +logic/InstanceVersion.h +logic/MinecraftVersion.h +logic/InstanceFactory.h +logic/BaseUpdate.h +logic/BaseInstance.h +logic/BaseInstance_p.h +logic/MinecraftProcess.h +logic/Mod.h +logic/ModList.h + +# network stuffs +logic/net/DownloadJob.h +logic/net/JobQueue.h +logic/net/NetWorker.h + +# legacy instances +logic/LegacyInstance.h +logic/LegacyInstance_p.h +logic/LegacyUpdate.h +logic/LegacyForge.h + +# 1.6 instances +logic/OneSixAssets.h +logic/OneSixInstance.h +logic/OneSixInstance_p.h +logic/OneSixUpdate.h +logic/OneSixVersion.h +logic/VersionFactory.h + +# Nostalgia +logic/NostalgiaInstance.h + +# Lists +logic/lists/InstanceList.h +logic/lists/InstVersionList.h +logic/lists/MinecraftVersionList.h +logic/lists/LwjglVersionList.h +logic/IconListModel.h + +# Tasks +logic/tasks/Task.h +logic/tasks/LoginTask.h ) @@ -197,7 +228,6 @@ AppSettings.cpp gui/mainwindow.cpp gui/modeditdialog.cpp -gui/legacymodeditdialog.cpp gui/settingsdialog.cpp gui/newinstancedialog.cpp gui/logindialog.cpp @@ -211,9 +241,45 @@ gui/versionselectdialog.cpp gui/lwjglselectdialog.cpp gui/instancesettings.cpp gui/IconPickerDialog.cpp +gui/LegacyModEditDialog.cpp -java/javautils.cpp -java/annotations.cpp +# Base classes and infrastructure +logic/InstanceFactory.cpp +logic/BaseUpdate.cpp +logic/BaseInstance.cpp +logic/MinecraftProcess.cpp +logic/Mod.cpp +logic/ModList.cpp + +# network stuffs - to be moved into a depend lib ~_~ +logic/net/NetWorker.cpp +logic/net/DownloadJob.cpp + +# legacy instances +logic/LegacyInstance.cpp +logic/LegacyUpdate.cpp +logic/LegacyForge.cpp + +# 1.6 instances +logic/OneSixAssets.cpp +logic/OneSixInstance.cpp +logic/OneSixVersion.cpp +logic/OneSixUpdate.cpp +logic/VersionFactory.cpp + +# Nostalgia +logic/NostalgiaInstance.cpp + +# Lists +logic/lists/InstanceList.cpp +logic/lists/InstVersionList.cpp +logic/lists/MinecraftVersionList.cpp +logic/lists/LwjglVersionList.cpp +logic/IconListModel.cpp + +# Tasks +logic/tasks/Task.cpp +logic/tasks/LoginTask.cpp ) @@ -221,7 +287,6 @@ java/annotations.cpp SET(MULTIMC_UIS gui/mainwindow.ui gui/modeditdialog.ui -gui/legacymodeditdialog.ui gui/settingsdialog.ui gui/newinstancedialog.ui gui/logindialog.ui @@ -233,6 +298,7 @@ gui/versionselectdialog.ui gui/lwjglselectdialog.ui gui/instancesettings.ui gui/IconPickerDialog.ui +gui/LegacyModEditDialog.ui ) @@ -270,11 +336,9 @@ ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32 ${MULTIMC_SOURCES} ${MULTIMC_HEADERS} ${MULTIMC_UI} ${MULTIMC_QRC} ${MULTIMC_RCS}) # Link -QT5_USE_MODULES(MultiMC Widgets Network WebKitWidgets) -TARGET_LINK_LIBRARIES(MultiMC quazip patchlib -libUtil libSettings backend libGroupView -${MultiMC_LINK_ADDITIONAL_LIBS}) -ADD_DEPENDENCIES(MultiMC MultiMCLauncher libUtil libSettings backend libGroupView) +QT5_USE_MODULES(MultiMC Widgets Network WebKitWidgets Xml) +TARGET_LINK_LIBRARIES(MultiMC quazip patchlib libUtil libSettings libGroupView ${MultiMC_LINK_ADDITIONAL_LIBS}) +ADD_DEPENDENCIES(MultiMC MultiMCLauncher libUtil libSettings libGroupView) option(BUILD_KEYRING_TEST "Build the simple keyring test binary" OFF) diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt deleted file mode 100644 index 7a92d5cf..00000000 --- a/backend/CMakeLists.txt +++ /dev/null @@ -1,120 +0,0 @@ -project(libMultiMC) - -set(CMAKE_AUTOMOC ON) - -# Find Qt -find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED) -find_package(Qt5Xml REQUIRED) - -# Include Qt headers. -include_directories(${Qt5Base_INCLUDE_DIRS}) -include_directories(${Qt5Network_INCLUDE_DIRS}) - -# Include utility library. -include_directories(${CMAKE_SOURCE_DIR}/libutil/include) - -# Include settings library. -include_directories(${CMAKE_SOURCE_DIR}/libsettings/include) - -SET(LIBINST_HEADERS -libmmc_config.h - -# Base classes and infrastructure -InstanceVersion.h -MinecraftVersion.h -InstanceFactory.h -BaseUpdate.h -BaseInstance.h -BaseInstance_p.h -MinecraftProcess.h -Mod.h -ModList.h - -# network stuffs -net/DownloadJob.h -net/JobQueue.h -net/NetWorker.h - -# legacy instances -LegacyInstance.h -LegacyInstance_p.h -LegacyUpdate.h -LegacyForge.h - -# 1.6 instances -OneSixAssets.h -OneSixInstance.h -OneSixInstance_p.h -OneSixUpdate.h -OneSixVersion.h -VersionFactory.h - -# Nostalgia -NostalgiaInstance.h - -# Lists -lists/InstanceList.h -lists/InstVersionList.h -lists/MinecraftVersionList.h -lists/LwjglVersionList.h -IconListModel.h - -# Tasks -tasks/Task.h -tasks/LoginTask.h -) - -SET(LIBINST_SOURCES -# Base classes and infrastructure -InstanceFactory.cpp -BaseUpdate.cpp -BaseInstance.cpp -MinecraftProcess.cpp -Mod.cpp -ModList.cpp - -# network stuffs -net/NetWorker.cpp -net/DownloadJob.cpp - -# legacy instances -LegacyInstance.cpp -LegacyUpdate.cpp -LegacyForge.cpp - -# 1.6 instances -OneSixAssets.cpp -OneSixInstance.cpp -OneSixVersion.cpp -OneSixUpdate.cpp -VersionFactory.cpp - -# Nostalgia -NostalgiaInstance.cpp - -# Lists -lists/InstanceList.cpp -lists/InstVersionList.cpp -lists/MinecraftVersionList.cpp -lists/LwjglVersionList.cpp -IconListModel.cpp - -# Tasks -tasks/Task.cpp -tasks/LoginTask.cpp -) - -# Set the include dir path. -SET(LIBMULTIMC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE) - -# Include self. -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -include_directories(${CMAKE_BINARY_DIR}/include) - -add_definitions(-DLIBMULTIMC_LIBRARY) - -add_library(backend SHARED ${LIBINST_SOURCES} ${LIBINST_HEADERS}) -qt5_use_modules(backend Core Network Xml) -target_link_libraries(backend libUtil libSettings quazip) - diff --git a/backend/LegacyInstance_p.h b/backend/LegacyInstance_p.h deleted file mode 100644 index ac367e20..00000000 --- a/backend/LegacyInstance_p.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once -#include -#include -#include "BaseInstance_p.h" - -class BaseInstance; - -struct LegacyInstancePrivate: public BaseInstancePrivate -{ -}; \ No newline at end of file diff --git a/depends/classparser/CMakeLists.txt b/depends/classparser/CMakeLists.txt new file mode 100644 index 00000000..5a48e002 --- /dev/null +++ b/depends/classparser/CMakeLists.txt @@ -0,0 +1,41 @@ +project(classparser) + +set(CMAKE_AUTOMOC ON) + +# Find Qt +find_package(Qt5Core REQUIRED) + +# Include Qt headers. +include_directories(${Qt5Base_INCLUDE_DIRS}) + +SET(CLASSPARSER_HEADERS +include/classparser_config.h + +# Public headers +include/javautils.h + +# Private headers +src/annotations.h +src/classfile.h +src/constants.h +src/errors.h +src/javaendian.h +src/membuffer.h +) + +SET(CLASSPARSER_SOURCES +src/javautils.cpp +src/annotations.cpp +) + +# Set the include dir path. +SET(LIBGROUPVIEW_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE) + +# Include self. +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +include_directories(${CMAKE_BINARY_DIR}/include) + +add_definitions(-DCLASSPARSER_LIBRARY) + +add_library(classparser SHARED ${CLASSPARSER_SOURCES} ${CLASSPARSER_HEADERS}) +qt5_use_modules(classparser Core) diff --git a/backend/libmmc_config.h b/depends/classparser/include/classparser_config.h similarity index 83% rename from backend/libmmc_config.h rename to depends/classparser/include/classparser_config.h index 6d967f5f..fe6a2ab9 100644 --- a/backend/libmmc_config.h +++ b/depends/classparser/include/classparser_config.h @@ -3,7 +3,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software @@ -13,12 +13,11 @@ * limitations under the License. */ -#pragma once - #include -#ifdef LIBMULTIMC_LIBRARY -# define LIBMULTIMC_EXPORT Q_DECL_EXPORT +#ifdef CLASSPARSER_LIBRARY +# define CLASSPARSER_EXPORT Q_DECL_EXPORT #else -# define LIBMULTIMC_EXPORT Q_DECL_IMPORT +# define CLASSPARSER_EXPORT Q_DECL_IMPORT #endif + diff --git a/java/javautils.h b/depends/classparser/include/javautils.h similarity index 96% rename from java/javautils.h rename to depends/classparser/include/javautils.h index 883eff1d..63e5ec26 100644 --- a/java/javautils.h +++ b/depends/classparser/include/javautils.h @@ -16,6 +16,7 @@ */ #pragma once #include +#include "classparser_config.h" #define MCVer_Unknown "Unknown" diff --git a/java/annotations.cpp b/depends/classparser/src/annotations.cpp similarity index 100% rename from java/annotations.cpp rename to depends/classparser/src/annotations.cpp diff --git a/java/annotations.h b/depends/classparser/src/annotations.h similarity index 100% rename from java/annotations.h rename to depends/classparser/src/annotations.h diff --git a/java/classfile.h b/depends/classparser/src/classfile.h similarity index 100% rename from java/classfile.h rename to depends/classparser/src/classfile.h diff --git a/java/constants.h b/depends/classparser/src/constants.h similarity index 100% rename from java/constants.h rename to depends/classparser/src/constants.h diff --git a/java/errors.h b/depends/classparser/src/errors.h similarity index 100% rename from java/errors.h rename to depends/classparser/src/errors.h diff --git a/java/javaendian.h b/depends/classparser/src/javaendian.h similarity index 100% rename from java/javaendian.h rename to depends/classparser/src/javaendian.h diff --git a/java/javautils.cpp b/depends/classparser/src/javautils.cpp similarity index 100% rename from java/javautils.cpp rename to depends/classparser/src/javautils.cpp diff --git a/java/membuffer.h b/depends/classparser/src/membuffer.h similarity index 100% rename from java/membuffer.h rename to depends/classparser/src/membuffer.h diff --git a/libgroupview/CMakeLists.txt b/depends/groupview/CMakeLists.txt similarity index 96% rename from libgroupview/CMakeLists.txt rename to depends/groupview/CMakeLists.txt index d60d914a..3fa2b044 100644 --- a/libgroupview/CMakeLists.txt +++ b/depends/groupview/CMakeLists.txt @@ -10,7 +10,7 @@ find_package(Qt5Widgets REQUIRED) include_directories(${Qt5Base_INCLUDE_DIRS}) SET(LIBGROUPVIEW_HEADERS -include/libgroupview_config.h +include/groupview_config.h # Public headers include/categorizedsortfilterproxymodel.h diff --git a/libgroupview/include/categorizedsortfilterproxymodel.h b/depends/groupview/include/categorizedsortfilterproxymodel.h similarity index 99% rename from libgroupview/include/categorizedsortfilterproxymodel.h rename to depends/groupview/include/categorizedsortfilterproxymodel.h index 1ef39fc2..d90fb254 100644 --- a/libgroupview/include/categorizedsortfilterproxymodel.h +++ b/depends/groupview/include/categorizedsortfilterproxymodel.h @@ -24,7 +24,7 @@ #include -#include +#include class QItemSelection; diff --git a/libgroupview/include/categorizedview.h b/depends/groupview/include/categorizedview.h similarity index 99% rename from libgroupview/include/categorizedview.h rename to depends/groupview/include/categorizedview.h index 243ccf15..81b1dbb1 100644 --- a/libgroupview/include/categorizedview.h +++ b/depends/groupview/include/categorizedview.h @@ -23,7 +23,7 @@ #include -#include +#include class KCategoryDrawer; diff --git a/libgroupview/include/categorydrawer.h b/depends/groupview/include/categorydrawer.h similarity index 99% rename from libgroupview/include/categorydrawer.h rename to depends/groupview/include/categorydrawer.h index aa561f0d..f37422ec 100644 --- a/libgroupview/include/categorydrawer.h +++ b/depends/groupview/include/categorydrawer.h @@ -21,7 +21,7 @@ #ifndef KCATEGORYDRAWER_H #define KCATEGORYDRAWER_H -#include +#include #include #include diff --git a/libgroupview/include/libgroupview_config.h b/depends/groupview/include/groupview_config.h similarity index 100% rename from libgroupview/include/libgroupview_config.h rename to depends/groupview/include/groupview_config.h diff --git a/libgroupview/src/categorizedsortfilterproxymodel.cpp b/depends/groupview/src/categorizedsortfilterproxymodel.cpp similarity index 100% rename from libgroupview/src/categorizedsortfilterproxymodel.cpp rename to depends/groupview/src/categorizedsortfilterproxymodel.cpp diff --git a/libgroupview/src/categorizedsortfilterproxymodel_p.h b/depends/groupview/src/categorizedsortfilterproxymodel_p.h similarity index 100% rename from libgroupview/src/categorizedsortfilterproxymodel_p.h rename to depends/groupview/src/categorizedsortfilterproxymodel_p.h diff --git a/libgroupview/src/categorizedview.cpp b/depends/groupview/src/categorizedview.cpp similarity index 100% rename from libgroupview/src/categorizedview.cpp rename to depends/groupview/src/categorizedview.cpp diff --git a/libgroupview/src/categorizedview_p.h b/depends/groupview/src/categorizedview_p.h similarity index 100% rename from libgroupview/src/categorizedview_p.h rename to depends/groupview/src/categorizedview_p.h diff --git a/libgroupview/src/categorydrawer.cpp b/depends/groupview/src/categorydrawer.cpp similarity index 100% rename from libgroupview/src/categorydrawer.cpp rename to depends/groupview/src/categorydrawer.cpp diff --git a/launcher/CMakeLists.txt b/depends/launcher/CMakeLists.txt similarity index 90% rename from launcher/CMakeLists.txt rename to depends/launcher/CMakeLists.txt index 7f189458..e5402ce7 100644 --- a/launcher/CMakeLists.txt +++ b/depends/launcher/CMakeLists.txt @@ -7,7 +7,7 @@ find_package(Java 1.6 REQUIRED COMPONENTS Development) include(UseJava) set(CMAKE_JAVA_JAR_ENTRY_POINT MultiMCLauncher) set(CMAKE_JAVA_COMPILE_FLAGS -target 1.6 -source 1.6 -Xlint:deprecation -Xlint:unchecked) -set(CMAKE_JAVA_TARGET_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/../resources") +set(CMAKE_JAVA_TARGET_OUTPUT_DIR "${PROJECT_SOURCE_DIR}/../../resources") set(SRC MultiMCLauncher.java diff --git a/launcher/MCFrame.java b/depends/launcher/MCFrame.java similarity index 100% rename from launcher/MCFrame.java rename to depends/launcher/MCFrame.java diff --git a/launcher/MultiMCLauncher.java b/depends/launcher/MultiMCLauncher.java similarity index 100% rename from launcher/MultiMCLauncher.java rename to depends/launcher/MultiMCLauncher.java diff --git a/launcher/UseJava.cmake b/depends/launcher/UseJava.cmake similarity index 100% rename from launcher/UseJava.cmake rename to depends/launcher/UseJava.cmake diff --git a/launcher/UseJavaClassFilelist.cmake b/depends/launcher/UseJavaClassFilelist.cmake similarity index 100% rename from launcher/UseJavaClassFilelist.cmake rename to depends/launcher/UseJavaClassFilelist.cmake diff --git a/launcher/UseJavaSymlinks.cmake b/depends/launcher/UseJavaSymlinks.cmake similarity index 100% rename from launcher/UseJavaSymlinks.cmake rename to depends/launcher/UseJavaSymlinks.cmake diff --git a/launcher/net/minecraft/Launcher.java b/depends/launcher/net/minecraft/Launcher.java similarity index 100% rename from launcher/net/minecraft/Launcher.java rename to depends/launcher/net/minecraft/Launcher.java diff --git a/launcher/org/simplericity/macify/eawt/Application.java b/depends/launcher/org/simplericity/macify/eawt/Application.java similarity index 100% rename from launcher/org/simplericity/macify/eawt/Application.java rename to depends/launcher/org/simplericity/macify/eawt/Application.java diff --git a/launcher/org/simplericity/macify/eawt/ApplicationAdapter.java b/depends/launcher/org/simplericity/macify/eawt/ApplicationAdapter.java similarity index 100% rename from launcher/org/simplericity/macify/eawt/ApplicationAdapter.java rename to depends/launcher/org/simplericity/macify/eawt/ApplicationAdapter.java diff --git a/launcher/org/simplericity/macify/eawt/ApplicationEvent.java b/depends/launcher/org/simplericity/macify/eawt/ApplicationEvent.java similarity index 100% rename from launcher/org/simplericity/macify/eawt/ApplicationEvent.java rename to depends/launcher/org/simplericity/macify/eawt/ApplicationEvent.java diff --git a/launcher/org/simplericity/macify/eawt/ApplicationListener.java b/depends/launcher/org/simplericity/macify/eawt/ApplicationListener.java similarity index 100% rename from launcher/org/simplericity/macify/eawt/ApplicationListener.java rename to depends/launcher/org/simplericity/macify/eawt/ApplicationListener.java diff --git a/launcher/org/simplericity/macify/eawt/DefaultApplication.java b/depends/launcher/org/simplericity/macify/eawt/DefaultApplication.java similarity index 100% rename from launcher/org/simplericity/macify/eawt/DefaultApplication.java rename to depends/launcher/org/simplericity/macify/eawt/DefaultApplication.java diff --git a/patchlib/CMakeLists.txt b/depends/patchlib/CMakeLists.txt similarity index 100% rename from patchlib/CMakeLists.txt rename to depends/patchlib/CMakeLists.txt diff --git a/patchlib/LICENSE-bzip2 b/depends/patchlib/LICENSE-bzip2 similarity index 100% rename from patchlib/LICENSE-bzip2 rename to depends/patchlib/LICENSE-bzip2 diff --git a/patchlib/blocksort.c b/depends/patchlib/blocksort.c similarity index 100% rename from patchlib/blocksort.c rename to depends/patchlib/blocksort.c diff --git a/patchlib/bspatch.c b/depends/patchlib/bspatch.c similarity index 100% rename from patchlib/bspatch.c rename to depends/patchlib/bspatch.c diff --git a/patchlib/bspatch.h b/depends/patchlib/bspatch.h similarity index 100% rename from patchlib/bspatch.h rename to depends/patchlib/bspatch.h diff --git a/patchlib/bzlib.c b/depends/patchlib/bzlib.c similarity index 100% rename from patchlib/bzlib.c rename to depends/patchlib/bzlib.c diff --git a/patchlib/bzlib.h b/depends/patchlib/bzlib.h similarity index 100% rename from patchlib/bzlib.h rename to depends/patchlib/bzlib.h diff --git a/patchlib/bzlib_private.h b/depends/patchlib/bzlib_private.h similarity index 100% rename from patchlib/bzlib_private.h rename to depends/patchlib/bzlib_private.h diff --git a/patchlib/compress.c b/depends/patchlib/compress.c similarity index 100% rename from patchlib/compress.c rename to depends/patchlib/compress.c diff --git a/patchlib/crctable.c b/depends/patchlib/crctable.c similarity index 100% rename from patchlib/crctable.c rename to depends/patchlib/crctable.c diff --git a/patchlib/decompress.c b/depends/patchlib/decompress.c similarity index 100% rename from patchlib/decompress.c rename to depends/patchlib/decompress.c diff --git a/patchlib/huffman.c b/depends/patchlib/huffman.c similarity index 100% rename from patchlib/huffman.c rename to depends/patchlib/huffman.c diff --git a/patchlib/randtable.c b/depends/patchlib/randtable.c similarity index 100% rename from patchlib/randtable.c rename to depends/patchlib/randtable.c diff --git a/quazip/CMakeLists.txt b/depends/quazip/CMakeLists.txt similarity index 100% rename from quazip/CMakeLists.txt rename to depends/quazip/CMakeLists.txt diff --git a/quazip/JlCompress.cpp b/depends/quazip/JlCompress.cpp similarity index 100% rename from quazip/JlCompress.cpp rename to depends/quazip/JlCompress.cpp diff --git a/quazip/JlCompress.h b/depends/quazip/JlCompress.h similarity index 100% rename from quazip/JlCompress.h rename to depends/quazip/JlCompress.h diff --git a/quazip/crypt.h b/depends/quazip/crypt.h similarity index 100% rename from quazip/crypt.h rename to depends/quazip/crypt.h diff --git a/quazip/ioapi.h b/depends/quazip/ioapi.h similarity index 100% rename from quazip/ioapi.h rename to depends/quazip/ioapi.h diff --git a/quazip/qioapi.cpp b/depends/quazip/qioapi.cpp similarity index 100% rename from quazip/qioapi.cpp rename to depends/quazip/qioapi.cpp diff --git a/quazip/quaadler32.cpp b/depends/quazip/quaadler32.cpp similarity index 100% rename from quazip/quaadler32.cpp rename to depends/quazip/quaadler32.cpp diff --git a/quazip/quaadler32.h b/depends/quazip/quaadler32.h similarity index 100% rename from quazip/quaadler32.h rename to depends/quazip/quaadler32.h diff --git a/quazip/quachecksum32.h b/depends/quazip/quachecksum32.h similarity index 100% rename from quazip/quachecksum32.h rename to depends/quazip/quachecksum32.h diff --git a/quazip/quacrc32.cpp b/depends/quazip/quacrc32.cpp similarity index 100% rename from quazip/quacrc32.cpp rename to depends/quazip/quacrc32.cpp diff --git a/quazip/quacrc32.h b/depends/quazip/quacrc32.h similarity index 100% rename from quazip/quacrc32.h rename to depends/quazip/quacrc32.h diff --git a/quazip/quagzipfile.cpp b/depends/quazip/quagzipfile.cpp similarity index 100% rename from quazip/quagzipfile.cpp rename to depends/quazip/quagzipfile.cpp diff --git a/quazip/quagzipfile.h b/depends/quazip/quagzipfile.h similarity index 100% rename from quazip/quagzipfile.h rename to depends/quazip/quagzipfile.h diff --git a/quazip/quaziodevice.cpp b/depends/quazip/quaziodevice.cpp similarity index 100% rename from quazip/quaziodevice.cpp rename to depends/quazip/quaziodevice.cpp diff --git a/quazip/quaziodevice.h b/depends/quazip/quaziodevice.h similarity index 100% rename from quazip/quaziodevice.h rename to depends/quazip/quaziodevice.h diff --git a/quazip/quazip.cpp b/depends/quazip/quazip.cpp similarity index 100% rename from quazip/quazip.cpp rename to depends/quazip/quazip.cpp diff --git a/quazip/quazip.h b/depends/quazip/quazip.h similarity index 100% rename from quazip/quazip.h rename to depends/quazip/quazip.h diff --git a/quazip/quazip_global.h b/depends/quazip/quazip_global.h similarity index 100% rename from quazip/quazip_global.h rename to depends/quazip/quazip_global.h diff --git a/quazip/quazipdir.cpp b/depends/quazip/quazipdir.cpp similarity index 100% rename from quazip/quazipdir.cpp rename to depends/quazip/quazipdir.cpp diff --git a/quazip/quazipdir.h b/depends/quazip/quazipdir.h similarity index 100% rename from quazip/quazipdir.h rename to depends/quazip/quazipdir.h diff --git a/quazip/quazipfile.cpp b/depends/quazip/quazipfile.cpp similarity index 100% rename from quazip/quazipfile.cpp rename to depends/quazip/quazipfile.cpp diff --git a/quazip/quazipfile.h b/depends/quazip/quazipfile.h similarity index 100% rename from quazip/quazipfile.h rename to depends/quazip/quazipfile.h diff --git a/quazip/quazipfileinfo.h b/depends/quazip/quazipfileinfo.h similarity index 100% rename from quazip/quazipfileinfo.h rename to depends/quazip/quazipfileinfo.h diff --git a/quazip/quazipnewinfo.cpp b/depends/quazip/quazipnewinfo.cpp similarity index 100% rename from quazip/quazipnewinfo.cpp rename to depends/quazip/quazipnewinfo.cpp diff --git a/quazip/quazipnewinfo.h b/depends/quazip/quazipnewinfo.h similarity index 100% rename from quazip/quazipnewinfo.h rename to depends/quazip/quazipnewinfo.h diff --git a/quazip/unzip.c b/depends/quazip/unzip.c similarity index 100% rename from quazip/unzip.c rename to depends/quazip/unzip.c diff --git a/quazip/unzip.h b/depends/quazip/unzip.h similarity index 100% rename from quazip/unzip.h rename to depends/quazip/unzip.h diff --git a/quazip/zip.c b/depends/quazip/zip.c similarity index 100% rename from quazip/zip.c rename to depends/quazip/zip.c diff --git a/quazip/zip.h b/depends/quazip/zip.h similarity index 100% rename from quazip/zip.h rename to depends/quazip/zip.h diff --git a/libsettings/CMakeLists.txt b/depends/settings/CMakeLists.txt similarity index 100% rename from libsettings/CMakeLists.txt rename to depends/settings/CMakeLists.txt diff --git a/libsettings/include/basicsettingsobject.h b/depends/settings/include/basicsettingsobject.h similarity index 100% rename from libsettings/include/basicsettingsobject.h rename to depends/settings/include/basicsettingsobject.h diff --git a/libsettings/include/inifile.h b/depends/settings/include/inifile.h similarity index 100% rename from libsettings/include/inifile.h rename to depends/settings/include/inifile.h diff --git a/libsettings/include/inisettingsobject.h b/depends/settings/include/inisettingsobject.h similarity index 100% rename from libsettings/include/inisettingsobject.h rename to depends/settings/include/inisettingsobject.h diff --git a/libsettings/include/keyring.h b/depends/settings/include/keyring.h similarity index 100% rename from libsettings/include/keyring.h rename to depends/settings/include/keyring.h diff --git a/libsettings/include/libsettings_config.h b/depends/settings/include/libsettings_config.h similarity index 100% rename from libsettings/include/libsettings_config.h rename to depends/settings/include/libsettings_config.h diff --git a/libsettings/include/overridesetting.h b/depends/settings/include/overridesetting.h similarity index 100% rename from libsettings/include/overridesetting.h rename to depends/settings/include/overridesetting.h diff --git a/libsettings/include/setting.h b/depends/settings/include/setting.h similarity index 100% rename from libsettings/include/setting.h rename to depends/settings/include/setting.h diff --git a/libsettings/include/settingsobject.h b/depends/settings/include/settingsobject.h similarity index 100% rename from libsettings/include/settingsobject.h rename to depends/settings/include/settingsobject.h diff --git a/libsettings/src/basicsettingsobject.cpp b/depends/settings/src/basicsettingsobject.cpp similarity index 100% rename from libsettings/src/basicsettingsobject.cpp rename to depends/settings/src/basicsettingsobject.cpp diff --git a/libsettings/src/inifile.cpp b/depends/settings/src/inifile.cpp similarity index 100% rename from libsettings/src/inifile.cpp rename to depends/settings/src/inifile.cpp diff --git a/libsettings/src/inisettingsobject.cpp b/depends/settings/src/inisettingsobject.cpp similarity index 100% rename from libsettings/src/inisettingsobject.cpp rename to depends/settings/src/inisettingsobject.cpp diff --git a/libsettings/src/keyring.cpp b/depends/settings/src/keyring.cpp similarity index 100% rename from libsettings/src/keyring.cpp rename to depends/settings/src/keyring.cpp diff --git a/libsettings/src/overridesetting.cpp b/depends/settings/src/overridesetting.cpp similarity index 100% rename from libsettings/src/overridesetting.cpp rename to depends/settings/src/overridesetting.cpp diff --git a/libsettings/src/setting.cpp b/depends/settings/src/setting.cpp similarity index 100% rename from libsettings/src/setting.cpp rename to depends/settings/src/setting.cpp diff --git a/libsettings/src/settingsobject.cpp b/depends/settings/src/settingsobject.cpp similarity index 100% rename from libsettings/src/settingsobject.cpp rename to depends/settings/src/settingsobject.cpp diff --git a/libsettings/src/stubkeyring.cpp b/depends/settings/src/stubkeyring.cpp similarity index 100% rename from libsettings/src/stubkeyring.cpp rename to depends/settings/src/stubkeyring.cpp diff --git a/libsettings/src/stubkeyring.h b/depends/settings/src/stubkeyring.h similarity index 100% rename from libsettings/src/stubkeyring.h rename to depends/settings/src/stubkeyring.h diff --git a/libutil/CMakeLists.txt b/depends/util/CMakeLists.txt similarity index 100% rename from libutil/CMakeLists.txt rename to depends/util/CMakeLists.txt diff --git a/libutil/include/apputils.h b/depends/util/include/apputils.h similarity index 100% rename from libutil/include/apputils.h rename to depends/util/include/apputils.h diff --git a/libutil/include/cmdutils.h b/depends/util/include/cmdutils.h similarity index 100% rename from libutil/include/cmdutils.h rename to depends/util/include/cmdutils.h diff --git a/libutil/include/libutil_config.h b/depends/util/include/libutil_config.h similarity index 100% rename from libutil/include/libutil_config.h rename to depends/util/include/libutil_config.h diff --git a/libutil/include/osutils.h b/depends/util/include/osutils.h similarity index 100% rename from libutil/include/osutils.h rename to depends/util/include/osutils.h diff --git a/libutil/include/pathutils.h b/depends/util/include/pathutils.h similarity index 100% rename from libutil/include/pathutils.h rename to depends/util/include/pathutils.h diff --git a/libutil/include/siglist.h b/depends/util/include/siglist.h similarity index 100% rename from libutil/include/siglist.h rename to depends/util/include/siglist.h diff --git a/libutil/include/siglist_impl.h b/depends/util/include/siglist_impl.h similarity index 100% rename from libutil/include/siglist_impl.h rename to depends/util/include/siglist_impl.h diff --git a/libutil/include/userutils.h b/depends/util/include/userutils.h similarity index 100% rename from libutil/include/userutils.h rename to depends/util/include/userutils.h diff --git a/libutil/src/cmdutils.cpp b/depends/util/src/cmdutils.cpp similarity index 100% rename from libutil/src/cmdutils.cpp rename to depends/util/src/cmdutils.cpp diff --git a/libutil/src/osutils.cpp b/depends/util/src/osutils.cpp similarity index 100% rename from libutil/src/osutils.cpp rename to depends/util/src/osutils.cpp diff --git a/libutil/src/pathutils.cpp b/depends/util/src/pathutils.cpp similarity index 100% rename from libutil/src/pathutils.cpp rename to depends/util/src/pathutils.cpp diff --git a/libutil/src/userutils.cpp b/depends/util/src/userutils.cpp similarity index 100% rename from libutil/src/userutils.cpp rename to depends/util/src/userutils.cpp diff --git a/gui/IconPickerDialog.cpp b/gui/IconPickerDialog.cpp index 27e7f3b6..d80673a8 100644 --- a/gui/IconPickerDialog.cpp +++ b/gui/IconPickerDialog.cpp @@ -1,7 +1,7 @@ #include "IconPickerDialog.h" #include "instancedelegate.h" #include "ui_IconPickerDialog.h" -#include +#include "logic/IconListModel.h" IconPickerDialog::IconPickerDialog(QWidget *parent) : QDialog(parent), diff --git a/gui/legacymodeditdialog.cpp b/gui/LegacyModEditDialog.cpp similarity index 81% rename from gui/legacymodeditdialog.cpp rename to gui/LegacyModEditDialog.cpp index 319705f9..a6becd7d 100644 --- a/gui/legacymodeditdialog.cpp +++ b/gui/LegacyModEditDialog.cpp @@ -13,15 +13,16 @@ * limitations under the License. */ -#include "legacymodeditdialog.h" -#include "ui_legacymodeditdialog.h" -#include "BaseInstance.h" +#include "LegacyModEditDialog.h" +#include "ui_LegacyModEditDialog.h" -LegacyModEditDialog::LegacyModEditDialog(QWidget *parent, BaseInstance* m_inst) : +LegacyModEditDialog::LegacyModEditDialog( LegacyInstance* inst, QWidget* parent ) : + m_inst(inst), QDialog(parent), ui(new Ui::LegacyModEditDialog) { ui->setupUi(this); + } LegacyModEditDialog::~LegacyModEditDialog() diff --git a/gui/legacymodeditdialog.h b/gui/LegacyModEditDialog.h similarity index 87% rename from gui/legacymodeditdialog.h rename to gui/LegacyModEditDialog.h index 54dceffe..3af6c8d7 100644 --- a/gui/legacymodeditdialog.h +++ b/gui/LegacyModEditDialog.h @@ -13,12 +13,10 @@ * limitations under the License. */ -#ifndef LEGACYMODEDITDIALOG_H -#define LEGACYMODEDITDIALOG_H +#pragma once #include - -#include "BaseInstance.h" +#include "logic/LegacyInstance.h" namespace Ui { class LegacyModEditDialog; @@ -29,7 +27,7 @@ class LegacyModEditDialog : public QDialog Q_OBJECT public: - explicit LegacyModEditDialog(QWidget *parent = 0, BaseInstance* m_inst = 0); + explicit LegacyModEditDialog(LegacyInstance* inst, QWidget *parent = 0); ~LegacyModEditDialog(); private slots: @@ -57,6 +55,5 @@ private slots: private: Ui::LegacyModEditDialog *ui; + LegacyInstance * m_inst; }; - -#endif // LEGACYMODEDITDIALOG_H diff --git a/gui/legacymodeditdialog.ui b/gui/LegacyModEditDialog.ui similarity index 99% rename from gui/legacymodeditdialog.ui rename to gui/LegacyModEditDialog.ui index d8b09bfe..d55c3e1c 100644 --- a/gui/legacymodeditdialog.ui +++ b/gui/LegacyModEditDialog.ui @@ -20,7 +20,7 @@ false - 3 + 0 diff --git a/gui/consolewindow.h b/gui/consolewindow.h index 3ea02ad9..60bec69f 100644 --- a/gui/consolewindow.h +++ b/gui/consolewindow.h @@ -2,7 +2,7 @@ #define CONSOLEWINDOW_H #include -#include "MinecraftProcess.h" +#include "logic/MinecraftProcess.h" namespace Ui { class ConsoleWindow; diff --git a/gui/instancemodel.cpp b/gui/instancemodel.cpp index 3cbb0fb9..39dea34b 100644 --- a/gui/instancemodel.cpp +++ b/gui/instancemodel.cpp @@ -1,6 +1,6 @@ #include "instancemodel.h" -#include -#include +#include +#include #include //#include "iconcache.h" diff --git a/gui/instancemodel.h b/gui/instancemodel.h index fe05744f..52b58081 100644 --- a/gui/instancemodel.h +++ b/gui/instancemodel.h @@ -2,7 +2,7 @@ #include #include "categorizedsortfilterproxymodel.h" -#include "lists/InstanceList.h" +#include "logic/lists/InstanceList.h" #include class InstanceModel : public QAbstractListModel diff --git a/gui/lwjglselectdialog.cpp b/gui/lwjglselectdialog.cpp index d4a42b59..9de92754 100644 --- a/gui/lwjglselectdialog.cpp +++ b/gui/lwjglselectdialog.cpp @@ -16,7 +16,7 @@ #include "lwjglselectdialog.h" #include "ui_lwjglselectdialog.h" -#include "lists/LwjglVersionList.h" +#include "logic/lists/LwjglVersionList.h" LWJGLSelectDialog::LWJGLSelectDialog(QWidget *parent) : QDialog(parent), diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 6176c079..5087b38f 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -33,6 +33,9 @@ #include "userutils.h" #include "pathutils.h" +#include "categorizedview.h" +#include "categorydrawer.h" + #include "gui/settingsdialog.h" #include "gui/newinstancedialog.h" #include "gui/logindialog.h" @@ -42,31 +45,25 @@ #include "gui/versionselectdialog.h" #include "gui/lwjglselectdialog.h" #include "gui/consolewindow.h" -#include "gui/legacymodeditdialog.h" #include "gui/instancesettings.h" -#include "categorizedview.h" -#include "categorydrawer.h" - -#include "lists/InstanceList.h" #include "AppSettings.h" #include "AppVersion.h" -#include "tasks/LoginTask.h" - -#include "BaseInstance.h" -#include "InstanceFactory.h" -#include "MinecraftProcess.h" -#include "OneSixAssets.h" -#include "OneSixUpdate.h" +#include "logic/lists/InstanceList.h" +#include "logic/tasks/LoginTask.h" +#include "logic/BaseInstance.h" +#include "logic/InstanceFactory.h" +#include "logic/MinecraftProcess.h" +#include "logic/OneSixAssets.h" +#include "logic/OneSixUpdate.h" +#include "logic/lists/MinecraftVersionList.h" +#include "logic/lists/LwjglVersionList.h" #include "instancemodel.h" #include "instancedelegate.h" #include "IconPickerDialog.h" -#include "lists/MinecraftVersionList.h" -#include "lists/LwjglVersionList.h" - // Opens the given file in the default application. // TODO: Move this somewhere. void openFileInDefaultProgram ( QString filename ); @@ -378,8 +375,8 @@ void MainWindow::on_actionEditInstMods_triggered() BaseInstance* inst = selectedInstance(); if (inst) { - LegacyModEditDialog dialog ( this, inst ); - dialog.exec(); + auto dialog = inst->createModEditDialog(this); + dialog->exec(); } } diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 62115e1d..79716e5e 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -18,9 +18,9 @@ #include -#include "lists/InstanceList.h" -#include "tasks/LoginTask.h" -#include "BaseInstance.h" +#include "logic/lists/InstanceList.h" +#include "logic/tasks/LoginTask.h" +#include "logic/BaseInstance.h" class InstanceModel; class InstanceProxyModel; diff --git a/gui/modeditdialog.cpp b/gui/modeditdialog.cpp index 2f437101..011de53d 100644 --- a/gui/modeditdialog.cpp +++ b/gui/modeditdialog.cpp @@ -15,7 +15,7 @@ #include "modeditdialog.h" #include "ui_modeditdialog.h" -#include "BaseInstance.h" +#include "logic/BaseInstance.h" ModEditDialog::ModEditDialog(QWidget *parent, BaseInstance* m_inst) : QDialog(parent), diff --git a/gui/modeditdialog.h b/gui/modeditdialog.h index 329a1b4e..94272a32 100644 --- a/gui/modeditdialog.h +++ b/gui/modeditdialog.h @@ -18,7 +18,7 @@ #include -#include "BaseInstance.h" +#include "logic/BaseInstance.h" namespace Ui { class ModEditDialog; diff --git a/gui/modeditdialog.ui b/gui/modeditdialog.ui index 380aec39..dfc59d21 100644 --- a/gui/modeditdialog.ui +++ b/gui/modeditdialog.ui @@ -26,7 +26,7 @@ - 2 + 0 Qt::ElideNone diff --git a/gui/newinstancedialog.cpp b/gui/newinstancedialog.cpp index 4f19e9a2..3a4adbc1 100644 --- a/gui/newinstancedialog.cpp +++ b/gui/newinstancedialog.cpp @@ -16,13 +16,11 @@ #include "newinstancedialog.h" #include "ui_newinstancedialog.h" -#include "InstanceFactory.h" - -#include -#include "InstanceVersion.h" - -#include "tasks/Task.h" -#include +#include "logic/InstanceFactory.h" +#include "logic/InstanceVersion.h" +#include "logic/IconListModel.h" +#include "logic/lists/MinecraftVersionList.h" +#include "logic/tasks/Task.h" #include "versionselectdialog.h" #include "taskdialog.h" diff --git a/gui/newinstancedialog.h b/gui/newinstancedialog.h index 07267e19..e8c57024 100644 --- a/gui/newinstancedialog.h +++ b/gui/newinstancedialog.h @@ -17,7 +17,7 @@ #define NEWINSTANCEDIALOG_H #include -#include "InstanceVersion.h" +#include "logic/InstanceVersion.h" namespace Ui { class NewInstanceDialog; diff --git a/gui/taskdialog.cpp b/gui/taskdialog.cpp index f61614e8..8c745b38 100644 --- a/gui/taskdialog.cpp +++ b/gui/taskdialog.cpp @@ -18,7 +18,7 @@ #include -#include "tasks/Task.h" +#include "logic/tasks/Task.h" TaskDialog::TaskDialog(QWidget *parent) : QDialog(parent), diff --git a/gui/versionselectdialog.cpp b/gui/versionselectdialog.cpp index 33aedc71..afe112f4 100644 --- a/gui/versionselectdialog.cpp +++ b/gui/versionselectdialog.cpp @@ -22,9 +22,9 @@ #include -#include -#include -#include +#include +#include +#include VersionSelectDialog::VersionSelectDialog(InstVersionList *vlist, QWidget *parent) : QDialog(parent), diff --git a/gui/versionselectdialog.h b/gui/versionselectdialog.h index 752c937b..b864aee1 100644 --- a/gui/versionselectdialog.h +++ b/gui/versionselectdialog.h @@ -19,7 +19,7 @@ #include #include -#include +#include "logic/InstanceVersion.h" class InstVersionList; diff --git a/java/test.cpp b/java/test.cpp deleted file mode 100644 index f73e3c21..00000000 --- a/java/test.cpp +++ /dev/null @@ -1,35 +0,0 @@ - -#include "classfile.h" -#include "annotations.h" -#include -#include - -int main(int argc, char* argv[]) -{ - if(argc > 1) - { - std::ifstream file_in(argv[1]); - if(file_in.is_open()) - { - file_in.seekg(0, std::_S_end); - auto length = file_in.tellg(); - char * data = new char[length]; - file_in.seekg(0); - file_in.read(data,length); - java::classfile cf (data, length); - java::annotation_table atable = cf.visible_class_annotations; - for(int i = 0; i < atable.size(); i++) - { - std::cout << atable[i]->toString() << std::endl; - } - return 0; - } - else - { - std::cerr << "Failed to open file : " << argv[1] << std::endl; - return 1; - } - } - std::cerr << "No file to open :(" << std::endl; - return 1; -} \ No newline at end of file diff --git a/backend/BaseInstance.cpp b/logic/BaseInstance.cpp similarity index 99% rename from backend/BaseInstance.cpp rename to logic/BaseInstance.cpp index 951b403a..c2df34e1 100644 --- a/backend/BaseInstance.cpp +++ b/logic/BaseInstance.cpp @@ -23,7 +23,7 @@ #include "overridesetting.h" #include "pathutils.h" -#include +#include "lists/MinecraftVersionList.h" BaseInstance::BaseInstance( BaseInstancePrivate* d_in, diff --git a/backend/BaseInstance.h b/logic/BaseInstance.h similarity index 96% rename from backend/BaseInstance.h rename to logic/BaseInstance.h index 05f3ce00..8b5de6f5 100644 --- a/backend/BaseInstance.h +++ b/logic/BaseInstance.h @@ -23,8 +23,7 @@ #include "inifile.h" #include "lists/InstVersionList.h" -#include "libmmc_config.h" - +class QDialog; class BaseUpdate; class MinecraftProcess; class OneSixUpdate; @@ -39,7 +38,7 @@ class BaseInstancePrivate; * To create a new instance type, create a new class inheriting from this class * and implement the pure virtual functions. */ -class LIBMULTIMC_EXPORT BaseInstance : public QObject +class BaseInstance : public QObject { Q_OBJECT protected: @@ -128,6 +127,9 @@ public: /// do any necessary cleanups after the instance finishes. also runs before 'prepareForLaunch' virtual void cleanupAfterRun() = 0; + + /// create a mod edit dialog for the instance + virtual QSharedPointer createModEditDialog ( QWidget* parent ) = 0; signals: /*! * \brief Signal emitted when properties relevant to the instance view change diff --git a/backend/BaseInstance_p.h b/logic/BaseInstance_p.h similarity index 100% rename from backend/BaseInstance_p.h rename to logic/BaseInstance_p.h diff --git a/backend/BaseUpdate.cpp b/logic/BaseUpdate.cpp similarity index 100% rename from backend/BaseUpdate.cpp rename to logic/BaseUpdate.cpp diff --git a/backend/BaseUpdate.h b/logic/BaseUpdate.h similarity index 93% rename from backend/BaseUpdate.h rename to logic/BaseUpdate.h index b7d2017e..d1e7b735 100644 --- a/backend/BaseUpdate.h +++ b/logic/BaseUpdate.h @@ -22,7 +22,6 @@ #include "net/DownloadJob.h" #include "tasks/Task.h" -#include "libmmc_config.h" class MinecraftVersion; class BaseInstance; @@ -30,7 +29,7 @@ class BaseInstance; /*! * The game update task is the task that handles downloading instances' files. */ -class LIBMULTIMC_EXPORT BaseUpdate : public Task +class BaseUpdate : public Task { Q_OBJECT public: diff --git a/logic/CMakeLists.txt b/logic/CMakeLists.txt new file mode 100644 index 00000000..b1eacced --- /dev/null +++ b/logic/CMakeLists.txt @@ -0,0 +1,24 @@ +project(libMultiMC) + +set(CMAKE_AUTOMOC ON) + +# Find Qt +find_package(Qt5Core REQUIRED) +find_package(Qt5Network REQUIRED) +find_package(Qt5Xml REQUIRED) + +# Include Qt headers. +include_directories(${Qt5Base_INCLUDE_DIRS}) +include_directories(${Qt5Network_INCLUDE_DIRS}) + +# Include utility library. +include_directories(${CMAKE_SOURCE_DIR}/libutil/include) + +# Include settings library. +include_directories(${CMAKE_SOURCE_DIR}/libsettings/include) + +SET(LIBINST_HEADERS + +) + + diff --git a/backend/IconListModel.cpp b/logic/IconListModel.cpp similarity index 100% rename from backend/IconListModel.cpp rename to logic/IconListModel.cpp diff --git a/backend/IconListModel.h b/logic/IconListModel.h similarity index 100% rename from backend/IconListModel.h rename to logic/IconListModel.h diff --git a/backend/InstanceFactory.cpp b/logic/InstanceFactory.cpp similarity index 100% rename from backend/InstanceFactory.cpp rename to logic/InstanceFactory.cpp diff --git a/backend/InstanceFactory.h b/logic/InstanceFactory.h similarity index 96% rename from backend/InstanceFactory.h rename to logic/InstanceFactory.h index e1100504..ed54f520 100644 --- a/backend/InstanceFactory.h +++ b/logic/InstanceFactory.h @@ -19,7 +19,6 @@ #include #include -#include "libmmc_config.h" #include "InstanceVersion.h" class InstVersion; @@ -28,7 +27,7 @@ class BaseInstance; /*! * The \bInstanceFactory\b is a singleton that manages loading and creating instances. */ -class LIBMULTIMC_EXPORT InstanceFactory : public QObject +class InstanceFactory : public QObject { Q_OBJECT public: diff --git a/backend/InstanceVersion.h b/logic/InstanceVersion.h similarity index 96% rename from backend/InstanceVersion.h rename to logic/InstanceVersion.h index aeff9842..eecd9c4e 100644 --- a/backend/InstanceVersion.h +++ b/logic/InstanceVersion.h @@ -14,13 +14,12 @@ */ #pragma once -#include "libmmc_config.h" #include /*! * An abstract base class for versions. */ -struct LIBMULTIMC_EXPORT InstVersion +struct InstVersion { /*! * Checks if this version is less (older) than the given version. diff --git a/backend/LegacyForge.cpp b/logic/LegacyForge.cpp similarity index 100% rename from backend/LegacyForge.cpp rename to logic/LegacyForge.cpp diff --git a/backend/LegacyForge.h b/logic/LegacyForge.h similarity index 100% rename from backend/LegacyForge.h rename to logic/LegacyForge.h diff --git a/backend/LegacyInstance.cpp b/logic/LegacyInstance.cpp similarity index 85% rename from backend/LegacyInstance.cpp rename to logic/LegacyInstance.cpp index 9102c9c7..db2a72d9 100644 --- a/backend/LegacyInstance.cpp +++ b/logic/LegacyInstance.cpp @@ -5,6 +5,7 @@ #include #include #include +#include "gui/LegacyModEditDialog.h" #include #include #include @@ -82,6 +83,50 @@ MinecraftProcess* LegacyInstance::prepareForLaunch(QString user, QString session return proc; } +QSharedPointer< ModList > LegacyInstance::coreModList() +{ + I_D(LegacyInstance); + if(!d->core_mod_list) + { + d->core_mod_list.reset(new ModList(coreModsDir(), QString())); + } + return d->core_mod_list; +} + +QSharedPointer< ModList > LegacyInstance::jarModList() +{ + I_D(LegacyInstance); + if(!d->jar_mod_list) + { + auto list = new ModList(instModsDir(), modListFile()); + connect(list, SIGNAL(changed()), SLOT(jarModsChanged())); + d->jar_mod_list.reset(list); + } + return d->jar_mod_list; +} + +void LegacyInstance::jarModsChanged() +{ + setShouldRebuild(true); +} + + +QSharedPointer< ModList > LegacyInstance::loaderModList() +{ + I_D(LegacyInstance); + if(!d->loader_mod_list) + { + d->loader_mod_list.reset(new ModList(mlModsDir(), QString())); + } + return d->loader_mod_list; +} + +QSharedPointer< QDialog > LegacyInstance::createModEditDialog ( QWidget* parent ) +{ + return QSharedPointer (new LegacyModEditDialog(this, parent)); +} + + void LegacyInstance::cleanupAfterRun() { //FIXME: delete the launcher and icons and whatnot. diff --git a/backend/LegacyInstance.h b/logic/LegacyInstance.h similarity index 89% rename from backend/LegacyInstance.h rename to logic/LegacyInstance.h index 6c9a295f..43a66a2b 100644 --- a/backend/LegacyInstance.h +++ b/logic/LegacyInstance.h @@ -2,9 +2,10 @@ #include "BaseInstance.h" +class ModList; class BaseUpdate; -class LIBMULTIMC_EXPORT LegacyInstance : public BaseInstance +class LegacyInstance : public BaseInstance { Q_OBJECT public: @@ -20,6 +21,11 @@ public: //! Path to the instance's modlist file. QString modListFile() const; + ////// Mod Lists ////// + QSharedPointer jarModList(); + QSharedPointer coreModList(); + QSharedPointer loaderModList(); + ////// Directories ////// QString savesDir() const; QString instModsDir() const; @@ -82,4 +88,8 @@ public: virtual MinecraftProcess* prepareForLaunch( QString user, QString session ); virtual void cleanupAfterRun(); + virtual QSharedPointer< QDialog > createModEditDialog ( QWidget* parent ); + +protected slots: + virtual void jarModsChanged(); }; \ No newline at end of file diff --git a/logic/LegacyInstance_p.h b/logic/LegacyInstance_p.h new file mode 100644 index 00000000..a1d195b4 --- /dev/null +++ b/logic/LegacyInstance_p.h @@ -0,0 +1,15 @@ +#pragma once +#include +#include +#include "BaseInstance_p.h" +#include "ModList.h" +#include + +class ModList; + +struct LegacyInstancePrivate: public BaseInstancePrivate +{ + QSharedPointer jar_mod_list; + QSharedPointer core_mod_list; + QSharedPointer loader_mod_list; +}; \ No newline at end of file diff --git a/backend/LegacyUpdate.cpp b/logic/LegacyUpdate.cpp similarity index 100% rename from backend/LegacyUpdate.cpp rename to logic/LegacyUpdate.cpp diff --git a/backend/LegacyUpdate.h b/logic/LegacyUpdate.h similarity index 94% rename from backend/LegacyUpdate.h rename to logic/LegacyUpdate.h index a48189a6..342d1eab 100644 --- a/backend/LegacyUpdate.h +++ b/logic/LegacyUpdate.h @@ -21,13 +21,12 @@ #include "net/DownloadJob.h" #include "tasks/Task.h" -#include "libmmc_config.h" #include "BaseUpdate.h" class MinecraftVersion; class BaseInstance; -class LIBMULTIMC_EXPORT LegacyUpdate : public BaseUpdate +class LegacyUpdate : public BaseUpdate { Q_OBJECT public: diff --git a/backend/MinecraftProcess.cpp b/logic/MinecraftProcess.cpp similarity index 100% rename from backend/MinecraftProcess.cpp rename to logic/MinecraftProcess.cpp diff --git a/backend/MinecraftProcess.h b/logic/MinecraftProcess.h similarity index 94% rename from backend/MinecraftProcess.h rename to logic/MinecraftProcess.h index 756d2de5..516bf986 100644 --- a/backend/MinecraftProcess.h +++ b/logic/MinecraftProcess.h @@ -20,14 +20,12 @@ #include "BaseInstance.h" -#include "libmmc_config.h" - /** * @brief the MessageLevel Enum * defines what level a message is */ namespace MessageLevel { -enum LIBMULTIMC_EXPORT Enum { +enum Enum { MultiMC, /**< MultiMC Messages */ Debug, /**< Debug Messages */ Info, /**< Info Messages */ @@ -42,7 +40,7 @@ enum LIBMULTIMC_EXPORT Enum { * @file data/minecraftprocess.h * @brief The MinecraftProcess class */ -class LIBMULTIMC_EXPORT MinecraftProcess : public QProcess +class MinecraftProcess : public QProcess { Q_OBJECT public: diff --git a/backend/MinecraftVersion.h b/logic/MinecraftVersion.h similarity index 94% rename from backend/MinecraftVersion.h rename to logic/MinecraftVersion.h index 5cd29925..27977262 100644 --- a/backend/MinecraftVersion.h +++ b/logic/MinecraftVersion.h @@ -15,12 +15,10 @@ #pragma once -#include "libmmc_config.h" - #include "InstanceVersion.h" #include -struct LIBMULTIMC_EXPORT MinecraftVersion : public InstVersion +struct MinecraftVersion : public InstVersion { // From InstVersion: /* diff --git a/backend/Mod.cpp b/logic/Mod.cpp similarity index 100% rename from backend/Mod.cpp rename to logic/Mod.cpp diff --git a/backend/Mod.h b/logic/Mod.h similarity index 94% rename from backend/Mod.h rename to logic/Mod.h index d9d90426..f14818d1 100644 --- a/backend/Mod.h +++ b/logic/Mod.h @@ -33,11 +33,13 @@ public: QFileInfo filename() const { return m_file; } QString id() const { return m_id; } ModType type() const { return m_type; } - QString mcversion() const; + QString mcversion() const { return m_mcversion; }; bool valid() {return m_type != MOD_UNKNOWN;} + QString name() const {return m_name; }; QString version() const; + // delete all the files of this mod bool destroy(); // replace this mod with a copy of the other diff --git a/backend/ModList.cpp b/logic/ModList.cpp similarity index 88% rename from backend/ModList.cpp rename to logic/ModList.cpp index 851eb940..d9e67574 100644 --- a/backend/ModList.cpp +++ b/logic/ModList.cpp @@ -1,5 +1,5 @@ // -// Copyright 2012 MultiMC Contributors +// Copyright 2013 MultiMC Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,8 @@ #include "LegacyInstance.h" #include -ModList::ModList ( const QString& dir ) : QObject(), m_dir(dir) +ModList::ModList ( const QString& dir, const QString& list_file ) +: QAbstractListModel(), m_dir(dir), m_list_file(list_file) { m_dir.setFilter(QDir::Readable | QDir::NoDotAndDotDot | QDir::Files | QDir::Dirs | QDir::NoSymLinks); m_dir.setSorting(QDir::Name); @@ -114,6 +115,59 @@ bool ModList::deleteMod ( size_t index ) return false; } +bool ModList::moveMod ( size_t from, size_t to ) +{ + return false; +} + +int ModList::columnCount ( const QModelIndex& parent ) const +{ + return 2; +} + +QVariant ModList::data ( const QModelIndex& index, int role ) const +{ + if(!index.isValid()) + return QVariant(); + + int row = index.row(); + int column = index.column(); + + if(row < 0 || row >= mods.size()) + return QVariant(); + + if(role != Qt::DisplayRole) + return QVariant(); + + switch(column) + { + case 0: + return mods[row].name(); + case 1: + return mods[row].version(); + case 2: + return mods[row].mcversion(); + default: + return QVariant(); + } +} + +QVariant ModList::headerData ( int section, Qt::Orientation orientation, int role ) const +{ + if (role != Qt::DisplayRole || orientation != Qt::Horizontal) + return QVariant(); + switch (section) + { + case 0: + return QString("Mod Name"); + case 1: + return QString("Mod Version"); + case 2: + return QString("MC Version"); + } +} + + /* ModList::ModList(const QString &dir) diff --git a/backend/ModList.h b/logic/ModList.h similarity index 55% rename from backend/ModList.h rename to logic/ModList.h index bf65a080..41d26491 100644 --- a/backend/ModList.h +++ b/logic/ModList.h @@ -1,5 +1,5 @@ // -// Copyright 2012 MultiMC Contributors +// Copyright 2013 MultiMC Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,26 +14,37 @@ class BaseInstance; #include #include #include +#include #include "Mod.h" /** - * A basic mod list. + * A legacy mod list. * Backed by a folder. */ -class ModList : public QObject +class ModList : public QAbstractListModel { Q_OBJECT public: - ModList(const QString& dir = QString()); + ModList(const QString& dir, const QString& list_file); - size_t size() { return mods.size(); }; + virtual QVariant data ( const QModelIndex& index, int role = Qt::DisplayRole ) const; + virtual int rowCount ( const QModelIndex& parent = QModelIndex() ) const + { + return size(); + }; + virtual QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; + virtual int columnCount ( const QModelIndex& parent ) const; + + size_t size() const { return mods.size(); }; Mod& operator[](size_t index) { return mods[index]; }; /// Reloads the mod list and returns true if the list changed. virtual bool update(); - /// Adds the given mod to the list at the given index. + /** + * Adds the given mod to the list at the given index - if the list supports custom ordering + */ virtual bool installMod(const QFileInfo& filename, size_t index = 0); /// Deletes the mod at the given index. @@ -43,33 +54,14 @@ public: * move the mod at index to the position N * 0 is the beginning of the list, length() is the end of the list. */ - virtual bool moveMod(size_t from, size_t to) { return false; }; + virtual bool moveMod(size_t from, size_t to); virtual bool isValid(); signals: - virtual void changed(); + void changed(); protected: QDir m_dir; + QString m_list_file; QList mods; }; - -/** - * A jar mod list. - * Backed by a folder and a file which specifies the load order. - */ -class JarModList : public ModList -{ - Q_OBJECT -public: - JarModList(const QString& dir, const QString& list_file, LegacyInstance * inst) - : ModList(dir), m_listfile(list_file), m_inst(inst) {} - - virtual bool update(); - virtual bool installMod(const QString &filename, size_t index); - virtual bool deleteMod(size_t index); - virtual bool moveMod(size_t from, size_t to); -protected: - QString m_listfile; - LegacyInstance * m_inst; -}; diff --git a/backend/NostalgiaInstance.cpp b/logic/NostalgiaInstance.cpp similarity index 100% rename from backend/NostalgiaInstance.cpp rename to logic/NostalgiaInstance.cpp diff --git a/backend/NostalgiaInstance.h b/logic/NostalgiaInstance.h similarity index 71% rename from backend/NostalgiaInstance.h rename to logic/NostalgiaInstance.h index 7c48713b..b8858218 100644 --- a/backend/NostalgiaInstance.h +++ b/logic/NostalgiaInstance.h @@ -2,7 +2,7 @@ #include "OneSixInstance.h" -class LIBMULTIMC_EXPORT NostalgiaInstance : public OneSixInstance +class NostalgiaInstance : public OneSixInstance { Q_OBJECT public: diff --git a/backend/OneSixAssets.cpp b/logic/OneSixAssets.cpp similarity index 100% rename from backend/OneSixAssets.cpp rename to logic/OneSixAssets.cpp diff --git a/backend/OneSixAssets.h b/logic/OneSixAssets.h similarity index 100% rename from backend/OneSixAssets.h rename to logic/OneSixAssets.h diff --git a/backend/OneSixInstance.cpp b/logic/OneSixInstance.cpp similarity index 97% rename from backend/OneSixInstance.cpp rename to logic/OneSixInstance.cpp index 46866b0e..b7f39e4a 100644 --- a/backend/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -151,6 +151,13 @@ void OneSixInstance::cleanupAfterRun() dir.removeRecursively(); } +QSharedPointer< QDialog > OneSixInstance::createModEditDialog ( QWidget* parent ) +{ + return QSharedPointer< QDialog >(); +} + + + bool OneSixInstance::setIntendedVersionId ( QString version ) { settings().set("IntendedVersion", version); diff --git a/backend/OneSixInstance.h b/logic/OneSixInstance.h similarity index 88% rename from backend/OneSixInstance.h rename to logic/OneSixInstance.h index 12ad9e40..edd96eaa 100644 --- a/backend/OneSixInstance.h +++ b/logic/OneSixInstance.h @@ -5,7 +5,7 @@ class FullVersion; class BaseUpdate; -class LIBMULTIMC_EXPORT OneSixInstance : public BaseInstance +class OneSixInstance : public BaseInstance { Q_OBJECT public: @@ -23,6 +23,8 @@ public: virtual bool shouldUpdate() const; virtual void setShouldUpdate(bool val); + virtual QSharedPointer< QDialog > createModEditDialog ( QWidget* parent ); + /// reload the full version json file. return true on success! bool reloadFullVersion(); /// get the current full version info diff --git a/backend/OneSixInstance_p.h b/logic/OneSixInstance_p.h similarity index 100% rename from backend/OneSixInstance_p.h rename to logic/OneSixInstance_p.h diff --git a/backend/OneSixUpdate.cpp b/logic/OneSixUpdate.cpp similarity index 100% rename from backend/OneSixUpdate.cpp rename to logic/OneSixUpdate.cpp diff --git a/backend/OneSixUpdate.h b/logic/OneSixUpdate.h similarity index 93% rename from backend/OneSixUpdate.h rename to logic/OneSixUpdate.h index 75575166..7a0cac52 100644 --- a/backend/OneSixUpdate.h +++ b/logic/OneSixUpdate.h @@ -21,13 +21,12 @@ #include "net/DownloadJob.h" #include "tasks/Task.h" -#include "libmmc_config.h" #include "BaseUpdate.h" class MinecraftVersion; class BaseInstance; -class LIBMULTIMC_EXPORT OneSixUpdate : public BaseUpdate +class OneSixUpdate : public BaseUpdate { Q_OBJECT public: diff --git a/backend/OneSixVersion.cpp b/logic/OneSixVersion.cpp similarity index 100% rename from backend/OneSixVersion.cpp rename to logic/OneSixVersion.cpp diff --git a/backend/OneSixVersion.h b/logic/OneSixVersion.h similarity index 100% rename from backend/OneSixVersion.h rename to logic/OneSixVersion.h diff --git a/backend/VersionFactory.cpp b/logic/VersionFactory.cpp similarity index 100% rename from backend/VersionFactory.cpp rename to logic/VersionFactory.cpp diff --git a/backend/VersionFactory.h b/logic/VersionFactory.h similarity index 100% rename from backend/VersionFactory.h rename to logic/VersionFactory.h diff --git a/backend/lists/InstVersionList.cpp b/logic/lists/InstVersionList.cpp similarity index 96% rename from backend/lists/InstVersionList.cpp rename to logic/lists/InstVersionList.cpp index 855fce45..7dc67155 100644 --- a/backend/lists/InstVersionList.cpp +++ b/logic/lists/InstVersionList.cpp @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "InstVersionList.h" -#include "InstanceVersion.h" +#include "logic/lists/InstVersionList.h" +#include "logic/InstanceVersion.h" InstVersionList::InstVersionList(QObject *parent) : QAbstractListModel(parent) diff --git a/backend/lists/InstVersionList.h b/logic/lists/InstVersionList.h similarity index 96% rename from backend/lists/InstVersionList.h rename to logic/lists/InstVersionList.h index ff6938b4..bc6aa5d4 100644 --- a/backend/lists/InstVersionList.h +++ b/logic/lists/InstVersionList.h @@ -20,8 +20,7 @@ #include #include -#include "libmmc_config.h" -#include "InstanceVersion.h" +#include "logic/InstanceVersion.h" class Task; @@ -37,7 +36,7 @@ class Task; * all have a default implementation, but they can be overridden by plugins to * change the behavior of the list. */ -class LIBMULTIMC_EXPORT InstVersionList : public QAbstractListModel +class InstVersionList : public QAbstractListModel { Q_OBJECT public: diff --git a/backend/lists/InstanceList.cpp b/logic/lists/InstanceList.cpp similarity index 98% rename from backend/lists/InstanceList.cpp rename to logic/lists/InstanceList.cpp index 101d52c5..39f55f7b 100644 --- a/backend/lists/InstanceList.cpp +++ b/logic/lists/InstanceList.cpp @@ -22,9 +22,9 @@ #include #include -#include "lists/InstanceList.h" -#include "BaseInstance.h" -#include "InstanceFactory.h" +#include "logic/lists/InstanceList.h" +#include "logic/BaseInstance.h" +#include "logic/InstanceFactory.h" #include "pathutils.h" diff --git a/backend/lists/InstanceList.h b/logic/lists/InstanceList.h similarity index 94% rename from backend/lists/InstanceList.h rename to logic/lists/InstanceList.h index 8c9965e5..82ef0ea4 100644 --- a/backend/lists/InstanceList.h +++ b/logic/lists/InstanceList.h @@ -18,12 +18,11 @@ #include #include -#include "BaseInstance.h" -#include "libmmc_config.h" +#include "logic/BaseInstance.h" class BaseInstance; -class LIBMULTIMC_EXPORT InstanceList : public QObject +class InstanceList : public QObject { Q_OBJECT private: diff --git a/backend/lists/LwjglVersionList.cpp b/logic/lists/LwjglVersionList.cpp similarity index 99% rename from backend/lists/LwjglVersionList.cpp rename to logic/lists/LwjglVersionList.cpp index 068394e8..0e7b5a34 100644 --- a/backend/lists/LwjglVersionList.cpp +++ b/logic/lists/LwjglVersionList.cpp @@ -14,7 +14,7 @@ */ #include "LwjglVersionList.h" -#include +#include "logic/net/NetWorker.h" #include diff --git a/backend/lists/LwjglVersionList.h b/logic/lists/LwjglVersionList.h similarity index 95% rename from backend/lists/LwjglVersionList.h rename to logic/lists/LwjglVersionList.h index 2360f181..638a0b67 100644 --- a/backend/lists/LwjglVersionList.h +++ b/logic/lists/LwjglVersionList.h @@ -22,12 +22,10 @@ #include -#include "libmmc_config.h" - class LWJGLVersion; typedef QSharedPointer PtrLWJGLVersion; -class LIBMULTIMC_EXPORT LWJGLVersion : public QObject +class LWJGLVersion : public QObject { Q_OBJECT @@ -49,7 +47,7 @@ protected: QString m_url; }; -class LIBMULTIMC_EXPORT LWJGLVersionList : public QAbstractListModel +class LWJGLVersionList : public QAbstractListModel { Q_OBJECT public: diff --git a/backend/lists/MinecraftVersionList.cpp b/logic/lists/MinecraftVersionList.cpp similarity index 99% rename from backend/lists/MinecraftVersionList.cpp rename to logic/lists/MinecraftVersionList.cpp index 2e5f0cd7..80b4fbc0 100644 --- a/backend/lists/MinecraftVersionList.cpp +++ b/logic/lists/MinecraftVersionList.cpp @@ -14,7 +14,7 @@ */ #include "MinecraftVersionList.h" -#include +#include #include diff --git a/backend/lists/MinecraftVersionList.h b/logic/lists/MinecraftVersionList.h similarity index 92% rename from backend/lists/MinecraftVersionList.h rename to logic/lists/MinecraftVersionList.h index d3b18691..0477379f 100644 --- a/backend/lists/MinecraftVersionList.h +++ b/logic/lists/MinecraftVersionList.h @@ -21,14 +21,13 @@ #include #include "InstVersionList.h" -#include "tasks/Task.h" -#include "MinecraftVersion.h" -#include "libmmc_config.h" +#include "logic/tasks/Task.h" +#include "logic/MinecraftVersion.h" class MCVListLoadTask; class QNetworkReply; -class LIBMULTIMC_EXPORT MinecraftVersionList : public InstVersionList +class MinecraftVersionList : public InstVersionList { Q_OBJECT public: diff --git a/backend/net/DownloadJob.cpp b/logic/net/DownloadJob.cpp similarity index 100% rename from backend/net/DownloadJob.cpp rename to logic/net/DownloadJob.cpp diff --git a/backend/net/DownloadJob.h b/logic/net/DownloadJob.h similarity index 100% rename from backend/net/DownloadJob.h rename to logic/net/DownloadJob.h diff --git a/backend/net/JobQueue.h b/logic/net/JobQueue.h similarity index 100% rename from backend/net/JobQueue.h rename to logic/net/JobQueue.h diff --git a/backend/net/NetWorker.cpp b/logic/net/NetWorker.cpp similarity index 100% rename from backend/net/NetWorker.cpp rename to logic/net/NetWorker.cpp diff --git a/backend/net/NetWorker.h b/logic/net/NetWorker.h similarity index 100% rename from backend/net/NetWorker.h rename to logic/net/NetWorker.h diff --git a/backend/tasks/LoginTask.cpp b/logic/tasks/LoginTask.cpp similarity index 98% rename from backend/tasks/LoginTask.cpp rename to logic/tasks/LoginTask.cpp index 48202044..21ac2a5d 100644 --- a/backend/tasks/LoginTask.cpp +++ b/logic/tasks/LoginTask.cpp @@ -14,7 +14,7 @@ */ #include "LoginTask.h" -#include +#include "logic/net/NetWorker.h" #include diff --git a/backend/tasks/LoginTask.h b/logic/tasks/LoginTask.h similarity index 94% rename from backend/tasks/LoginTask.h rename to logic/tasks/LoginTask.h index 77d65255..bde672b8 100644 --- a/backend/tasks/LoginTask.h +++ b/logic/tasks/LoginTask.h @@ -18,7 +18,6 @@ #include "Task.h" #include -#include "libmmc_config.h" struct UserInfo { @@ -35,7 +34,7 @@ struct LoginResponse class QNetworkReply; -class LIBMULTIMC_EXPORT LoginTask : public Task +class LoginTask : public Task { Q_OBJECT public: diff --git a/backend/tasks/Task.cpp b/logic/tasks/Task.cpp similarity index 100% rename from backend/tasks/Task.cpp rename to logic/tasks/Task.cpp diff --git a/backend/tasks/Task.h b/logic/tasks/Task.h similarity index 95% rename from backend/tasks/Task.h rename to logic/tasks/Task.h index 15219931..91852b0f 100644 --- a/backend/tasks/Task.h +++ b/logic/tasks/Task.h @@ -19,9 +19,7 @@ #include #include -#include "libmmc_config.h" - -class LIBMULTIMC_EXPORT Task : public QObject +class Task : public QObject { Q_OBJECT public: diff --git a/main.cpp b/main.cpp index eae6b4ba..72b0f225 100644 --- a/main.cpp +++ b/main.cpp @@ -27,9 +27,9 @@ #include "gui/consolewindow.h" #include "AppSettings.h" -#include "lists/InstanceList.h" -#include "tasks/LoginTask.h" -#include "MinecraftProcess.h" +#include "logic/lists/InstanceList.h" +#include "logic/tasks/LoginTask.h" +#include "logic/MinecraftProcess.h" #include "pathutils.h" #include "cmdutils.h"