From 5108b721a92a105c52600cb57ca14b7ba4abcfa9 Mon Sep 17 00:00:00 2001 From: Kiss Lorand <50251547+kisslorand@users.noreply.github.com> Date: Sun, 10 May 2026 10:11:23 +0300 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=9CJump=20to=E2=80=9D=20links=20for?= =?UTF-8?q?=20non-print=20preset=20settings=20(#13381)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix "Jump to" links opening wrong preset type Fixes an issue where notification "Jump to" links always assumed the target setting belongs to the Print preset. Resolve the correct preset type for each option before jumping to it, and only switch to object settings when the target is a Print preset. Result: links now correctly open the intended setting across all preset types. --- src/slic3r/GUI/NotificationManager.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp index c3209d052c..9875ae553b 100644 --- a/src/slic3r/GUI/NotificationManager.cpp +++ b/src/slic3r/GUI/NotificationManager.cpp @@ -9,6 +9,7 @@ #include "GUI_ObjectList.hpp" #include "ParamsPanel.hpp" #include "MainFrame.hpp" +#include "Tab.hpp" #include "libslic3r/Config.hpp" #include "format.hpp" @@ -111,6 +112,21 @@ namespace { } #endif } + + // Orca: Resolve the type of a validation option based on its key + Preset::Type resolve_validation_option_type(const std::string& opt_key) + { + if (opt_key.empty()) + return Preset::TYPE_PRINT; + + if (wxGetApp().get_tab(Preset::TYPE_PRINTER)->get_config()->def()->has(opt_key)) + return Preset::TYPE_PRINTER; + + if (wxGetApp().get_tab(Preset::TYPE_FILAMENT)->get_config()->def()->has(opt_key)) + return Preset::TYPE_FILAMENT; + + return Preset::TYPE_PRINT; + } } #if 1 @@ -1917,9 +1933,12 @@ void NotificationManager::push_validate_error_notification(StringObjectException } if (!opt.empty()) { - if ((!is_inst && id.id) || (is_inst && parent_id.id)) // if object found + const Preset::Type opt_type = resolve_validation_option_type(opt); + + if (opt_type == Preset::TYPE_PRINT && ((!is_inst && id.id) || (is_inst && parent_id.id))) // if object found and it's a print preset option, switch to object first wxGetApp().params_panel()->switch_to_object(); - wxGetApp().sidebar().jump_to_option(opt, Preset::TYPE_PRINT, L""); + + wxGetApp().sidebar().jump_to_option(opt, opt_type, L""); } else { wxGetApp().mainframe->select_tab(MainFrame::tp3DEditor);