mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
FIX: unable to load WipeTowerDialog if path has space
1.Also fix a translation problem jira:STUDIO-11926,STUDIO-11411 Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: Ifd709582cb1a0e47631abf90ac6fdbcebcd642a3 (cherry picked from commit 8c78dd2256400f2aebaeb234bcef12bb9d384659)
This commit is contained in:
@@ -273,7 +273,7 @@ wxString WipingDialog::BuildTextObjStr(bool multi_language)
|
|||||||
cancel_btn_label = _L("Cancel");
|
cancel_btn_label = _L("Cancel");
|
||||||
} else {
|
} else {
|
||||||
auto_flush_tip = "Studio would re-calculate your flushing volumes everytime the filaments color changed or filaments changed. You could disable the auto-calculate in Bambu Studio > Preferences";
|
auto_flush_tip = "Studio would re-calculate your flushing volumes everytime the filaments color changed or filaments changed. You could disable the auto-calculate in Bambu Studio > Preferences";
|
||||||
volume_desp_panel = "Flushing volume (mm³) for each filament pair.";
|
volume_desp_panel = wxString::FromUTF8("Flushing volume (mm³) for each filament pair.");
|
||||||
volume_range_panel = wxString::Format("Suggestion: Flushing Volume in range [%d, %d]", 0, 700);
|
volume_range_panel = wxString::Format("Suggestion: Flushing Volume in range [%d, %d]", 0, 700);
|
||||||
multiplier_range_panel = wxString::Format("The multiplier should be in range [%.2f, %.2f].", 0, 3);
|
multiplier_range_panel = wxString::Format("The multiplier should be in range [%.2f, %.2f].", 0, 3);
|
||||||
calc_btn_panel = "Re-calculate";
|
calc_btn_panel = "Re-calculate";
|
||||||
@@ -344,10 +344,12 @@ WipingDialog::WipingDialog(wxWindow* parent, const std::vector<std::vector<int>>
|
|||||||
wxString filepath_str = wxString::FromUTF8(filepath.string());
|
wxString filepath_str = wxString::FromUTF8(filepath.string());
|
||||||
wxFileName fn(filepath_str);
|
wxFileName fn(filepath_str);
|
||||||
if(fn.FileExists()) {
|
if(fn.FileExists()) {
|
||||||
wxString url = "file:///" + fn.GetFullPath();
|
wxString url = wxFileSystem::FileNameToURL(fn);
|
||||||
|
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__<< "File exists and load url " << url.ToStdString();
|
||||||
m_webview->LoadURL(url);
|
m_webview->LoadURL(url);
|
||||||
|
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__<< "Successfully loaded url: " << url.ToStdString();
|
||||||
} else {
|
} else {
|
||||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< "WipingDialog.html not exist";
|
BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< "WipingDialog.html not exist at path: " << filepath.string();
|
||||||
}
|
}
|
||||||
|
|
||||||
main_sizer->SetSizeHints(this);
|
main_sizer->SetSizeHints(this);
|
||||||
@@ -366,6 +368,7 @@ WipingDialog::WipingDialog(wxWindow* parent, const std::vector<std::vector<int>>
|
|||||||
|
|
||||||
m_webview->Bind(wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED, [this](wxWebViewEvent& evt) {
|
m_webview->Bind(wxEVT_WEBVIEW_SCRIPT_MESSAGE_RECEIVED, [this](wxWebViewEvent& evt) {
|
||||||
std::string message = evt.GetString().ToStdString();
|
std::string message = evt.GetString().ToStdString();
|
||||||
|
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__<< "Received message: " << message;
|
||||||
try {
|
try {
|
||||||
json j = json::parse(message);
|
json j = json::parse(message);
|
||||||
if (j["msg"].get<std::string>() == "init") {
|
if (j["msg"].get<std::string>() == "init") {
|
||||||
@@ -412,7 +415,7 @@ WipingDialog::WipingDialog(wxWindow* parent, const std::vector<std::vector<int>>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
|
BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< "Failed to parse json message: " << message;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user