Bug 1622 - Cryptic error message when existing project cannot be saved

This commit is contained in:
James Crook 2019-09-01 15:28:00 +01:00
parent 9a3bd94459
commit 72f36f8a82
1 changed files with 4 additions and 3 deletions

View File

@ -352,14 +352,15 @@ bool ProjectFileManager::DoSave (const bool fromSaveAs,
safetyFileName = fileName + wxT(".bak");
#endif
bool bOK=true;
if (wxFileExists(safetyFileName))
wxRemoveFile(safetyFileName);
bOK = wxRemoveFile(safetyFileName);
if ( !wxRenameFile(fileName, safetyFileName) ) {
AudacityMessageBox(
wxString::Format(
_("Could not create safety file: %s"), safetyFileName ),
_("Error"), wxICON_STOP, &window);
_("Audacity failed to write file %s.\nPerhaps disk is full or not writable."), safetyFileName ),
_("Error Writing to File"), wxICON_STOP, &window);
return false;
}
}