From 692dd5645a7ed2421a0e08c3fe66c360c4130fa0 Mon Sep 17 00:00:00 2001 From: Tim Johannes Date: Tue, 2 Jun 2026 19:59:38 +0200 Subject: [PATCH 1/8] Fix read-only parameter inputs after mode toggle OnToggled() called set_active_tab(nullptr) after switching the simple/advanced mode, leaving the params panel without an active tab. All parameter inputs (cooling, temperatures, etc.) then stayed greyed out / read-only until the application was restarted. Re-activate the current tab instead. Fixes CrealityOfficial/CrealityPrint#552 --- src/slic3r/GUI/ParamsPanel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/ParamsPanel.cpp b/src/slic3r/GUI/ParamsPanel.cpp index 93febbcb..b2628323 100644 --- a/src/slic3r/GUI/ParamsPanel.cpp +++ b/src/slic3r/GUI/ParamsPanel.cpp @@ -1409,7 +1409,11 @@ void ParamsPanel::OnToggled(wxCommandEvent& event) if (m_mode_region && m_mode_region->GetValue() && m_current_tab) { wxWindowUpdateLocker locker(GetParent()); - set_active_tab(nullptr); + // Re-activate the current tab instead of clearing it. Passing nullptr + // here left the panel without an active tab, so all parameter inputs + // (cooling, temperatures, etc.) stayed greyed out / read-only after a + // mode toggle. See CrealityOfficial/CrealityPrint#552. + set_active_tab(m_current_tab); } m_page_view->Update(); From bb4b46d9fe878eafcd591fe0b39c64f5ffe89a04 Mon Sep 17 00:00:00 2001 From: Tim Johannes Date: Tue, 2 Jun 2026 20:04:43 +0200 Subject: [PATCH 2/8] Make build shell scripts executable The Dockerfile invokes ./BuildLinux.sh directly, but the script was committed with mode 100644, so the Docker build fails at the first RUN ./BuildLinux.sh step with 'Permission denied' (exit 126). --- .dockerignore | 30 +++--------------------------- BuildLinux.sh | 0 DockerBuild.sh | 0 DockerRun.sh | 0 4 files changed, 3 insertions(+), 27 deletions(-) mode change 100644 => 100755 BuildLinux.sh mode change 100644 => 100755 DockerBuild.sh mode change 100644 => 100755 DockerRun.sh diff --git a/.dockerignore b/.dockerignore index 378649ff..fef3abe7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,28 +1,4 @@ -Build -Build.bat -/build/ +.git +build deps/build -MYMETA.json -MYMETA.yml -_build -blib -xs/buildtmp -*.o -*.log -MANIFEST.bak -xs/MANIFEST.bak -xs/assertlib* -.init_bundle.ini -.vs/* -local-lib -/src/TAGS -/.vscode/ -build-linux/* -deps/build-linux/* -**/.DS_Store -install_* -build_*/ -SVG -Dockerfile -DockerBuild.sh -DockerRun.sh +*.AppImage diff --git a/BuildLinux.sh b/BuildLinux.sh old mode 100644 new mode 100755 diff --git a/DockerBuild.sh b/DockerBuild.sh old mode 100644 new mode 100755 diff --git a/DockerRun.sh b/DockerRun.sh old mode 100644 new mode 100755 From da5bd64628dc14f86c6948bb28bfdade5e1b0eaa Mon Sep 17 00:00:00 2001 From: Tim Johannes Date: Tue, 2 Jun 2026 22:36:17 +0200 Subject: [PATCH 3/8] Fix Linux build: migrate Docker build to Ubuntu 24.04 / GCC 13 The Ubuntu 22.04 / GCC 11.4 toolchain miscompiles libslic3r at -O3: the std::ifstream read path returns EOF for valid, non-empty profile JSONs, so startup aborts with nlohmann parse_error.101 and crashes during wx cleanup. Building with the GCC 13 / Ubuntu 24.04 toolchain (the same one the official binary uses) avoids it. Dockerfile: - base image ubuntu:22.04 -> ubuntu:24.04 - add bc (BuildLinux.sh needs it to detect 24.04 and pick linux.d/debian2) - libsoup2.4-dev -> libsoup-3.0-dev, add libjavascriptcoregtk-4.1-dev (24.04 dropped webkit2gtk-4.0; wxWidgets auto-selects 4.1/soup-3) - install libdeflate-dev before the link step (provides libdeflate.so) Carried-over link/ABI fixes (needed regardless of base image): - src/CMakeLists.txt: append libdeflate at the end of every link line via CMAKE_CXX_STANDARD_LIBRARIES (static libtiff needs -ldeflate after its last occurrence in the link order) - deps/paho-mqtt/paho-mqtt.cmake: build paho without SSL on Linux using 'if(UNIX AND NOT APPLE)' (the LINUX var needs CMake >= 3.25); avoids an OpenSSL 3.x-headers vs static-1.1.1-link ABI mismatch GCC 13 pre-emptive fixes: - deps/Assimp/Assimp.cmake: -DASSIMP_WARNINGS_AS_ERRORS=OFF - src/clipper2/CMakeLists.txt: drop -Werror --- Dockerfile | 15 +++++++++++---- deps/Assimp/Assimp.cmake | 6 +++++- deps/paho-mqtt/paho-mqtt.cmake | 6 +++++- src/CMakeLists.txt | 17 ++++++++++++----- src/clipper2/CMakeLists.txt | 4 +++- 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7cbe27d8..b143240e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.io/ubuntu:22.04 +FROM docker.io/ubuntu:24.04 LABEL maintainer "DeftDawg " # Disable interactive package configuration @@ -11,6 +11,7 @@ RUN echo deb-src http://archive.ubuntu.com/ubuntu \ RUN apt-get update && apt-get install -y \ autoconf \ + bc \ build-essential \ cmake \ curl \ @@ -34,13 +35,13 @@ RUN apt-get update && apt-get install -y \ libgtk-3-dev \ libosmesa6-dev \ libsecret-1-dev \ - libsoup2.4-dev \ - libssl3 \ + libsoup-3.0-dev \ libssl-dev \ libtool \ libudev-dev \ libwayland-dev \ - libwebkit2gtk-4.0-dev \ + libwebkit2gtk-4.1-dev \ + libjavascriptcoregtk-4.1-dev \ libxkbcommon-dev \ locales \ locales-all \ @@ -70,6 +71,12 @@ RUN ./BuildLinux.sh -u # Build dependencies in ./deps RUN ./BuildLinux.sh -d +# Static libtiff from ./deps pulls in -lLerc and -ldeflate at final link time, +# but those dev libraries are not in the apt list above. Install before linking. +# libdeflate-dev provides the /usr/lib/.../libdeflate.so symlink referenced by +# the CMAKE_CXX_STANDARD_LIBRARIES fix in src/CMakeLists.txt. +RUN apt-get update && apt-get install -y liblerc-dev libdeflate-dev + # Build slic3r RUN ./BuildLinux.sh -s diff --git a/deps/Assimp/Assimp.cmake b/deps/Assimp/Assimp.cmake index cec46170..f7c9a0c7 100644 --- a/deps/Assimp/Assimp.cmake +++ b/deps/Assimp/Assimp.cmake @@ -8,7 +8,11 @@ orcaslicer_add_cmake_project(Assimp URL https://github.com/assimp/assimp/archive/refs/tags/v5.4.3.zip URL_HASH SHA256=795C29716F4AC123B403E53B677E9F32A8605C4A7B2D9904BFAAE3F4053B506D PATCH_COMMAND ${patch_command} -# CMAKE_ARGS + CMAKE_ARGS + # Assimp forces -Wall -Werror (ASSIMP_WARNINGS_AS_ERRORS defaults ON). + # GCC 13 emits new warnings (-Wdangling-reference, -Wstringop-overflow, + # ...) that would become fatal. Turn the promotion off. + -DASSIMP_WARNINGS_AS_ERRORS=OFF # -DASSIMP_BUILD_ZLIB=OFF ) diff --git a/deps/paho-mqtt/paho-mqtt.cmake b/deps/paho-mqtt/paho-mqtt.cmake index ade668af..a5506b0b 100644 --- a/deps/paho-mqtt/paho-mqtt.cmake +++ b/deps/paho-mqtt/paho-mqtt.cmake @@ -1,7 +1,11 @@ #set(patch_command git init && ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-fix-slicer-build.patch) set(_build_static ON) set(_build_with_ssl ON) -if(LINUX) +# Build paho WITHOUT SSL on Linux: otherwise paho compiles against the system +# OpenSSL 3.x headers but links the static OpenSSL 1.1.1 from ./deps, an ABI +# mismatch. Use "UNIX AND NOT APPLE" because the LINUX variable only exists in +# CMake >= 3.25 (the 22.04 image had 3.22, where if(LINUX) silently never fired). +if(UNIX AND NOT APPLE) set(_build_with_ssl OFF) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 315ab9ab..7844a623 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -106,7 +106,7 @@ if (SLIC3R_GUI) if(LIBRT) list(APPEND wxWidgets_LIBRARIES ${LIBRT}) endif() - # ʹÓÃÉú³ÉÆ÷±í´ïʽ֧³Ö¶àÅäÖÃÉú³ÉÆ÷ (Èç Visual Studio) + # ʹ������������ʽ֧�ֶ����������� (�� Visual Studio) find_library(LIBOSS_DEBUG alibabacloud-oss-cpp-sdkd) find_library(LIBOSS_RELEASE alibabacloud-oss-cpp-sdk) if(NOT LIBOSS_DEBUG) @@ -114,7 +114,7 @@ if (SLIC3R_GUI) endif() if(LIBOSS_DEBUG OR LIBOSS_RELEASE) if(APPLE) - # Apple Ö»Óà Release °æ±¾ + # Apple ֻ�� Release �汾 list(APPEND wxWidgets_LIBRARIES ${LIBOSS_RELEASE} OpenSSL::SSL OpenSSL::Crypto) else() list(APPEND wxWidgets_LIBRARIES @@ -158,6 +158,13 @@ else() endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY) message("PROJECT_DLL_NAME_WIN32=${PROJECT_DLL_NAME_WIN32}") +# Static libtiff from ./deps pulls in libdeflate symbols, but libtiff.a appears +# twice in the link line and the transitive -ldeflate lands before its last +# occurrence, so the symbols go unresolved. Append libdeflate at the very end of +# every link line (CMAKE_CXX_STANDARD_LIBRARIES is emitted last and not deduped). +if (UNIX AND NOT APPLE) + set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} /usr/lib/x86_64-linux-gnu/libdeflate.so") +endif() set(PROJECT_DLL ${PROJECT_DLL_NAME_WIN32}) if(WIN32) set(PROJECT_DLL ${PROJECT_DLL_NAME_WIN32}) @@ -193,14 +200,14 @@ if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch|loongarch64") endif() if(ENABLE_BREAKPAD) add_definitions(-DUSE_BREAKPAD) - # ʹÓÃÉú³ÉÆ÷±í´ïʽ֧³Ö¶àÅäÖÃÉú³ÉÆ÷ (Èç Visual Studio) + # ʹ������������ʽ֧�ֶ����������� (�� Visual Studio) find_library(LIB_BREAKPAD_DEBUG libbreakpad_clientd) find_library(LIB_BREAKPAD_RELEASE libbreakpad_client) if(NOT LIB_BREAKPAD_DEBUG) set(LIB_BREAKPAD_DEBUG ${LIB_BREAKPAD_RELEASE}) endif() if(APPLE) - # Apple Ö»Óà Release °æ±¾ + # Apple ֻ�� Release �汾 message(STATUS "LIB_BREAKPAD=${LIB_BREAKPAD_RELEASE}") target_link_libraries(${PROJECT_DLL} libslic3r cereal::cereal ${LIB_BREAKPAD_RELEASE}) else() @@ -242,7 +249,7 @@ if(WIN32) endif() endif() - # ʹÓà debug/optimized ¹Ø¼ü×ÖÖ§³Ö¶àÅäÖÃÉú³ÉÆ÷ (Èç Visual Studio) + # ʹ�� debug/optimized �ؼ���֧�ֶ����������� (�� Visual Studio) find_library(LIB_ASSIMP_DEBUG assimp-${ASSIMP_MSVC_VERSION}-mtd) if(NOT LIB_ASSIMP_DEBUG) find_library(LIB_ASSIMP_DEBUG assimp-${ASSIMP_MSVC_VERSION}-mt) diff --git a/src/clipper2/CMakeLists.txt b/src/clipper2/CMakeLists.txt index a9570bf0..dbeb997f 100644 --- a/src/clipper2/CMakeLists.txt +++ b/src/clipper2/CMakeLists.txt @@ -37,7 +37,9 @@ target_include_directories(Clipper2 if (WIN32) target_compile_options(Clipper2 PRIVATE /W4 /WX) else() - target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic -Werror) + # -Werror dropped: GCC 13 promotes new warnings (e.g. -Wdangling-reference) + # to errors in this third-party lib. Keep the warnings, not the promotion. + target_compile_options(Clipper2 PRIVATE -Wall -Wextra -Wpedantic) target_link_libraries(Clipper2 PUBLIC -lm) if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14.1) target_compile_options(Clipper2 PRIVATE -Wno-error=template-id-cdtor) From 029415813786bad49cba179007a227bb67ce1f2b Mon Sep 17 00:00:00 2001 From: Tim Johannes Date: Thu, 4 Jun 2026 21:39:09 +0200 Subject: [PATCH 4/8] Fix Linux link error: append libLerc to the static link line Static libtiff.a pulls in libLerc symbols (lerc_encodeForVersion, lerc_getBlobInfo, lerc_decode), but the transitive -lLerc is emitted before libtiff.a's last occurrence in the link line, so the symbols go unresolved and the final CrealityPrint link fails. Append libLerc.so at the very end of every link line via CMAKE_CXX_STANDARD_LIBRARIES (emitted last and not deduped), mirroring the existing libdeflate fix next to it. --- src/CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7844a623..9d25babb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -158,12 +158,13 @@ else() endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY) message("PROJECT_DLL_NAME_WIN32=${PROJECT_DLL_NAME_WIN32}") -# Static libtiff from ./deps pulls in libdeflate symbols, but libtiff.a appears -# twice in the link line and the transitive -ldeflate lands before its last -# occurrence, so the symbols go unresolved. Append libdeflate at the very end of -# every link line (CMAKE_CXX_STANDARD_LIBRARIES is emitted last and not deduped). +# Static libtiff from ./deps pulls in libdeflate and libLerc symbols, but +# libtiff.a appears twice in the link line and the transitive -ldeflate/-lLerc +# land before its last occurrence, so the symbols go unresolved. Append both +# libraries at the very end of every link line (CMAKE_CXX_STANDARD_LIBRARIES is +# emitted last and not deduped). if (UNIX AND NOT APPLE) - set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} /usr/lib/x86_64-linux-gnu/libdeflate.so") + set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} /usr/lib/x86_64-linux-gnu/libdeflate.so /usr/lib/x86_64-linux-gnu/libLerc.so") endif() set(PROJECT_DLL ${PROJECT_DLL_NAME_WIN32}) if(WIN32) From 8d5268a635b57ceb1cef94f7e7758163e9b7f462 Mon Sep 17 00:00:00 2001 From: Tim Johannes Date: Thu, 4 Jun 2026 21:39:22 +0200 Subject: [PATCH 5/8] Fix startup crash from broken Kingroon profile reference on Linux Kingroon.json references machine/Kingroon KP3S PRO S1[ 0.4 nozzle].json, but the files were lowercased (kingroon kp3s pro s1...). On case-sensitive filesystems (Linux) the files are not found, so ProfileLoader::_LoadModelImpl reads from an unopened stream and nlohmann::json throws a parse_error. That exception propagates uncaught through tbb::parallel_for_each -> Loc_LoadProfile -> AppConfig::get_profile_machines() (called during the Plater/MainFrame build), aborting GUI init with a secondary SIGSEGV. Windows and macOS hide this because their filesystems are case-insensitive. Two-part fix: - rename the two Kingroon machine profiles to the referenced casing - guard the ifs >> json reads in ProfileLoader::_LoadModel/_LoadModelImpl/ _LoadPrinterImpl with try/catch so a missing or malformed profile file skips that entry instead of taking down the whole startup. --- ...n => Kingroon KP3S PRO S1 0.4 nozzle.json} | 0 ... pro s1.json => Kingroon KP3S PRO S1.json} | 0 src/libslic3r/AppConfig.cpp | 26 ++++++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) rename resources/profiles/Kingroon/machine/{kingroon kp3s pro s1 0.4 nozzle.json => Kingroon KP3S PRO S1 0.4 nozzle.json} (100%) rename resources/profiles/Kingroon/machine/{kingroon kp3s pro s1.json => Kingroon KP3S PRO S1.json} (100%) diff --git a/resources/profiles/Kingroon/machine/kingroon kp3s pro s1 0.4 nozzle.json b/resources/profiles/Kingroon/machine/Kingroon KP3S PRO S1 0.4 nozzle.json similarity index 100% rename from resources/profiles/Kingroon/machine/kingroon kp3s pro s1 0.4 nozzle.json rename to resources/profiles/Kingroon/machine/Kingroon KP3S PRO S1 0.4 nozzle.json diff --git a/resources/profiles/Kingroon/machine/kingroon kp3s pro s1.json b/resources/profiles/Kingroon/machine/Kingroon KP3S PRO S1.json similarity index 100% rename from resources/profiles/Kingroon/machine/kingroon kp3s pro s1.json rename to resources/profiles/Kingroon/machine/Kingroon KP3S PRO S1.json diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index a1d44dac..31caadef 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -101,7 +101,13 @@ bool ProfileLoader::_LoadModel(ProfileMachine& profile, const std::string& vendo using json = nlohmann::json; boost::nowide::ifstream ifs(vendor_path.string()); json data; - ifs >> data; + try { + ifs >> data; + } catch (const std::exception& e) { + BOOST_LOG_TRIVIAL(warning) << "ProfileLoader: skip vendor \"" << vendor << "\", failed to load \"" + << vendor_path.string() << "\": " << e.what(); + return false; + } if (!data.contains("name") || !data["name"].is_string()) return false; if (!data.contains("machine_model_list") || !data["machine_model_list"].is_array()) @@ -169,7 +175,16 @@ bool ProfileLoader::_LoadModelImpl(ProfileModel& profile, const std::string& ven boost::filesystem::path model_path = boost::filesystem::absolute(root_path / vendor / sub_path).make_preferred(); boost::nowide::ifstream ifs(model_path.string()); json model_data; - ifs >> model_data; + // A missing or malformed model file must not abort the whole profile load: + // skip this model instead of letting the parse error propagate (case-sensitive + // filesystems surface broken sub_path references that Windows/macOS hide). + try { + ifs >> model_data; + } catch (const std::exception& e) { + BOOST_LOG_TRIVIAL(warning) << "ProfileLoader: skip model \"" << model << "\", failed to load \"" + << model_path.string() << "\": " << e.what(); + return false; + } if (!model_data.contains("nozzle_diameter") || !model_data["nozzle_diameter"].is_string()) return false; std::vector nozzle_group; @@ -288,7 +303,12 @@ bool ProfileLoader::_LoadPrinterImpl(ProfilePrinter& profile, const std::string& using json = nlohmann::json; boost::nowide::ifstream ifs(path); json data; - ifs >> data; + try { + ifs >> data; + } catch (const std::exception& e) { + BOOST_LOG_TRIVIAL(warning) << "ProfileLoader: skip printer profile \"" << path << "\": " << e.what(); + return false; + } if (!data.contains("type") || !data["type"].is_string() || data["type"]!="machine") return false; if (!data.contains("name") || !data["type"].is_string()) From fa4c20c4c9915041494f7a21c544237bfc73ae46 Mon Sep 17 00:00:00 2001 From: Tim Johannes Date: Thu, 4 Jun 2026 21:39:38 +0200 Subject: [PATCH 6/8] Fix settings inputs being read-only on Linux (#565, #552) ParamsDialog (filament/process/printer settings) installs a wxWindowDisabler(this) on wxEVT_SHOW to behave like a modal dialog. On GTK this ends up making the dialog itself insensitive: the dialog is transient-for the mainframe, which gets gtk_widget_set_sensitive(FALSE), and the dialog goes down with it. The custom-drawn Creality widgets (TextInput, CheckBox, SwitchButton) keep their normal appearance but stop receiving any mouse/keyboard events, so ~all parameter inputs look editable yet behave as read-only. Windows is unaffected because Popup() reparents the dialog under the mainframe first (#ifdef __WIN32__). Skip the modal-style wxWindowDisabler on Linux (#ifndef __linux__). The settings dialog is non-modal there but fully usable again. Fixes CrealityOfficial/CrealityPrint#565 and #552. --- src/slic3r/GUI/ParamsDialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/slic3r/GUI/ParamsDialog.cpp b/src/slic3r/GUI/ParamsDialog.cpp index e875038f..519a04b6 100644 --- a/src/slic3r/GUI/ParamsDialog.cpp +++ b/src/slic3r/GUI/ParamsDialog.cpp @@ -72,7 +72,16 @@ ParamsDialog::ParamsDialog(wxWindow * parent) adjust_dialog_in_screen(this, 1300, 650); Bind(wxEVT_SHOW, [this](auto &event) { if (IsShown()) { +#ifndef __linux__ + // On GTK a wxWindowDisabler that excludes this dialog still ends up + // making the dialog itself insensitive (the dialog is transient-for + // the mainframe, which gets gtk_widget_set_sensitive(FALSE)). The + // custom-drawn Creality widgets keep their normal look but stop + // receiving any mouse/keyboard events, so every parameter input + // appears read-only. See CrealityOfficial/CrealityPrint#565 / #552. + // Skip the modal-style disabler on Linux; the dialog stays usable. m_winDisabler = new wxWindowDisabler(this); +#endif } else { delete m_winDisabler; m_winDisabler = nullptr; From 57d2e932615d55ae1cafdb5842fccf148d80c6fd Mon Sep 17 00:00:00 2001 From: Tim Johannes Date: Fri, 3 Jul 2026 11:21:53 +0200 Subject: [PATCH 7/8] Fix Linux build errors in v7.2.0 sources (GCC vs MSVC) Two new files from Creality's 7.2.0 release only compiled under MSVC: - PrintSettingsPanel.hpp: explicit template specializations of the member trait ConfigOptionType were written inside the class body, which GCC rejects ('explicit specialization in non-namespace scope'). Moved them to namespace scope as PrintSettingsPanel::ConfigOptionType<...>. Cannot lift the trait into namespace Slic3r::GUI because that collides with the global ConfigOptionType enum. - Plater.cpp: the MixedFilament<->Dialog helpers were forward-declared in an anonymous namespace but defined with a redundant 'static' keyword, which GCC flags as an extern-then-static linkage mismatch. Dropped 'static' from the definitions so both share the anonymous namespace's internal linkage. --- src/slic3r/GUI/Plater.cpp | 11 +++--- src/slic3r/GUI/simple/PrintSettingsPanel.hpp | 36 +++++++++----------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index e7c66bb2..0d004ad3 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1173,7 +1173,10 @@ static void remap_model_filament_assignments(const std::vector &re } } -// Forward declarations for MixedFilament <-> Dialog mapping helpers (defined later in anon namespace). +// Forward declarations for MixedFilament <-> Dialog mapping helpers (defined later in +// the anonymous namespace). Kept inside an anonymous namespace so they share the +// definitions' internal linkage; the definitions must NOT use the redundant 'static' +// keyword, or GCC flags an extern-then-static linkage mismatch. namespace { MixedFilamentResult build_result_from_mixed(const MixedFilament& mf); void apply_result_to_mixed(const MixedFilamentResult& r, MixedFilament& mf); @@ -4619,7 +4622,7 @@ static std::string encode_gradient_weights(const std::vector &w) return out; } -static MixedFilamentResult build_result_from_mixed(const MixedFilament& mf) +MixedFilamentResult build_result_from_mixed(const MixedFilament& mf) { MixedFilamentResult r; if (!mf.gradient_component_ids.empty()) { @@ -4637,7 +4640,7 @@ static MixedFilamentResult build_result_from_mixed(const MixedFilament& mf) return r; } -static void apply_result_to_mixed(const MixedFilamentResult& r, MixedFilament& mf) +void apply_result_to_mixed(const MixedFilamentResult& r, MixedFilament& mf) { mf.manual_pattern.clear(); if (r.components.size() >= 3) { @@ -4660,7 +4663,7 @@ static void apply_result_to_mixed(const MixedFilamentResult& r, MixedFilament& m mf.custom = true; } -static void apply_result_append_to_manager(const MixedFilamentResult& r, +void apply_result_append_to_manager(const MixedFilamentResult& r, MixedFilamentManager& mgr, const std::vector& colors) { diff --git a/src/slic3r/GUI/simple/PrintSettingsPanel.hpp b/src/slic3r/GUI/simple/PrintSettingsPanel.hpp index 5295a00c..92a57bac 100644 --- a/src/slic3r/GUI/simple/PrintSettingsPanel.hpp +++ b/src/slic3r/GUI/simple/PrintSettingsPanel.hpp @@ -13,7 +13,7 @@ class PrintSettingsPanel struct PrintSettings { int quality_index = 1; // 0: Fast, 1: Standard, 2: Fine - int infill_density = 15; // Percentage: 0¨C100 + int infill_density = 15; // Percentage: 0�C100 int top_layers = 5; int bottom_layers = 4; int wall_layers = 4; @@ -64,8 +64,8 @@ class PrintSettingsPanel const char* label, int* current_index, const char* const items[], int item_count, float width, ImU32 bg_color, ImU32 button_color) { ImGui::PushStyleColor(ImGuiCol_FrameBg, bg_color); - ImGui::PushStyleColor(ImGuiCol_Button, button_color); // ¿ØÖƼýÍ·°´Å¥ÑÕÉ« - ImGui::PushStyleColor(ImGuiCol_PopupBg, bg_color); // ÏÂÀ­²Ëµ¥±³¾° + ImGui::PushStyleColor(ImGuiCol_Button, button_color); // ���Ƽ�ͷ��ť��ɫ + ImGui::PushStyleColor(ImGuiCol_PopupBg, bg_color); // �����˵����� ImGui::PushItemWidth(width); bool changed = ImGui::Combo(label, current_index, items, item_count); @@ -79,22 +79,22 @@ class PrintSettingsPanel private: static constexpr const char* infill_options[] = {"5%", "10%", "15%", "20%", "25%", "30%", "40%", "50%"}; - // °Ù·Ö±È ¡ú Ë÷Òý + // �ٷֱ� �� ���� int infill_density_to_index(int density) { for (int i = 0; i < IM_ARRAYSIZE(infill_options); ++i) { if (std::stoi(infill_options[i]) == density) return i; } - return 0; // ĬÈÏ»ØÍ˵½µÚÒ»¸ö + return 0; // Ĭ�ϻ��˵���һ�� } - // Ë÷Òý ¡ú °Ù·Ö±È + // ���� �� �ٷֱ� int infill_index_to_density(int index) { if (index >= 0 && index < IM_ARRAYSIZE(infill_options)) return std::stoi(infill_options[index]); - return 15; // ĬÈÏÖµ + return 15; // Ĭ��ֵ } template void safe_get(const DynamicPrintConfig& cfg, const char* key, T& out) @@ -107,22 +107,13 @@ class PrintSettingsPanel if (auto* opt = cfg.option::type>(key)) opt->value = val; } + // Primary template only; explicit specializations live at namespace scope + // below (GCC rejects explicit specialization inside a class body, unlike MSVC). template struct ConfigOptionType; - template<> struct ConfigOptionType - { - using type = ConfigOptionInt; - }; - template<> struct ConfigOptionType - { - using type = ConfigOptionFloat; - }; - - template<> struct ConfigOptionType { using type = ConfigOptionPercent; }; - void load_from_config(PrintSettings& s, const DynamicPrintConfig& config) { - // ÖÊÁ¿µµÎ»µ¥¶À´¦Àí + // ������������� /* if (auto* opt = config.option("sparse_infill_pattern")) { float lh = opt->value; if (lh == 0.20f) @@ -161,10 +152,15 @@ class PrintSettingsPanel PrintSettings settings; - float animated_highlight_x = -1.0f; // ³õʼ»¯ÎªÎÞЧֵ + float animated_highlight_x = -1.0f; // ��ʼ��Ϊ��Чֵ bool m_initialized = false; }; +// Explicit specializations of the member trait, required at namespace scope by GCC. +template<> struct PrintSettingsPanel::ConfigOptionType { using type = ConfigOptionInt; }; +template<> struct PrintSettingsPanel::ConfigOptionType { using type = ConfigOptionFloat; }; +template<> struct PrintSettingsPanel::ConfigOptionType { using type = ConfigOptionPercent; }; + using PrintSettings = PrintSettingsPanel::PrintSettings; } } // namespace slic3r From b987a99058b2d7029c48d9239de002ac253610fa Mon Sep 17 00:00:00 2001 From: Tim Johannes Date: Fri, 3 Jul 2026 15:58:03 +0200 Subject: [PATCH 8/8] Build and bundle translations in the Linux package The .po files are compiled into resources/i18n//CrealityPrint.mo by the 'gettext_po_to_mo' custom target, which the default build does not run. Without it the Linux AppImage ships an empty resources/i18n (English-only UI), even though 19 locales (incl. pt_BR, de, zh_CN, ...) are available in the tree. Invoke the target in the -s build step so every locale gets packaged. --- BuildLinux.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BuildLinux.sh b/BuildLinux.sh index 29bf8a47..9d49effd 100755 --- a/BuildLinux.sh +++ b/BuildLinux.sh @@ -211,6 +211,11 @@ then echo "Building CrealityPrint_profile_validator .." #cmake --build build --target CrealityPrint_profile_validator ./run_gettext.sh + # Compile the .po translations into resources/i18n//CrealityPrint.mo. + # This is a standalone custom target that the default build does NOT run, so + # without it the Linux package ships with an empty resources/i18n (English only). + echo "Building translations (gettext_po_to_mo) ..." + cmake --build build --target gettext_po_to_mo echo "done" fi