From 32b69529504689bc71c62558c22041b2864fa872 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Fri, 31 Mar 2023 09:14:22 +0800 Subject: [PATCH] FIX: [STUDIO-2596] import preset missing base_id Change-Id: I2725906da26a471aef66eb8f29bf156ad00b1ec0 --- src/libslic3r/PresetBundle.cpp | 4 +++- src/slic3r/GUI/Preferences.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index d875eaad3f..c1f859b5c1 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -666,9 +666,10 @@ PresetsConfigSubstitutions PresetBundle::import_presets(std::vector DynamicPrintConfig new_config; Preset * inherit_preset = nullptr; ConfigOption *inherits_config = config.option(BBL_JSON_KEY_INHERITS); + std::string inherits_value; if (inherits_config) { ConfigOptionString *option_str = dynamic_cast(inherits_config); - std::string inherits_value = option_str->value; + inherits_value = option_str->value; inherit_preset = collection->find_preset(inherits_value, false, true); } if (inherit_preset) { @@ -685,6 +686,7 @@ PresetsConfigSubstitutions PresetBundle::import_presets(std::vector Preset &preset = collection->load_preset(collection->path_from_name(name), name, std::move(new_config), false); preset.is_external = true; preset.version = *version; + inherit_preset = collection->find_preset(inherits_value, false, true); // pointer maybe wrong after insert, redo find if (inherit_preset) preset.base_id = inherit_preset->setting_id; Preset::normalize(preset.config); diff --git a/src/slic3r/GUI/Preferences.cpp b/src/slic3r/GUI/Preferences.cpp index dd7ab427e6..a7e6142368 100644 --- a/src/slic3r/GUI/Preferences.cpp +++ b/src/slic3r/GUI/Preferences.cpp @@ -920,7 +920,7 @@ wxWindow* PreferencesDialog::create_general_page() auto title_presets = create_item_title(_L("Presets"), page, _L("Presets")); auto item_user_sync = create_item_checkbox(_L("Auto sync user presets(Printer/Filament/Process)"), page, _L("User Sync"), 50, "sync_user_preset"); - auto item_system_sync = create_item_checkbox(_L("Auto sync system presets(Printer/Filament/Process)"), page, _L("System Sync"), 50, "sync_system_preset"); + auto item_system_sync = create_item_checkbox(_L("Update built-in Presets automatically."), page, _L("System Sync"), 50, "sync_system_preset"); auto item_save_presets = create_item_button(_L("Clear my choice on the unsaved presets."), _L("Clear"), page, _L("Clear my choice on the unsaved presets."), []() { wxGetApp().app_config->set("save_preset_choise", ""); });