From 9f1e01b750636916065bce47aae6210eaa4596b7 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 2 Dec 2019 09:59:20 +0100 Subject: [PATCH] Fixed "Pause print" and "Custom Gcode" cancel. It was possible to add empty code, when "Cancel" button was selected --- src/slic3r/GUI/wxExtensions.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 160912ab9..aa0a736ce 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -3558,11 +3558,17 @@ void DoubleSlider::add_code(std::string code, int selected_extruder/* = -1*/) /* PausePrintCode doesn't need a color, so * this field is used for save a short message shown on Printer display * */ - m_pause_print_msg = color = get_pause_print_msg(m_pause_print_msg, m_values[tick]); + color = get_pause_print_msg(m_pause_print_msg, m_values[tick]); + if (color.empty()) + return; + m_pause_print_msg = color; } else if (code.empty()) { - m_custom_gcode = code = get_custom_code(m_custom_gcode, m_values[tick]); + code = get_custom_code(m_custom_gcode, m_values[tick]); + if (code.empty()) + return; + m_custom_gcode = code; } int extruder = 1;