mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 20:03:47 +00:00
Fix filament override changes not appearing in Unsaved Changes and showing as “Undef category” in preset comparison (#12298)
This commit is contained in:
@@ -1661,7 +1661,8 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres
|
|||||||
//m_tree->model->AddPreset(type, from_u8(presets->get_edited_preset().name), old_pt);
|
//m_tree->model->AddPreset(type, from_u8(presets->get_edited_preset().name), old_pt);
|
||||||
|
|
||||||
// Collect dirty options.
|
// Collect dirty options.
|
||||||
const bool deep_compare = (type == Preset::TYPE_PRINTER || type == Preset::TYPE_SLA_MATERIAL);
|
const bool deep_compare = (type == Preset::TYPE_PRINTER ||
|
||||||
|
type == Preset::TYPE_FILAMENT || type == Preset::TYPE_SLA_MATERIAL);
|
||||||
auto dirty_options = presets->current_dirty_options(deep_compare);
|
auto dirty_options = presets->current_dirty_options(deep_compare);
|
||||||
|
|
||||||
// process changes of extruders count
|
// process changes of extruders count
|
||||||
@@ -1682,11 +1683,15 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const std::string& opt_key : dirty_options) {
|
for (const std::string& opt_key : dirty_options) {
|
||||||
const Search::Option& option = searcher.get_option(opt_key, type);
|
const std::string lookup_key = get_pure_opt_key(opt_key);
|
||||||
if (option.opt_key() != opt_key) {
|
Search::Option option = searcher.get_option(lookup_key, type);
|
||||||
// When founded option isn't the correct one.
|
if (get_pure_opt_key(option.opt_key()) != lookup_key)
|
||||||
// It can be for dirty_options: "default_print_profile", "printer_model", "printer_settings_id",
|
option = searcher.get_option(opt_key, get_full_label(opt_key, new_config), type);
|
||||||
// because of they don't exist in searcher
|
if (get_pure_opt_key(option.opt_key()) != lookup_key) {
|
||||||
|
// When the found option is not the requested one.
|
||||||
|
// This can happen for dirty_options such as:
|
||||||
|
// "default_print_profile", "printer_model", "printer_settings_id",
|
||||||
|
// because they do not exist in the searcher.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2190,7 +2195,8 @@ void DiffPresetDialog::update_tree()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Collect dirty options.
|
// Collect dirty options.
|
||||||
const bool deep_compare = (type == Preset::TYPE_PRINTER || type == Preset::TYPE_SLA_MATERIAL);
|
const bool deep_compare = (type == Preset::TYPE_PRINTER ||
|
||||||
|
type == Preset::TYPE_FILAMENT || type == Preset::TYPE_SLA_MATERIAL);
|
||||||
auto dirty_options = type == Preset::TYPE_PRINTER && left_pt == ptFFF &&
|
auto dirty_options = type == Preset::TYPE_PRINTER && left_pt == ptFFF &&
|
||||||
left_config.opt<ConfigOptionStrings>("extruder_colour")->values.size() < right_congig.opt<ConfigOptionStrings>("extruder_colour")->values.size() ?
|
left_config.opt<ConfigOptionStrings>("extruder_colour")->values.size() < right_congig.opt<ConfigOptionStrings>("extruder_colour")->values.size() ?
|
||||||
presets->dirty_options(right_preset, left_preset, deep_compare) :
|
presets->dirty_options(right_preset, left_preset, deep_compare) :
|
||||||
@@ -2229,13 +2235,15 @@ void DiffPresetDialog::update_tree()
|
|||||||
wxString left_val = get_string_value(opt_key, left_config);
|
wxString left_val = get_string_value(opt_key, left_config);
|
||||||
wxString right_val = get_string_value(opt_key, right_congig);
|
wxString right_val = get_string_value(opt_key, right_congig);
|
||||||
|
|
||||||
Search::Option option = searcher.get_option(opt_key, get_full_label(opt_key, left_config), type);
|
const std::string lookup_key = get_pure_opt_key(opt_key);
|
||||||
if (option.opt_key() != opt_key) {
|
Search::Option option = searcher.get_option(lookup_key, type);
|
||||||
// temporary solution, just for testing
|
if (get_pure_opt_key(option.opt_key()) != lookup_key)
|
||||||
m_tree->Append(opt_key, type, "Undef category", "Undef group", opt_key, left_val, right_val, "undefined"); // ORCA: use low resolution compatible icon
|
option = searcher.get_option(opt_key, get_full_label(opt_key, left_config), type);
|
||||||
// When founded option isn't the correct one.
|
if (get_pure_opt_key(option.opt_key()) != lookup_key) {
|
||||||
// It can be for dirty_options: "default_print_profile", "printer_model", "printer_settings_id",
|
// When the found option is not the requested one.
|
||||||
// because of they don't exist in searcher
|
// This can happen for dirty_options such as:
|
||||||
|
// "default_print_profile", "printer_model", "printer_settings_id",
|
||||||
|
// because they do not exist in the searcher.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
m_tree->Append(opt_key, type, option.category_local, option.group_local, option.label_local,
|
m_tree->Append(opt_key, type, option.category_local, option.group_local, option.label_local,
|
||||||
|
|||||||
Reference in New Issue
Block a user