FIX: fix wrong layout in error code dialog in mac

JIRA: STUDIO-8677

Change-Id: I16e267495c753d8015e7dda47147b630e9e92c8a
(cherry picked from commit ebf05c718e64657665445e6eeff03f3f9c8cfae6)
This commit is contained in:
Kunlong Ma
2024-11-12 09:48:23 +08:00
committed by Noisyfox
parent a8f70a72c9
commit 504ae4a393
2 changed files with 12 additions and 7 deletions

View File

@@ -1027,7 +1027,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)));
}
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 {
m_vebview_release_note->SetMinSize(wxSize(FromDIP(320), FromDIP(340)));

View File

@@ -2745,14 +2745,17 @@ void StatusPanel::show_error_message(MachineObject *obj, bool is_exist, wxString
if (m_print_error_dlg) { m_print_error_dlg->Hide();}
if (m_print_error_dlg_no_action) { m_print_error_dlg_no_action->Hide(); }
} else {
if (msg.IsEmpty()) { msg = _L("Unknow error."); }
m_project_task_panel->show_error_msg(msg);
if (!used_button.empty()) {
BOOST_LOG_TRIVIAL(info) << "show print error! error_msg = " << msg;
if (m_print_error_dlg == nullptr) {
m_print_error_dlg = new PrintErrorDialog(this->GetParent(), wxID_ANY, _L("Error"));
if (m_print_error_dlg != nullptr) {
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_text_image(msg, print_error_str, image_url);
m_print_error_dlg->Bind(wxEVT_CLOSE_WINDOW, [this, dev_id](wxCloseEvent& e)
@@ -2775,10 +2778,12 @@ void StatusPanel::show_error_message(MachineObject *obj, bool is_exist, wxString
wxString show_time = now.Format("%H%M%d");
wxString error_code_msg = wxString::Format("%S\n[%S %S]", msg, print_error_str, show_time);
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);
if (m_print_error_dlg_no_action != nullptr) {
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()) {
m_print_error_dlg_no_action->update_title_style(_L("Warning"), SecondaryCheckDialog::ButtonStyle::DONE_AND_RETRY, this);
}
@@ -2835,7 +2840,7 @@ void StatusPanel::update_error_message()
char buf[32];
::sprintf(buf, "%08X", obj->print_error);
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 = wxGetApp().get_hms_query()->query_print_error_msg(obj, obj->print_error);
if (wxGetApp().get_hms_query()->is_internal_error(obj, obj->print_error))
@@ -2846,7 +2851,7 @@ void StatusPanel::update_error_message()
std::vector<int> used_button;
wxString error_image_url = wxGetApp().get_hms_query()->query_print_image_action(obj, obj->print_error, used_button);
// 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);
}
show_error_message(obj, !error_msg.empty(), error_msg, print_error_str, error_image_url, used_button);