ENH: add "Don't show again" to fan speed control

jira: [STUDIO-11231]
Change-Id: I160d122155302195edf4b97e8b92e96350f9d600
This commit is contained in:
xin.zhang 2025-04-01 09:44:53 +08:00 committed by lane.wei
parent f9eecbb4b7
commit 0ba097de36
1 changed files with 13 additions and 4 deletions

View File

@ -17,6 +17,7 @@ wxDEFINE_EVENT(EVT_FAN_DEC, wxCommandEvent);
wxDEFINE_EVENT(EVT_FAN_CHANGED, wxCommandEvent);
constexpr int time_out = 10;
static bool not_show_fan_speed_warning_dlg = false;
/*************************************************
Description:Fan
@ -219,10 +220,14 @@ void FanOperate::set_fan_speeds(int g)
bool FanOperate::check_printing_state()
{
if (m_obj && m_obj->is_in_printing()) {
if (m_obj && !not_show_fan_speed_warning_dlg && m_obj->is_in_printing()) {
MessageDialog msg_wingow(nullptr, _L("Changing fan speed during pringing may affect print quality, please choose carefully."), "", wxICON_WARNING | wxCANCEL | wxOK);
msg_wingow.SetButtonLabel(wxID_OK, _L("Change Anyway"));
if (msg_wingow.ShowModal() == wxID_CANCEL) { return false; }
msg_wingow.show_dsa_button();
bool ok = msg_wingow.ShowModal();
if (ok && msg_wingow.get_checkbox_state()) { not_show_fan_speed_warning_dlg = true; }
return ok;
}
return true;
}
@ -466,10 +471,14 @@ void FanControlNew::command_control_fan()
bool FanControlNew::check_printing_state()
{
if (m_obj && m_obj->is_in_printing()) {
if (m_obj && !not_show_fan_speed_warning_dlg && m_obj->is_in_printing()) {
MessageDialog msg_wingow(nullptr, _L("Changed fan speed during pringing may affect print quality, please choose carefully."), "", wxICON_WARNING | wxCANCEL | wxOK);
msg_wingow.SetButtonLabel(wxID_OK, _L("Change Anyway"));
if (msg_wingow.ShowModal() == wxID_CANCEL) { return false; }
msg_wingow.show_dsa_button();
bool ok = msg_wingow.ShowModal();
if (ok && msg_wingow.get_checkbox_state()) { not_show_fan_speed_warning_dlg = true; }
return ok;
}
return true;
}