diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index f18f1d5e3..174759f3e 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1069,10 +1069,13 @@ StringObjectException Print::check_multi_filament_valid(const Print& print) StringObjectException ret; + std::string hypertext = "filament_mix_print"; + if(compatibility == FilamentCompatibilityType::HighLowMixed){ if(enable_mix_printing){ ret.string =L("Printing high-temp and low-temp filaments together may cause nozzle clogging or printer damage."); ret.is_warning = true; + ret.hypetext = hypertext; } else{ ret.string =L("Printing high-temp and low-temp filaments together may cause nozzle clogging or printer damage. If you still want to print, you can enable the option in Preferences."); @@ -1080,11 +1083,13 @@ StringObjectException Print::check_multi_filament_valid(const Print& print) } else if (compatibility == FilamentCompatibilityType::HighMidMixed) { ret.is_warning = true; + ret.hypetext = hypertext; ret.string =L("Printing high-temp and mid-temp filaments together may cause nozzle clogging or printer damage."); } else if (compatibility == FilamentCompatibilityType::LowMidMixed) { ret.is_warning = true; + ret.hypetext = hypertext; ret.string = L("Printing mid-temp and low-temp filaments together may cause nozzle clogging or printer damage."); } diff --git a/src/libslic3r/PrintBase.hpp b/src/libslic3r/PrintBase.hpp index 611ca5165..f19a32a4b 100644 --- a/src/libslic3r/PrintBase.hpp +++ b/src/libslic3r/PrintBase.hpp @@ -35,6 +35,7 @@ struct StringObjectException StringExceptionType type; // warning type for tips bool is_warning = false; std::vector params; // warning params for tips + std::string hypetext; }; class CanceledException : public std::exception diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 4e2c9cab0..bea10e42b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -6786,7 +6786,7 @@ void Plater::priv::process_validation_warning(StringObjectException const &warni std::string text = warning.string; auto po = dynamic_cast(warning.object); auto mo = po ? po->model_object() : dynamic_cast(warning.object); - auto action_fn = (mo || !warning.opt_key.empty()) ? [id = mo ? mo->id() : 0, opt = warning.opt_key](wxEvtHandler *) { + auto obj_call_fn= [id = mo ? mo->id() : 0, opt = warning.opt_key](wxEvtHandler *) { auto & objects = wxGetApp().model().objects; auto iter = id.id ? std::find_if(objects.begin(), objects.end(), [id](auto o) { return o->id() == id; }) : objects.end(); if (iter != objects.end()) { @@ -6799,10 +6799,28 @@ void Plater::priv::process_validation_warning(StringObjectException const &warni wxGetApp().sidebar().jump_to_option(opt, Preset::TYPE_PRINT, L""); } return false; - } : std::function(); - auto hypertext = (mo || !warning.opt_key.empty()) ? _u8L("Jump to") : ""; - if (mo) hypertext += std::string(" [") + mo->name + "]"; - if (!warning.opt_key.empty()) hypertext += std::string(" (") + warning.opt_key + ")"; + }; + auto action_fn = (mo || !warning.opt_key.empty()) ? obj_call_fn : std::function(); + std::string hypertext; + // hack code + if (warning.hypetext == "filament_mix_print") { + hypertext = _u8L("Click Wiki for help."); + action_fn = [](wxEvtHandler *)->bool { + bool is_zh = wxGetApp().app_config->get("language") == "zh_CN"; + if (is_zh) { + wxLaunchDefaultBrowser("https://wiki.bambulab.com/zh/filament-acc/filament/h2d-filament-config-limit"); + } else { + wxLaunchDefaultBrowser("https://wiki.bambulab.com/en/filament-acc/filament/h2d-filament-config-limit"); + } + return false; + }; + } else if (!warning.hypetext.empty()) { + hypertext = warning.hypetext; + } else { + if (mo || !warning.opt_key.empty()) hypertext = _u8L("Jump to"); + if (mo) hypertext += std::string(" [") + mo->name + "]"; + if (!warning.opt_key.empty()) hypertext += std::string(" (") + warning.opt_key + ")"; + } // BBS disable support enforcer //if (text == "_SUPPORTS_OFF") {