Fixed no way of leaving the "export G-code" dialog loop.
Improved the error message by explaining that some characters
are not allowed by a FAT file system.
This commit is contained in:
Vojtech Bubnik 2021-12-03 09:05:14 +01:00
parent 4d1ce89c22
commit 45d9e6bddd

View File

@ -138,11 +138,10 @@ bool Plater::has_illegal_filename_characters(const std::string& name)
void Plater::show_illegal_characters_warning(wxWindow* parent) void Plater::show_illegal_characters_warning(wxWindow* parent)
{ {
show_error(parent, _L("The supplied name is not valid;") + "\n" + show_error(parent, _L("The provided name is not valid;") + "\n" +
_L("the following characters are not allowed:") + " <>:/\\|?*\""); _L("the following characters are not allowed:") + " <>:/\\|?*\"");
} }
// Sidebar widgets // Sidebar widgets
// struct InfoBox : public wxStaticBox // struct InfoBox : public wxStaticBox
@ -5656,10 +5655,15 @@ void Plater::export_gcode(bool prefer_removable)
if (dlg.ShowModal() == wxID_OK) { if (dlg.ShowModal() == wxID_OK) {
output_path = into_path(dlg.GetPath()); output_path = into_path(dlg.GetPath());
while (has_illegal_filename_characters(output_path.filename().string())) { while (has_illegal_filename_characters(output_path.filename().string())) {
show_illegal_characters_warning(this); show_error(this, _L("The provided file name is not valid.") + "\n" +
_L("The following characters are not allowed by a FAT file system:") + " <>:/\\|?*\"");
dlg.SetFilename(from_path(output_path.filename())); dlg.SetFilename(from_path(output_path.filename()));
if (dlg.ShowModal() == wxID_OK) if (dlg.ShowModal() == wxID_OK)
output_path = into_path(dlg.GetPath()); output_path = into_path(dlg.GetPath());
else {
output_path.clear();
break;
}
} }
} }
} }