mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-25 15:53:52 +02:00
Bug119: Export Multiple /, *, ? handled incorrectly
This commit is contained in:
@@ -118,11 +118,6 @@ ExportMultiple::ExportMultiple(AudacityProject *project)
|
||||
|
||||
mBook = NULL;
|
||||
|
||||
// create array of characters not allowed in file names
|
||||
wxString forbid = wxFileName::GetForbiddenChars();
|
||||
for(unsigned int i=0; i < forbid.Length(); i++)
|
||||
exclude.Add( forbid.Mid(i, 1) );
|
||||
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
|
||||
// Creating some of the widgets cause cause events to fire
|
||||
@@ -973,22 +968,23 @@ int ExportMultiple::DoExport(int channels,
|
||||
|
||||
wxString ExportMultiple::MakeFileName(const wxString &input)
|
||||
{
|
||||
wxString newname; // name we are generating
|
||||
wxString newname = input; // name we are generating
|
||||
|
||||
// strip out anything that isn't allowed in file names on this platform
|
||||
newname = Internat::SanitiseFilename(input, wxT("_"));
|
||||
auto changed = Internat::SanitiseFilename(newname, wxT("_"));
|
||||
|
||||
if(!newname.IsSameAs(input))
|
||||
if(changed)
|
||||
{ // need to get user to fix file name
|
||||
// build the dialog
|
||||
wxString msg;
|
||||
msg.Printf(_("Label or track \"%s\" is not a legal file name. You cannot use any of: %s\nUse..."), input.c_str(), wxFileName::GetForbiddenChars().c_str());
|
||||
msg.Printf(_("Label or track \"%s\" is not a legal file name. You cannot use any of: %s\nUse..."), input.c_str(),
|
||||
::wxJoin(Internat::GetExcludedCharacters(), wxChar(' ')));
|
||||
wxTextEntryDialog dlg( this, msg, _("Save As..."), newname );
|
||||
|
||||
// And tell the validator about excluded chars
|
||||
dlg.SetTextValidator( wxFILTER_EXCLUDE_CHAR_LIST );
|
||||
wxTextValidator *tv = dlg.GetTextValidator();
|
||||
tv->SetExcludes(exclude);
|
||||
tv->SetExcludes(Internat::GetExcludedCharacters());
|
||||
|
||||
// Show the dialog and bail if the user cancels
|
||||
if( dlg.ShowModal() == wxID_CANCEL )
|
||||
|
||||
@@ -125,9 +125,6 @@ private:
|
||||
// List of file actually exported
|
||||
wxArrayString mExported;
|
||||
|
||||
/** Array of characters not allowed to be in file names on this platform */
|
||||
wxArrayString exclude;
|
||||
|
||||
wxChoice *mFormat; /**< Drop-down list of export formats
|
||||
(combinations of plug-in and subformat) */
|
||||
wxButton *mOptions;
|
||||
|
||||
Reference in New Issue
Block a user