FIX: [STUDIO-4387] fix extension of save project name

Change-Id: Ie287abc4c65fab134b9bf1ff24baf0dd36b728df
Jira: STUDIO-4387
This commit is contained in:
chunmao.guo 2023-09-12 15:59:16 +08:00 committed by Lane.Wei
parent aa1cbe0388
commit 73065641c0
1 changed files with 14 additions and 0 deletions

View File

@ -4191,6 +4191,20 @@ wxString Plater::priv::get_export_file(GUI::FileType file_type)
wxString out_path = dlg.GetPath();
fs::path path(into_path(out_path));
#ifdef __WXMSW__
if (path.extension() != output_file.extension()) {
out_path += output_file.extension().string();
boost::system::error_code ec;
if (boost::filesystem::exists(into_u8(out_path), ec)) {
auto result = MessageBox(q->GetHandle(),
wxString::Format(_L("The file %s already exists\nDo you want to replace it?"), out_path),
_L("Comfirm Save As"),
MB_YESNO | MB_ICONWARNING);
if (result != IDYES)
return wxEmptyString;
}
}
#endif
wxGetApp().app_config->update_last_output_dir(path.parent_path().string());
return out_path;