mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Fixed file wild cards when exporting a G-code or SLA output file.
This commit is contained in:
parent
1e325f8374
commit
f56bb7d085
1 changed files with 10 additions and 6 deletions
|
@ -43,7 +43,7 @@ namespace GUI {
|
||||||
|
|
||||||
wxString file_wildcards(FileType file_type, const std::string &custom_extension)
|
wxString file_wildcards(FileType file_type, const std::string &custom_extension)
|
||||||
{
|
{
|
||||||
static const wxString defaults[FT_SIZE] = {
|
static const std::string defaults[FT_SIZE] = {
|
||||||
/* FT_STL */ "STL files (*.stl)|*.stl;*.STL",
|
/* FT_STL */ "STL files (*.stl)|*.stl;*.STL",
|
||||||
/* FT_OBJ */ "OBJ files (*.obj)|*.obj;*.OBJ",
|
/* FT_OBJ */ "OBJ files (*.obj)|*.obj;*.OBJ",
|
||||||
/* FT_AMF */ "AMF files (*.amf)|*.zip.amf;*.amf;*.AMF;*.xml;*.XML",
|
/* FT_AMF */ "AMF files (*.amf)|*.zip.amf;*.amf;*.AMF;*.xml;*.XML",
|
||||||
|
@ -57,13 +57,17 @@ wxString file_wildcards(FileType file_type, const std::string &custom_extension)
|
||||||
/* FT_PNGZIP */"Zipped PNG files (*.zip)|*.zip;*.ZIP", // This is lame, but that's what we use for SLA
|
/* FT_PNGZIP */"Zipped PNG files (*.zip)|*.zip;*.ZIP", // This is lame, but that's what we use for SLA
|
||||||
};
|
};
|
||||||
|
|
||||||
wxString out = defaults[file_type];
|
std::string out = defaults[file_type];
|
||||||
if (! custom_extension.empty()) {
|
if (! custom_extension.empty()) {
|
||||||
// Append the custom extension to the wildcards, so that the file dialog would not add the default extension to it.
|
// Find the custom extension in the template.
|
||||||
out += ";*";
|
if (out.find(std::string("*") + custom_extension + ",") == std::string::npos && out.find(std::string("*") + custom_extension + ")") == std::string::npos) {
|
||||||
out += from_u8(custom_extension);
|
// The custom extension was not found in the template.
|
||||||
|
// Append the custom extension to the wildcards, so that the file dialog would not add the default extension to it.
|
||||||
|
boost::replace_first(out, ")|", std::string(", *") + custom_extension + ")|");
|
||||||
|
out += std::string(";*") + custom_extension;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return out;
|
return wxString::FromUTF8(out.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string libslic3r_translate_callback(const char *s) { return wxGetTranslation(wxString(s, wxConvUTF8)).utf8_str().data(); }
|
static std::string libslic3r_translate_callback(const char *s) { return wxGetTranslation(wxString(s, wxConvUTF8)).utf8_str().data(); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue