From 45d9e6bddd52164aaa12c503e5323de307ad8215 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Fri, 3 Dec 2021 09:05:14 +0100 Subject: [PATCH] Follow-up to 7828964f8ca1c5ca029ef1ec5544769696e4eb2a 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. --- src/slic3r/GUI/Plater.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c2dfcb24c..c368161f2 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -138,11 +138,10 @@ bool Plater::has_illegal_filename_characters(const std::string& name) 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:") + " <>:/\\|?*\""); } - // Sidebar widgets // struct InfoBox : public wxStaticBox @@ -5656,10 +5655,15 @@ void Plater::export_gcode(bool prefer_removable) if (dlg.ShowModal() == wxID_OK) { output_path = into_path(dlg.GetPath()); 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())); if (dlg.ShowModal() == wxID_OK) output_path = into_path(dlg.GetPath()); + else { + output_path.clear(); + break; + } } } }