diff options
118 files changed, 44913 insertions, 45 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 79a69225..95b1c18f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,9 @@ include_directories(${LIBSETTINGS_INCLUDE_DIR}) add_subdirectory(depends/groupview) include_directories(${LIBGROUPVIEW_INCLUDE_DIR}) +# Add the updater +add_subdirectory(mmc_updater) + ################################ SET UP BUILD OPTIONS ################################ ######## Check endianness ######## @@ -129,10 +132,10 @@ ENDIF () MESSAGE(STATUS "MultiMC 5 version ${MultiMC_VERSION_STRING}") -# Custom target to just print the version. +#### Custom target to just print the version. ADD_CUSTOM_TARGET(version echo "Version: ${MultiMC_VERSION_STRING}") -# Check the current Git commit +#### Check the current Git commit execute_process(COMMAND git rev-parse HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} RESULT_VARIABLE GIT_COMMIT_CHECK_RESULTVAR @@ -140,7 +143,6 @@ execute_process(COMMAND git rev-parse HEAD OUTPUT_STRIP_TRAILING_WHITESPACE ) -# If Git executed successfully IF(GIT_COMMIT_CHECK_RESULTVAR EQUAL 0) SET(MultiMC_GIT_COMMIT "${GIT_COMMIT_CHECK_OUTVAR}") MESSAGE(STATUS "Git commit: ${MultiMC_GIT_COMMIT}") @@ -149,41 +151,12 @@ ELSE() MESSAGE(STATUS "Failed to check Git commit. ${GIT_COMMIT_CHECK_RESULTVAR}") ENDIF() - -######## Set Jenkins info ######## -# Jenkins build tag -IF(DEFINED MultiMC_BUILD_TAG) - MESSAGE(STATUS "Build tag: ${MultiMC_BUILD_TAG}") -ELSE() - MESSAGE(STATUS "No build tag specified.") - SET(MultiMC_BUILD_TAG custom) -ENDIF() - -# Architecture detection -IF(CMAKE_SIZEOF_VOID_P EQUAL 8) - SET(MultiMC_ARCH "x64" CACHE STRING "Architecture we're building for.") -ELSE() - SET(MultiMC_ARCH "x86" CACHE STRING "Architecture we're building for.") -ENDIF() -MESSAGE(STATUS "Architecture is ${MultiMC_ARCH}") - -# Jenkins job name -IF(WIN32) - SET(MultiMC_JOB_NAME "MultiMC5Windows" CACHE STRING "Jenkins job name.") -ELSEIF(UNIX AND APPLE) - SET(MultiMC_JOB_NAME "MultiMC5OSX" CACHE STRING "Jenkins job name.") -ELSE() - SET(MultiMC_JOB_NAME "MultiMC5Linux" CACHE STRING "Jenkins job name.") -ENDIF() - -# Jenkins URL -SET(MultiMC_JOB_URL "http://ci.forkk.net/job/${MultiMC_JOB_NAME}/arch=${MultiMC_ARCH}${MultiMC_Extra_Label}/" - CACHE STRING "URL of the jenkins job to pull updates from.") -MESSAGE(STATUS "Job URL: ${MultiMC_JOB_URL}") +#### GoUpdate URL +SET(MultiMC_REPO_BASE_URL "invalid" CACHE STRING "Base URL for the updater.") +SET(MultiMC_VERSION_BRANCH "invalid" CACHE STRING "URL of the stable update repo.") ######## Configure header ######## -configure_file("${PROJECT_SOURCE_DIR}/config.h.in" - "${PROJECT_BINARY_DIR}/include/config.h") +configure_file("${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/include/config.h") ######## Other Stuff ######## @@ -251,6 +224,8 @@ gui/dialogs/AccountListDialog.h gui/dialogs/AccountListDialog.cpp gui/dialogs/AccountSelectDialog.h gui/dialogs/AccountSelectDialog.cpp +gui/dialogs/UpdateDialog.h +gui/dialogs/UpdateDialog.cpp # GUI - widgets gui/widgets/InstanceDelegate.h @@ -383,7 +358,8 @@ logic/NagUtils.h logic/NagUtils.cpp logic/SkinUtils.h logic/SkinUtils.cpp - +logic/GoUpdate.h +logic/GoUpdate.cpp ) @@ -410,6 +386,7 @@ gui/dialogs/EditNotesDialog.ui gui/dialogs/AccountListDialog.ui gui/dialogs/AccountSelectDialog.ui gui/dialogs/EditAccountDialog.ui +gui/dialogs/UpdateDialog.ui # Widgets/other gui/widgets/MCModInfoFrame.ui diff --git a/MultiMC.cpp b/MultiMC.cpp index e10292ab..3df73c18 100644 --- a/MultiMC.cpp +++ b/MultiMC.cpp @@ -20,6 +20,7 @@ #include "logic/net/HttpMetaCache.h" #include "logic/JavaUtils.h" +#include "logic/GoUpdate.h" #include "pathutils.h" #include "cmdutils.h" @@ -138,6 +139,9 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv), // load settings initGlobalSettings(); + // initialize the updater + m_go_update.reset(new GoUpdate()); + // and instances auto InstDirSetting = m_settings->getSetting("InstanceDir"); m_instances.reset(new InstanceList(InstDirSetting->get().toString(), this)); @@ -17,6 +17,7 @@ class IconList; class QNetworkAccessManager; class ForgeVersionList; class JavaVersionList; +class GoUpdate; #if defined(MMC) #undef MMC @@ -84,6 +85,11 @@ public: return m_metacache; } + std::shared_ptr<GoUpdate> goupdate() + { + return m_go_update; + } + std::shared_ptr<LWJGLVersionList> lwjgllist(); std::shared_ptr<ForgeVersionList> forgelist(); @@ -106,6 +112,7 @@ private: std::shared_ptr<QTranslator> m_mmc_translator; std::shared_ptr<SettingsObject> m_settings; std::shared_ptr<InstanceList> m_instances; + std::shared_ptr<GoUpdate> m_go_update; std::shared_ptr<MojangAccountList> m_accounts; std::shared_ptr<IconList> m_icons; std::shared_ptr<QNetworkAccessManager> m_qnam; diff --git a/config.h.in b/config.h.in index 34841817..26c8b1e9 100644 --- a/config.h.in +++ b/config.h |
