From a152c7bcade3db11517eadf401e6e6ea3f0133ee Mon Sep 17 00:00:00 2001 From: SoftFever Date: Fri, 17 Jul 2026 18:34:15 +0800 Subject: [PATCH] Name the plugin capability config option consistently MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The preset option was plugin_preference_overrides while the GUI field type that renders it was GUIType::plugin_config, for one and the same thing. Settle on "config": the store, the dialog and the Python hooks all say config already, so renaming that way touches 4 files instead of the whole plugin subsystem and the public plugin API. Keep the _overrides suffix — the option is the preset's override layer over the base PluginConfig store, a distinction EffectiveCapabilityConfig tracks. Also wrap the printer tab's group heading in L(); it was the only one of the three missing it, and was therefore untranslatable. --- src/libslic3r/Preset.cpp | 6 +++--- src/libslic3r/PrintConfig.cpp | 4 ++-- src/slic3r/GUI/Tab.cpp | 12 ++++++------ src/slic3r/plugin/PluginConfig.hpp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index ccb80cd125..bfe66069d1 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1203,7 +1203,7 @@ static std::vector s_Preset_print_options{ "post_process", "slicing_pipeline_plugin", "plugins", - "plugin_preference_overrides", + "plugin_config_overrides", "process_change_extrusion_role_gcode", "min_length_factor", "wall_maximum_resolution", @@ -1378,7 +1378,7 @@ static std::vector s_Preset_filament_options {/*"filament_colour", "filament_preheat_temperature_delta", "filament_retract_length_nc", "filament_change_length_nc", "filament_prime_volume_nc", "long_retractions_when_ec", "retraction_distances_when_ec", - "plugin_preference_overrides", + "plugin_config_overrides", //ams chamber "filament_dev_ams_drying_ams_limitations", "filament_dev_ams_drying_temperature", "filament_dev_ams_drying_time", "filament_dev_ams_drying_heat_distortion_temperature", "filament_dev_chamber_drying_bed_temperature", "filament_dev_chamber_drying_time", @@ -1430,7 +1430,7 @@ static std::vector s_Preset_printer_options { // Fast-purge printer flag + device/firmware-facing per-variant extruder-change // deretraction speed (unconsumed by the slicer; carried by H2D/A2L/X2D/P2S machine profiles). "support_fast_purge_mode", "deretract_speed_extruder_change", - "plugin_preference_overrides" + "plugin_config_overrides" }; static std::vector s_Preset_sla_print_options { diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index af1d380dde..e3d417d224 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1081,12 +1081,12 @@ void PrintConfigDef::init_common_params() def->set_default_value(new ConfigOptionString()); } - def = this->add("plugin_preference_overrides", coString); + def = this->add("plugin_config_overrides", coString); def->label = L("Capabilities"); def->tooltip = L("Configuration for the plugin capabilities this preset uses, overriding the global " "Capabilities configuration. Stored as a raw JSON array and edited through the dialog " "behind the button, never typed in directly."); - // Never shown as a text field: plugin_config renders a button that opens PluginsConfigDialog. + // Never shown as a text field: GUIType::plugin_config renders a button that opens PluginsConfigDialog. def->gui_type = ConfigOptionDef::GUIType::plugin_config; def->mode = comAdvanced; def->cli = ConfigOptionDef::nocli; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 55e4d8e14a..28d4ac8614 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3124,8 +3124,8 @@ void TabPrint::build() // Its own group: the one above hides its labels, and this row needs its label — and the revert // arrow beside it — to show. No label-width override either, as a 0 there means "no label column". - optgroup = page->new_optgroup(L("Plugin Preferences"), L"param_gcode"); - optgroup->append_single_option_line("plugin_preference_overrides"); + optgroup = page->new_optgroup(L("Plugin Configuration"), L"param_gcode"); + optgroup->append_single_option_line("plugin_config_overrides"); optgroup = page->new_optgroup(L("Notes"), "note", 0); option = optgroup->get_option("notes"); @@ -4528,8 +4528,8 @@ void TabFilament::build() option.opt.height = gcode_field_height;// 150; optgroup->append_single_option_line(option); - optgroup = page->new_optgroup(L("Plugin Preferences"), L"param_gcode"); - optgroup->append_single_option_line("plugin_preference_overrides"); + optgroup = page->new_optgroup(L("Plugin Configuration"), L"param_gcode"); + optgroup->append_single_option_line("plugin_config_overrides"); page = add_options_page(L("Multimaterial"), "custom-gcode_multi_material"); // ORCA: icon only visible on placeholders optgroup = page->new_optgroup(L("Wipe tower parameters"), "param_tower"); @@ -5037,8 +5037,8 @@ void TabPrinter::build_fff() // optgroup->append_single_option_line("spaghetti_detector"); optgroup->append_single_option_line("time_cost", "printer_basic_information_advanced#time-cost"); - optgroup = page->new_optgroup("Plugin Preferences", L"param_gcode"); - optgroup->append_single_option_line("plugin_preference_overrides"); + optgroup = page->new_optgroup(L("Plugin Configuration"), L"param_gcode"); + optgroup->append_single_option_line("plugin_config_overrides"); optgroup = page->new_optgroup(L("Cooling Fan"), "param_cooling_fan"); Line line = Line{ L("Fan speed-up time"), optgroup->get_option("fan_speedup_time").opt.tooltip }; diff --git a/src/slic3r/plugin/PluginConfig.hpp b/src/slic3r/plugin/PluginConfig.hpp index 24aa7ea88b..75d468e82f 100644 --- a/src/slic3r/plugin/PluginConfig.hpp +++ b/src/slic3r/plugin/PluginConfig.hpp @@ -44,7 +44,7 @@ private: std::vector m_opaque_entries; }; -inline constexpr const char* PLUGIN_OVERRIDES_OPTION_KEY = "plugin_preference_overrides"; +inline constexpr const char* PLUGIN_OVERRIDES_OPTION_KEY = "plugin_config_overrides"; std::string plugin_overrides_of(const Preset& preset); bool parse_plugin_overrides(const std::string& raw, CapabilityConfigDocument& document, std::string& error);