fix some bug

This commit is contained in:
QIDI TECH
2025-05-09 20:39:27 +08:00
parent 9b0892b7c2
commit 958f8339bc
6 changed files with 43 additions and 13 deletions

View File

@@ -3368,9 +3368,7 @@ std::map<int, DynamicPrintConfig> Sidebar::build_filament_box_list(std::vector<s
tray_config.set_key_value("filament_exist", new ConfigOptionBools{ true }); //default
tray_config.set_key_value("filament_multi_colors", new ConfigOptionStrings{});
for (int j = 0; j < 4; ++j) {
tray_config.opt<ConfigOptionStrings>("filament_multi_colors")->values.push_back(into_u8(wxColour(color[j]).GetAsString(wxC2S_HTML_SYNTAX)));
}
tray_config.opt<ConfigOptionStrings>("filament_multi_colors")->values.push_back(into_u8(wxColour(color[i]).GetAsString(wxC2S_HTML_SYNTAX)));
filament_ams_list.emplace('A' + i, std::move(tray_config));
}
@@ -3388,9 +3386,7 @@ std::map<int, DynamicPrintConfig> Sidebar::build_filament_box_list(std::vector<s
tray_config.set_key_value("filament_exist", new ConfigOptionBools{ true }); //default
tray_config.set_key_value("filament_multi_colors", new ConfigOptionStrings{});
for (int j = 0; j < 4; ++j) {
tray_config.opt<ConfigOptionStrings>("filament_multi_colors")->values.push_back(into_u8(wxColour(color[j]).GetAsString(wxC2S_HTML_SYNTAX)));
}
tray_config.opt<ConfigOptionStrings>("filament_multi_colors")->values.push_back(into_u8(wxColour(color.back()).GetAsString(wxC2S_HTML_SYNTAX)));
filament_ams_list.emplace('A' + count + 1, std::move(tray_config));
}

View File

@@ -4441,8 +4441,18 @@ void SelectMachineDialog::set_default()
show_error(this, ex.what(), false);
}
}
else
filename = m_plater->get_output_filename();
else{
try{
filename = m_plater->get_output_filename();
}
catch (const Slic3r::PlaceholderParserError& ex) {
// Show the error with monospaced font.
show_error(this, ex.what(), true);
}
catch (const std::exception &ex) {
show_error(this, ex.what(), false);
}
}
if (m_print_plate_idx == PLATE_ALL_IDX && filename.empty()) {
filename = _L("Untitled");

View File

@@ -1629,8 +1629,18 @@ void SendMultiMachinePage::set_default()
show_error(this, ex.what(), false);
}
}
else
filename = m_plater->get_output_filename();
else{
try{
filename = m_plater->get_output_filename();
}
catch (const Slic3r::PlaceholderParserError& ex) {
// Show the error with monospaced font.
show_error(this, ex.what(), true);
}
catch (const std::exception &ex) {
show_error(this, ex.what(), false);
}
}
if (filename.empty()) {
filename = m_plater->get_export_gcode_filename("", true);

View File

@@ -1912,8 +1912,18 @@ void SendToPrinterDialog::set_default()
show_error(this, ex.what(), false);
}
}
else
filename = m_plater->get_output_filename();
else{
try{
filename = m_plater->get_output_filename();
}
catch (const Slic3r::PlaceholderParserError& ex) {
// Show the error with monospaced font.
show_error(this, ex.what(), true);
}
catch (const std::exception &ex) {
show_error(this, ex.what(), false);
}
}
if (m_print_plate_idx == PLATE_ALL_IDX && filename.empty()) {
filename = _L("Untitled");