FIX: fix wrong layout in error code dialog in mac

JIRA: STUDIO-8677

Change-Id: I16e267495c753d8015e7dda47147b630e9e92c8a
This commit is contained in:
Kunlong Ma 2024-11-12 09:48:23 +08:00 committed by Lane.Wei
parent d00505eff7
commit ebf05c718e
2 changed files with 12 additions and 7 deletions

View File

@ -991,7 +991,7 @@ void PrintErrorDialog::update_text_image(const wxString& text, const wxString& e
m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), text_size.y + FromDIP(220))); m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), text_size.y + FromDIP(220)));
} }
else { else {
m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), text_size.y + FromDIP(25))); m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), text_size.y + FromDIP(50)));
} }
else { else {
m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), FromDIP(340))); m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), FromDIP(340)));

View File

@ -2154,14 +2154,17 @@ void StatusPanel::show_error_message(MachineObject *obj, bool is_exist, wxString
if (is_exist && msg.IsEmpty()) { if (is_exist && msg.IsEmpty()) {
error_info_reset(); error_info_reset();
} else { } else {
if (msg.IsEmpty()) { msg = _L("Unknow error."); }
m_project_task_panel->show_error_msg(msg); m_project_task_panel->show_error_msg(msg);
if (!used_button.empty()) { if (!used_button.empty()) {
BOOST_LOG_TRIVIAL(info) << "show print error! error_msg = " << msg; BOOST_LOG_TRIVIAL(info) << "show print error! error_msg = " << msg;
if (m_print_error_dlg == nullptr) { if (m_print_error_dlg != nullptr) {
m_print_error_dlg = new PrintErrorDialog(this->GetParent(), wxID_ANY, _L("Error")); delete m_print_error_dlg;
m_print_error_dlg = nullptr;
} }
m_print_error_dlg = new PrintErrorDialog(this->GetParent(), wxID_ANY, _L("Error"));
m_print_error_dlg->update_title_style(_L("Error"), used_button, this); m_print_error_dlg->update_title_style(_L("Error"), used_button, this);
m_print_error_dlg->update_text_image(msg, print_error_str, image_url); m_print_error_dlg->update_text_image(msg, print_error_str, image_url);
m_print_error_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, obj](wxCommandEvent& e) { m_print_error_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, obj](wxCommandEvent& e) {
@ -2190,10 +2193,12 @@ void StatusPanel::show_error_message(MachineObject *obj, bool is_exist, wxString
wxString show_time = now.Format("%H%M%d"); wxString show_time = now.Format("%H%M%d");
wxString error_code_msg = wxString::Format("%S\n[%S %S]", msg, print_error_str, show_time); wxString error_code_msg = wxString::Format("%S\n[%S %S]", msg, print_error_str, show_time);
if (m_print_error_dlg_no_action == nullptr) { if (m_print_error_dlg_no_action != nullptr) {
m_print_error_dlg_no_action = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM); delete m_print_error_dlg_no_action;
m_print_error_dlg_no_action = nullptr;
} }
m_print_error_dlg_no_action = new SecondaryCheckDialog(this->GetParent(), wxID_ANY, _L("Warning"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM);
if (it_done != message_containing_done.end() && it_retry != message_containing_retry.end()) { if (it_done != message_containing_done.end() && it_retry != message_containing_retry.end()) {
m_print_error_dlg_no_action->update_title_style(_L("Warning"), SecondaryCheckDialog::ButtonStyle::DONE_AND_RETRY, this); m_print_error_dlg_no_action->update_title_style(_L("Warning"), SecondaryCheckDialog::ButtonStyle::DONE_AND_RETRY, this);
} }
@ -2241,14 +2246,14 @@ void StatusPanel::update_error_message()
char buf[32]; char buf[32];
::sprintf(buf, "%08X", obj->print_error); ::sprintf(buf, "%08X", obj->print_error);
std::string print_error_str = std::string(buf); std::string print_error_str = std::string(buf);
if (print_error_str.size() > 4) { print_error_str.insert(4, " "); } if (print_error_str.size() > 4) { print_error_str.insert(4, "-"); }
wxString error_msg; wxString error_msg;
bool is_errocode_exist = wxGetApp().get_hms_query()->query_print_error_msg(obj->print_error, error_msg); bool is_errocode_exist = wxGetApp().get_hms_query()->query_print_error_msg(obj->print_error, error_msg);
std::vector<int> used_button; std::vector<int> used_button;
wxString error_image_url = wxGetApp().get_hms_query()->query_print_error_url_action(obj->print_error, obj->dev_id, used_button); wxString error_image_url = wxGetApp().get_hms_query()->query_print_error_url_action(obj->print_error, obj->dev_id, used_button);
// special case // special case
if (print_error_str == "0300 8003" || print_error_str == "0300 8002" || print_error_str == "0300 800A") { if (print_error_str == "0300-8003" || print_error_str == "0300-8002" || print_error_str == "0300-800A") {
used_button.emplace_back(PrintErrorDialog::PrintErrorButton::JUMP_TO_LIVEVIEW); used_button.emplace_back(PrintErrorDialog::PrintErrorButton::JUMP_TO_LIVEVIEW);
} }
show_error_message(obj, is_errocode_exist, error_msg, print_error_str, error_image_url, used_button); show_error_message(obj, is_errocode_exist, error_msg, print_error_str, error_image_url, used_button);