diff --git a/.dockerignore b/.dockerignore index 378649ff6..fef3abe77 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 index 29bf8a478..9d49effd2 --- 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 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 diff --git a/Dockerfile b/Dockerfile index 7cbe27d8a..b143240e4 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 cec46170e..f7c9a0c70 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 ade668af4..a5506b0be 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/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/CMakeLists.txt b/src/CMakeLists.txt index 315ab9abd..9d25babbd 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,14 @@ 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 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 /usr/lib/x86_64-linux-gnu/libLerc.so") +endif() set(PROJECT_DLL ${PROJECT_DLL_NAME_WIN32}) if(WIN32) set(PROJECT_DLL ${PROJECT_DLL_NAME_WIN32}) @@ -193,14 +201,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 +250,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 a9570bf0a..dbeb997f8 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) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index a1d44dac2..31caadef8 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()) diff --git a/src/slic3r/GUI/ParamsDialog.cpp b/src/slic3r/GUI/ParamsDialog.cpp index e875038f6..519a04b6e 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; diff --git a/src/slic3r/GUI/ParamsPanel.cpp b/src/slic3r/GUI/ParamsPanel.cpp index 93febbcb5..b2628323e 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(); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index e7c66bb24..0d004ad30 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 5295a00c9..92a57bac2 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