From 374fc61688bc439f36c3ca833a043a66bc579150 Mon Sep 17 00:00:00 2001 From: Christos Karampeazis-Papadakis Date: Fri, 28 Jun 2024 11:41:14 +0200 Subject: [PATCH] Trigger change in project upon layer-specific gcode changes (Fixes supermerill/SuperSlicer#4261) supermerill/SuperSlicer#4334 --- src/slic3r/GUI/GUI_Preview.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index 4dd7a6b9758..f6f52235459 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -632,9 +632,15 @@ wxBoxSizer* Preview::create_layers_slider_sizer() Bind(DoubleSlider::wxCUSTOMEVT_TICKSCHANGED, [this](wxEvent&) { Model& model = wxGetApp().plater()->model(); Info custom_gcode_per_print_z = m_layers_slider->GetTicksValues(); + auto num_of_old_gcodes = model.custom_gcode_per_print_z.gcodes.size(); model.custom_gcode_per_print_z = custom_gcode_per_print_z; - m_schedule_background_process(); + std::string operation_message = (num_of_old_gcodes == model.custom_gcode_per_print_z.gcodes.size()) ? "Edit" : + (num_of_old_gcodes < model.custom_gcode_per_print_z.gcodes.size()) ? "Add" : + "Remove"; + m_schedule_background_process(); + wxGetApp().plater()->take_snapshot(from_u8( + (boost::format(_utf8(L("Change layer gcode: %s element"))) % operation_message).str())); m_keep_current_preview_type = false; reload_print(false); });