aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt13
-rw-r--r--launcher/Application.h1
-rw-r--r--launcher/ui/MainWindow.cpp5
-rw-r--r--launcher/ui/MainWindow.h2
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp2
5 files changed, 20 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2194317b..f32a73d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -208,9 +208,15 @@ set(Launcher_BUILD_TIMESTAMP "${TODAY}")
################################ 3rd Party Libs ################################
-if(NOT Launcher_FORCE_BUNDLED_LIBS)
+# Successive configurations of cmake without cleaning the build dir will cause zlib fallback to fail due to cached values
+# Record when fallback triggered and skip this find_package
+if(NOT Launcher_FORCE_BUNDLED_LIBS AND NOT FORCE_BUNDLED_ZLIB)
find_package(ZLIB QUIET)
endif()
+if(NOT ZLIB_FOUND)
+ set(FORCE_BUNDLED_ZLIB TRUE CACHE BOOL "")
+ mark_as_advanced(FORCE_BUNDLED_ZLIB)
+endif()
# Find the required Qt parts
include(QtVersionlessBackport)
@@ -379,13 +385,14 @@ add_subdirectory(libraries/libnbtplusplus)
add_subdirectory(libraries/systeminfo) # system information library
add_subdirectory(libraries/launcher) # java based launcher part for Minecraft
add_subdirectory(libraries/javacheck) # java compatibility checker
-if(NOT ZLIB_FOUND)
+if(FORCE_BUNDLED_ZLIB)
message(STATUS "Using bundled zlib")
+
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) # Suppress cmake warnings and allow INTERPROCEDURAL_OPTIMIZATION for zlib
set(SKIP_INSTALL_ALL ON)
add_subdirectory(libraries/zlib EXCLUDE_FROM_ALL)
- set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib" "${CMAKE_CURRENT_BINARY_DIR}/libraries/zlib" CACHE STRING "")
+ set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries/zlib" "${CMAKE_CURRENT_BINARY_DIR}/libraries/zlib" CACHE STRING "" FORCE)
set_target_properties(zlibstatic PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIR}")
add_library(ZLIB::ZLIB ALIAS zlibstatic)
set(ZLIB_LIBRARY ZLIB::ZLIB CACHE STRING "zlib library name")
diff --git a/launcher/Application.h b/launcher/Application.h
index 4991f4cc..2cd077f8 100644
--- a/launcher/Application.h
+++ b/launcher/Application.h
@@ -208,6 +208,7 @@ signals:
void updateAllowedChanged(bool status);
void globalSettingsAboutToOpen();
void globalSettingsClosed();
+ int currentCatChanged(int index);
#ifdef Q_OS_MACOS
void clickedOnDock();
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index 4e830b6c..655e7df0 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -974,6 +974,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
ui->actionCAT->setChecked(cat_enable);
// NOTE: calling the operator like that is an ugly hack to appease ancient gcc...
connect(ui->actionCAT.operator->(), SIGNAL(toggled(bool)), SLOT(onCatToggled(bool)));
+ connect(APPLICATION, &Application::currentCatChanged, this, &MainWindow::onCatChanged);
setCatBackground(cat_enable);
}
@@ -2076,6 +2077,10 @@ void MainWindow::newsButtonClicked()
news_dialog.exec();
}
+void MainWindow::onCatChanged(int) {
+ setCatBackground(APPLICATION->settings()->get("TheCat").toBool());
+}
+
void MainWindow::on_actionAbout_triggered()
{
AboutDialog dialog(this);
diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h
index 6bf5f428..84b5325a 100644
--- a/launcher/ui/MainWindow.h
+++ b/launcher/ui/MainWindow.h
@@ -90,6 +90,8 @@ protected:
private slots:
void onCatToggled(bool);
+ void onCatChanged(int);
+
void on_actionAbout_triggered();
void on_actionAddInstance_triggered();
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index 69a8e3df..d8b442fd 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -106,6 +106,8 @@ LauncherPage::LauncherPage(QWidget *parent) : QWidget(parent), ui(new Ui::Launch
}
connect(ui->fontSizeBox, SIGNAL(valueChanged(int)), SLOT(refreshFontPreview()));
connect(ui->consoleFont, SIGNAL(currentFontChanged(QFont)), SLOT(refreshFontPreview()));
+
+ connect(ui->themeCustomizationWidget, &ThemeCustomizationWidget::currentCatChanged, APPLICATION, &Application::currentCatChanged);
}
LauncherPage::~LauncherPage()