From a113f227f541288e3be394f6c0b4a54d463dc220 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 26 Jul 2021 11:34:35 +0200 Subject: [PATCH] Use default last directory when we try to save a project with objects from Gallery --- src/slic3r/GUI/Plater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index ee32b5ad8..b318c1cde 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2653,8 +2653,11 @@ wxString Plater::priv::get_export_file(GUI::FileType file_type) default: break; } + std::string dir = (boost::filesystem::path(output_file).parent_path()).string(); + bool use_def_out_dir = dir == sys_shapes_dir() || dir == custom_shapes_dir(); + wxFileDialog dlg(q, dlg_title, - from_path(output_file.parent_path()), from_path(output_file.filename()), + use_def_out_dir ? from_u8(wxGetApp().app_config->get_last_dir()) : from_path(output_file.parent_path()), from_path(output_file.filename()), wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (dlg.ShowModal() != wxID_OK)