FIX:show msgdialog when user selected timelapse_no_toolhead first time

Change-Id: I08307aae17ccc93ae4448016504f68ab9e67558b
(cherry picked from commit 41a9cd933b6c98b7b2fbeea3b3863e3bce56e27a)
This commit is contained in:
Tao Wang 2022-07-26 15:46:01 +08:00 committed by Lane.Wei
parent 252aa91ae7
commit ae45af1688
4 changed files with 19 additions and 13 deletions

View file

@ -1374,6 +1374,12 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
if (opt_key == "enable_prime_tower" || opt_key == "single_extruder_multi_material" || opt_key == "extruders_count" )
update_wiping_button_visibility();
//popup message dialog when first selected
if (opt_key == "timelapse_no_toolhead" && boost::any_cast<bool>(value))
show_timelapse_warning_dialog();
// BBS
#if 0
if (opt_key == "extruders_count")
@ -1391,6 +1397,16 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
m_page_view->GetParent()->Layout();
}
void Tab::show_timelapse_warning_dialog() {
if (!m_is_timelapse_wipe_tower_already_prompted) {
wxString msg_text = _(L("When recording timelapse without toolhead, it is recommended to add a \"Timelapse Wipe Tower\" \n"
"by right-click the empty position of build plate and choose \"Add Primitive\"->\"Timelapse Wipe Tower\".\n"));
MessageDialog dialog(nullptr, msg_text, "", wxICON_WARNING | wxOK);
dialog.ShowModal();
m_is_timelapse_wipe_tower_already_prompted = true;
}
}
// Show/hide the 'purging volumes' button
void Tab::update_wiping_button_visibility() {
if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA)
@ -1503,7 +1519,6 @@ void Tab::apply_config_from_cache()
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<<boost::format(": exit, was_applied=%1%")%was_applied;
}
// Call a callback to update the selection of presets on the plater:
// To update the content of the selection boxes,
// to update the filament colors of the selection boxes,