Only warning about sparse infill rotation template the first time (#13461)

Only warning the first time
This commit is contained in:
Rodrigo Faselli
2026-05-09 02:45:18 -03:00
committed by GitHub
parent 4abda6bffe
commit db8ca5feac
2 changed files with 7 additions and 1 deletions

View File

@@ -1241,6 +1241,8 @@ void Tab::reload_config()
{ {
if (m_active_page) if (m_active_page)
m_active_page->reload_config(); m_active_page->reload_config();
if (m_type == Preset::TYPE_PRINT && m_config != nullptr)
m_last_sparse_infill_rotate_template_value = m_config->opt_string("sparse_infill_rotate_template");
} }
void Tab::update_mode() void Tab::update_mode()
@@ -1744,8 +1746,9 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
auto new_value = boost::any_cast<std::string>(value); auto new_value = boost::any_cast<std::string>(value);
is_safe_to_rotate = is_safe_to_rotate || new_value.empty(); is_safe_to_rotate = is_safe_to_rotate || new_value.empty();
const bool had_previous_value = !m_last_sparse_infill_rotate_template_value.empty();
if (!is_safe_to_rotate) { if (!is_safe_to_rotate && !had_previous_value) {
wxString msg_text = _( wxString msg_text = _(
L("Infill patterns are typically designed to handle rotation automatically to ensure proper printing and achieve their " L("Infill patterns are typically designed to handle rotation automatically to ensure proper printing and achieve their "
"intended effects (e.g., Gyroid, Cubic). Rotating the current sparse infill pattern may lead to insufficient support. " "intended effects (e.g., Gyroid, Cubic). Rotating the current sparse infill pattern may lead to insufficient support. "
@@ -1762,6 +1765,8 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
wxGetApp().plater()->update(); wxGetApp().plater()->update();
} }
} }
m_last_sparse_infill_rotate_template_value = m_config->opt_string("sparse_infill_rotate_template");
} }
if(opt_key=="layer_height"){ if(opt_key=="layer_height"){

View File

@@ -445,6 +445,7 @@ protected:
void filter_diff_option(std::vector<std::string> &options); void filter_diff_option(std::vector<std::string> &options);
ConfigManipulation m_config_manipulation; ConfigManipulation m_config_manipulation;
std::string m_last_sparse_infill_rotate_template_value;
ConfigManipulation get_config_manipulation(); ConfigManipulation get_config_manipulation();
friend class EditGCodeDialog; friend class EditGCodeDialog;
}; };