From b368483aaa26906d7d1e8b5d88204144e1f176f6 Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Thu, 13 Feb 2025 18:06:06 +0800 Subject: [PATCH] FIX: champer_switch_head_dlg->ShowModal() may wake up another wxCUSTOMEVT_SET_TEMP_FINISH, break the chain jira: [STUDIO-10386] Change-Id: I2debe9eebf455e4adbe9161945ce84508f594f9d (cherry picked from commit 26881072a44d755335931a3f800bc7548744acc5) --- src/slic3r/GUI/StatusPanel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 306bf88c99..7ad745869e 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -3925,6 +3925,7 @@ void StatusPanel::on_set_nozzle_temp(int nozzle_id) void StatusPanel::on_set_chamber_temp() { if (!obj) {return;} + if (champer_switch_head_dlg && champer_switch_head_dlg->IsShown()) { return; } /*STUDIO-10386 champer_switch_head_dlg->ShowModal() could wake up another wxCUSTOMEVT_SET_TEMP_FINISH*/ wxString str = m_tempCtrl_chamber->GetTextCtrl()->GetValue(); try { @@ -3939,8 +3940,11 @@ void StatusPanel::on_set_chamber_temp() if (chamber_temp >= obj->chamber_temp_switch_heat) { - delete champer_switch_head_dlg; - champer_switch_head_dlg = new MessageDialog(nullptr, _L("If the chamber temperature exceeds 40\u2103, the system will automatically switch to heating mode. Please confirm whether to switch."), wxEmptyString, wxICON_WARNING | wxOK | wxCANCEL); + if (!champer_switch_head_dlg) + { + champer_switch_head_dlg = new MessageDialog(this, _L("If the chamber temperature exceeds 40\u2103, the system will automatically switch to heating mode. Please confirm whether to switch."), + wxEmptyString, wxICON_WARNING | wxOK | wxCANCEL); + } if (champer_switch_head_dlg->ShowModal() != wxID_OK) {