From ae45af16885fbf0a3ab3cd1db4ff99cdd25b1ee2 Mon Sep 17 00:00:00 2001 From: Tao Wang Date: Tue, 26 Jul 2022 15:46:01 +0800 Subject: [PATCH] FIX:show msgdialog when user selected timelapse_no_toolhead first time Change-Id: I08307aae17ccc93ae4448016504f68ab9e67558b (cherry picked from commit 41a9cd933b6c98b7b2fbeea3b3863e3bce56e27a) --- src/slic3r/GUI/ConfigManipulation.cpp | 11 ----------- src/slic3r/GUI/ConfigManipulation.hpp | 1 - src/slic3r/GUI/Tab.cpp | 17 ++++++++++++++++- src/slic3r/GUI/Tab.hpp | 3 +++ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index f88d51466..ce16875f1 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -291,17 +291,6 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con is_msg_dlg_already_exist = false; } - //BBS - if (config->opt_bool("timelapse_no_toolhead") && !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(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK); - is_msg_dlg_already_exist = true; - dialog.ShowModal(); - is_msg_dlg_already_exist = false; - is_timelapse_wipe_tower_already_prompted = true; - } - // BBS int filament_cnt = wxGetApp().preset_bundle->filament_presets.size(); #if 0 diff --git a/src/slic3r/GUI/ConfigManipulation.hpp b/src/slic3r/GUI/ConfigManipulation.hpp index e57c848dd..c7300639d 100644 --- a/src/slic3r/GUI/ConfigManipulation.hpp +++ b/src/slic3r/GUI/ConfigManipulation.hpp @@ -21,7 +21,6 @@ namespace GUI { class ConfigManipulation { bool is_msg_dlg_already_exist{ false }; - bool is_timelapse_wipe_tower_already_prompted{false}; // BBS bool m_is_initialized_support_material_overhangs_queried{ false }; bool m_support_material_overhangs_queried{ false }; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 8e65ddea0..9d91c2c1f 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -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(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__<& selected_options); void apply_config_from_cache(); + void show_timelapse_warning_dialog(); const std::map& get_category_icon_map() { return m_category_icon; } //BBS: GUI refactor