From 4171b3320e7096cd4ec0b3526a8f89493f9baf6e Mon Sep 17 00:00:00 2001 From: "zorro.zhang" Date: Thu, 18 Jan 2024 17:45:33 +0800 Subject: [PATCH] FIX: UserGuide Can not Click When Computer User name has chinese JIRA: None Change-Id: If50baa8c6a13eb501918fd5cdaf0ea3da7c788ef (cherry picked from commit 4e5ccc9f2de5ac429af6541c6a8bd412848801d0) --- src/slic3r/GUI/WebGuideDialog.cpp | 48 ++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index a125e4110..4e985fc5f 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -354,9 +354,12 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt) { try { wxString strInput = evt.GetString(); + BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;OnRecv:" << strInput.c_str(); json j = json::parse(strInput); wxString strCmd = j["command"]; + BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;Command:" << strCmd; + if (strCmd == "close_page") { this->EndModal(wxID_CANCEL); } @@ -384,8 +387,10 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt) m_Res["sequence_id"] = "10001"; m_Res["response"] = m_ProfileJson; - wxString strJS = wxString::Format("HandleStudio(%s)", m_Res.dump(-1, ' ', false, json::error_handler_t::ignore)); + //wxString strJS = wxString::Format("HandleStudio(%s)", m_Res.dump(-1, ' ', false, json::error_handler_t::ignore)); + wxString strJS = wxString::Format("HandleStudio(%s)", m_Res.dump(-1, ' ', true)); + BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;request_userguide_profile:" << strJS.c_str(); wxGetApp().CallAfter([this,strJS] { RunScript(strJS); }); } else if (strCmd == "request_custom_filaments") { @@ -482,6 +487,7 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt) } } catch (std::exception &e) { // wxMessageBox(e.what(), "json Exception", MB_OK); + BOOST_LOG_TRIVIAL(trace) << "GuideFrame::OnScriptMessage;Error:" << e.what(); } wxString strAll = m_ProfileJson.dump(-1,' ',false, json::error_handler_t::ignore); @@ -968,20 +974,28 @@ bool GuideFrame::run() int GuideFrame::GetFilamentInfo( std::string VendorDirectory, json & pFilaList, std::string filepath, std::string &sVendor, std::string &sType) { //GetStardardFilePath(filepath); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " GetFilamentInfo:VendorDirectory - " << VendorDirectory << ", Filepath - "<