mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-12 04:41:48 +08:00
Fix for #7781 - Entering value in Thumbnail setting causes PrusaSlicer to crash
Follow-up 106e520a - During code refactoring "thumbnails" option wasn't correctly processed
This commit is contained in:
parent
e0883910dd
commit
ded855d0c2
@ -1136,6 +1136,7 @@ void add_correct_opts_to_diff(const std::string &opt_key, t_config_option_keys&
|
|||||||
// list of options with vector variable, which is independent from number of extruders
|
// list of options with vector variable, which is independent from number of extruders
|
||||||
static const std::vector<std::string> independent_from_extruder_number_options = {
|
static const std::vector<std::string> independent_from_extruder_number_options = {
|
||||||
"bed_shape",
|
"bed_shape",
|
||||||
|
"thumbnails",
|
||||||
"filament_ramming_parameters",
|
"filament_ramming_parameters",
|
||||||
"gcode_substitutions",
|
"gcode_substitutions",
|
||||||
"compatible_prints",
|
"compatible_prints",
|
||||||
|
@ -596,8 +596,8 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config,
|
|||||||
value = int(nozzle_diameter->values.size());
|
value = int(nozzle_diameter->values.size());
|
||||||
}
|
}
|
||||||
else if (m_opt_map.find(opt_key) == m_opt_map.end() ||
|
else if (m_opt_map.find(opt_key) == m_opt_map.end() ||
|
||||||
// This option don't have corresponded field
|
// This option doesn't have corresponded field
|
||||||
PresetCollection::is_independent_from_extruder_number_option(opt_key) ) {
|
is_option_without_field(opt_key) ) {
|
||||||
value = get_config_value(config, opt_key);
|
value = get_config_value(config, opt_key);
|
||||||
this->change_opt_value(opt_key, value);
|
this->change_opt_value(opt_key, value);
|
||||||
return;
|
return;
|
||||||
@ -980,6 +980,11 @@ bool OptionsGroup::launch_browser(const std::string& path_end)
|
|||||||
return wxGetApp().open_browser_with_warning_dialog(OptionsGroup::get_url(path_end), wxGetApp().mainframe->m_tabpanel);
|
return wxGetApp().open_browser_with_warning_dialog(OptionsGroup::get_url(path_end), wxGetApp().mainframe->m_tabpanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OptionsGroup::is_option_without_field(const std::string& opt_key)
|
||||||
|
{
|
||||||
|
return opt_key!= "thumbnails" // "thumbnails" has related field
|
||||||
|
&& PresetCollection::is_independent_from_extruder_number_option(opt_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------
|
||||||
|
@ -225,6 +225,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
static wxString get_url(const std::string& path_end);
|
static wxString get_url(const std::string& path_end);
|
||||||
static bool launch_browser(const std::string& path_end);
|
static bool launch_browser(const std::string& path_end);
|
||||||
|
static bool is_option_without_field(const std::string& opt_key);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConfigOptionsGroup: public OptionsGroup {
|
class ConfigOptionsGroup: public OptionsGroup {
|
||||||
|
@ -532,7 +532,7 @@ void Tab::update_label_colours()
|
|||||||
else
|
else
|
||||||
color = &m_modified_label_clr;
|
color = &m_modified_label_clr;
|
||||||
}
|
}
|
||||||
if (PresetCollection::is_independent_from_extruder_number_option(opt.first)) {
|
if (OptionsGroup::is_option_without_field(opt.first)) {
|
||||||
if (m_colored_Label_colors.find(opt.first) != m_colored_Label_colors.end())
|
if (m_colored_Label_colors.find(opt.first) != m_colored_Label_colors.end())
|
||||||
m_colored_Label_colors.at(opt.first) = *color;
|
m_colored_Label_colors.at(opt.first) = *color;
|
||||||
continue;
|
continue;
|
||||||
@ -573,7 +573,7 @@ void Tab::decorate()
|
|||||||
Field* field = nullptr;
|
Field* field = nullptr;
|
||||||
wxColour* colored_label_clr = nullptr;
|
wxColour* colored_label_clr = nullptr;
|
||||||
|
|
||||||
if(PresetCollection::is_independent_from_extruder_number_option(opt.first))
|
if(OptionsGroup::is_option_without_field(opt.first))
|
||||||
colored_label_clr = (m_colored_Label_colors.find(opt.first) == m_colored_Label_colors.end()) ? nullptr : &m_colored_Label_colors.at(opt.first);
|
colored_label_clr = (m_colored_Label_colors.find(opt.first) == m_colored_Label_colors.end()) ? nullptr : &m_colored_Label_colors.at(opt.first);
|
||||||
|
|
||||||
if (!colored_label_clr) {
|
if (!colored_label_clr) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user