Fix of output file dialog extension template for OSX:

When opening a "Save" file dialog with a default output file name,
OSX file dialog strips the provided extension and replaces it
with the default extension. This causes issues with a custom
file output template, where a non-default file extension is specified.

This commit changes the function to generate file dialog templates
so that if a default extension is provided, it is emitted
as first into the extension template.

Fixes Post Processing passes wrong name #7190
This commit is contained in:
Vojtech Bubnik 2021-11-29 15:46:25 +01:00
parent 3f0bdb5816
commit e7cc12b2c9
3 changed files with 79 additions and 31 deletions

View file

@ -5721,7 +5721,7 @@ void Plater::export_gcode(bool prefer_removable)
wxFileDialog dlg(this, (printer_technology() == ptFFF) ? _L("Save G-code file as:") : _L("Save SL1 / SL1S file as:"),
start_dir,
from_path(default_output_file.filename()),
GUI::file_wildcards((printer_technology() == ptFFF) ? FT_GCODE : boost::iequals(ext, ".sl1s") ? FT_SL1S : FT_SL1, ext),
GUI::file_wildcards((printer_technology() == ptFFF) ? FT_GCODE : FT_SL1, ext),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT
);
if (dlg.ShowModal() == wxID_OK) {