diff --git a/src/slic3r/GUI/DeviceErrorDialog.cpp b/src/slic3r/GUI/DeviceErrorDialog.cpp index 355defdd27..88b4d1e5e7 100644 --- a/src/slic3r/GUI/DeviceErrorDialog.cpp +++ b/src/slic3r/GUI/DeviceErrorDialog.cpp @@ -156,7 +156,7 @@ void DeviceErrorDialog::init_button_list() init_button(IGNORE_NO_REMINDER_NEXT_TIME, _L("Ignore. Don't Remind Next Time")); init_button(IGNORE_RESUME, _L("Ignore this and Resume")); init_button(PROBLEM_SOLVED_RESUME, _L("Problem Solved and Resume")); - init_button(STOP_BUZZER, _L("Stop Buzzer")); + init_button(TURN_OFF_FIRE_ALARM, _L("Got it, Turn off the Fire Alarm.")); init_button(RETRY_PROBLEM_SOLVED, _L("Retry (problem solved)")); init_button(STOP_DRYING, _L("Stop Drying")); } @@ -206,9 +206,12 @@ void DeviceErrorDialog::update_contents(const wxString& text, const wxString& er m_used_button.clear(); // Show the used buttons + bool need_remove_close_btn = false; std::unordered_set shown_btns; for (int button_id : btns) { + need_remove_close_btn |= (button_id == REMOVE_CLOSE_BTN); // special case, do not show close button + auto iter = m_button_list.find(button_id); if (iter != m_button_list.end()) { @@ -218,6 +221,16 @@ void DeviceErrorDialog::update_contents(const wxString& text, const wxString& er } } + // Special case, do not show close button + if (need_remove_close_btn) + { + SetWindowStyle(GetWindowStyle() & ~wxCLOSE_BOX); + } + else + { + SetWindowStyle(GetWindowStyle() | wxCLOSE_BOX); + } + // Hide unused buttons for (const auto& pair : m_button_list) { @@ -355,7 +368,7 @@ void DeviceErrorDialog::on_button_click(ActionButton btn_id) m_obj->command_hms_resume(std::to_string(m_error_code), m_obj->job_id_); break; } - case DeviceErrorDialog::STOP_BUZZER: { + case DeviceErrorDialog::TURN_OFF_FIRE_ALARM: { m_obj->command_stop_buzzer(); break; } diff --git a/src/slic3r/GUI/DeviceErrorDialog.hpp b/src/slic3r/GUI/DeviceErrorDialog.hpp index 077289ff0e..aaca522735 100644 --- a/src/slic3r/GUI/DeviceErrorDialog.hpp +++ b/src/slic3r/GUI/DeviceErrorDialog.hpp @@ -38,10 +38,11 @@ public: //LOAD_FILAMENT = 26*/ IGNORE_RESUME = 27, PROBLEM_SOLVED_RESUME = 28, - STOP_BUZZER = 29, + TURN_OFF_FIRE_ALARM = 29, RETRY_PROBLEM_SOLVED = 34, STOP_DRYING = 35, + REMOVE_CLOSE_BTN = 39, // special case, do not show close button ERROR_BUTTON_COUNT }; diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index e524044aff..9791a1e4c4 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -1072,17 +1072,31 @@ void PrintErrorDialog::update_title_style(wxString title, std::vector butto m_button_list[used_button_id]->Hide(); } } + m_sizer_button->Clear(); m_used_button = button_style; + bool need_remove_close_btn = false; for (int button_id : button_style) { if (m_button_list.find(button_id) != m_button_list.end()) { m_sizer_button->Add(m_button_list[button_id], 0, wxALL, FromDIP(5)); m_button_list[button_id]->Show(); } + + need_remove_close_btn |= (button_id == REMOVE_CLOSE_BTN); // special case, do not show close button } + + // Special case, do not show close button + if (need_remove_close_btn) + { + SetWindowStyle(GetWindowStyle() & ~wxCLOSE_BOX); + } + else + { + SetWindowStyle(GetWindowStyle() | wxCLOSE_BOX); + } + Layout(); Fit(); - } void PrintErrorDialog::init_button(PrintErrorButton style,wxString buton_text) @@ -1124,7 +1138,7 @@ void PrintErrorDialog::init_button_list() init_button(IGNORE_NO_REMINDER_NEXT_TIME, _L("Ignore. Don't Remind Next Time")); init_button(IGNORE_RESUME, _L("Ignore this and Resume")); init_button(PROBLEM_SOLVED_RESUME, _L("Problem Solved and Resume")); - init_button(STOP_BUZZER, _L("Stop Buzzer")); + init_button(TURN_OFF_FIRE_ALARM, _L("Got it, Turn off the Fire Alarm.")); init_button(RETRY_PROBLEM_SOLVED, _L("Retry (problem solved)")); init_button(STOP_DRYING, _L("Stop Drying")); } diff --git a/src/slic3r/GUI/ReleaseNote.hpp b/src/slic3r/GUI/ReleaseNote.hpp index d01814e25a..6bf4564cd1 100644 --- a/src/slic3r/GUI/ReleaseNote.hpp +++ b/src/slic3r/GUI/ReleaseNote.hpp @@ -185,10 +185,11 @@ public: //LOAD_FILAMENT = 26*/ IGNORE_RESUME = 27, PROBLEM_SOLVED_RESUME = 28, - STOP_BUZZER = 29, + TURN_OFF_FIRE_ALARM = 29, RETRY_PROBLEM_SOLVED = 34, STOP_DRYING = 35, + REMOVE_CLOSE_BTN = 39, // special case, do not show close button ERROR_BUTTON_COUNT }; diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index eb91ff678c..7706252744 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -4764,7 +4764,7 @@ void StatusPanel::on_print_error_dlg_btn_clicked(wxCommandEvent& event) obj->command_hms_resume(std::to_string(before_error_code), obj->job_id_); break; } - case Slic3r::GUI::PrintErrorDialog::STOP_BUZZER: { + case Slic3r::GUI::PrintErrorDialog::TURN_OFF_FIRE_ALARM: { obj->command_stop_buzzer(); break; }