FIX: Clicking to continue printing does not take effect in error code

JIRA: STUDIO-6830
Detected an incomplete printing task error pop-up when power outage occurred. Clicking to continue printing did not take effect

Change-Id: Ie85a1602093dabac861cd1f41ea21e1c312c83e9
This commit is contained in:
Kunlong Ma 2024-04-19 17:03:54 +08:00 committed by Lane.Wei
parent 2ab668db50
commit 60077e83e6
2 changed files with 20 additions and 32 deletions

View File

@ -964,7 +964,6 @@ void PrintErrorDialog::update_text_image(wxString text, wxString image_url)
m_staticText_release_note->SetMaxSize(wxSize(FromDIP(300), -1));
m_staticText_release_note->SetMinSize(wxSize(FromDIP(300), -1));
m_staticText_release_note->SetLabelText(text);
//m_staticText_release_note->SetForegroundColour(wxColour("#5C5C5C"));
m_vebview_release_note->Layout();
auto text_size = m_staticText_release_note->GetBestSize();
@ -1049,28 +1048,21 @@ void PrintErrorDialog::init_button_list() {
init_button(RESUME_PRINTING, _L("Resume Printing"));
m_button_list[RESUME_PRINTING]->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_RETRY, GetId());
e.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt);
this->on_hide();
post_event(wxCommandEvent(EVT_SECONDARY_CHECK_RESUME));
e.Skip();
});
init_button(RESUME_PRINTING_DEFECTS, _L("Resume Printing(defects acceptable)"));
m_button_list[RESUME_PRINTING_DEFECTS]->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
wxCommandEvent evt(EVT_SECONDARY_CHECK_RETRY, GetId());
e.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt);
this->on_hide();
post_event(wxCommandEvent(EVT_SECONDARY_CHECK_RESUME));
e.Skip();
});
init_button(RESUME_PRINTING_PROBELM_SOLVED, _L("Resume Printing(problem solved)"));
m_button_list[RESUME_PRINTING_PROBELM_SOLVED]->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) {
//load filament and resume printing
wxCommandEvent evt(EVT_SECONDARY_CHECK_RETRY, GetId());
e.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt);
this->on_hide();
post_event(wxCommandEvent(EVT_SECONDARY_CHECK_RESUME));
e.Skip();
});
init_button(STOP_PRINTING, _L("Stop Printing"));

View File

@ -2187,12 +2187,8 @@ void StatusPanel::update_error_message()
used_button.emplace_back(PrintErrorDialog::PrintErrorButton::JUMP_TO_LIVEVIEW);
if (!error_msg.IsEmpty()) {
wxDateTime now = wxDateTime::Now();
wxString show_time;
#if !BBL_RELEASE_TO_PUBLIC
show_time = now.Format("%Y-%m-%d %H:%M:%S");
#else
show_time = now.Format("%H:%M:%S");
#endif
wxString show_time = wxString::Format("%d%02d%02d", now.GetDay(), now.GetHour(), now.GetMinute());
error_msg = wxString::Format("%s\n[%s %s]",
error_msg,
print_error_str, show_time);