Sstrip special characters from set name before showing save file dialog

This commit is contained in:
Twan van Laarhoven
2020-04-21 01:13:11 +02:00
parent 3f8f9bef1a
commit 39f504ad90
+2 -2
View File
@@ -452,7 +452,7 @@ bool SetWindow::askSaveAndContinue() {
try {
if (set->needSaveAs()) {
// need save as
wxFileDialog dlg(this, _TITLE_("save set"), settings.default_set_dir, set->short_name, export_formats(*set->game), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
wxFileDialog dlg(this, _TITLE_("save set"), settings.default_set_dir, clean_filename(set->short_name), export_formats(*set->game), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (dlg.ShowModal() == wxID_OK) {
settings.default_set_dir = dlg.GetDirectory();
export_set(*set, dlg.GetPath(), dlg.GetFilterIndex());
@@ -587,7 +587,7 @@ void SetWindow::onFileSave(wxCommandEvent& ev) {
}
void SetWindow::onFileSaveAs(wxCommandEvent&) {
wxFileDialog dlg(this, _TITLE_("save set"), settings.default_set_dir, set->short_name, export_formats(*set->game), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
wxFileDialog dlg(this, _TITLE_("save set"), settings.default_set_dir, clean_filename(set->short_name), export_formats(*set->game), wxFD_SAVE | wxFD_OVERWRITE_PROMPT);
if (dlg.ShowModal() == wxID_OK) {
settings.default_set_dir = dlg.GetDirectory();
export_set(*set, dlg.GetPath(), dlg.GetFilterIndex());