ENH:fixed incorrect path prefix

jira:[for file path prefix]

Change-Id: Ie9e3999f02b78272e528ceceb479e746d46a7e6c
This commit is contained in:
tao wang 2023-11-16 10:58:44 +08:00 committed by Lane.Wei
parent 16cee32990
commit 6e97750dcd
2 changed files with 9 additions and 3 deletions

View File

@ -526,7 +526,13 @@ void MediaFilePanel::doAction(size_t index, int action)
auto &file = fs->GetFile(index);
int gcode_file_count = Slic3r::GUI::wxGetApp().plater()->update_print_required_data(config, model, plate_data_list, from_u8(file.name).ToStdString(), file.path);
std::string file_path = file.path;
if (!file_path.empty() && file_path[0] == '/') {
file_path.erase(0, 1);
}
int gcode_file_count = Slic3r::GUI::wxGetApp().plater()->update_print_required_data(config, model, plate_data_list, file.name, file_path);
if (gcode_file_count > 0) {
wxPostEvent(Slic3r::GUI::wxGetApp().plater(), SimpleEvent(EVT_PRINT_FROM_SDCARD_VIEW));

View File

@ -2768,11 +2768,11 @@ void SelectMachineDialog::on_send_print()
if (input_str_arr.size() <= 1) {
input_str_arr = wxGetApp().split_str(m_required_data_file_name, ".3mf");
if (input_str_arr.size() > 1) {
m_print_job->set_project_name(wxString(input_str_arr[0]).utf8_string());
m_print_job->set_project_name(input_str_arr[0]);
}
}
else {
m_print_job->set_project_name(wxString(input_str_arr[0]).utf8_string());
m_print_job->set_project_name(input_str_arr[0]);
}
}