1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-29 16:53:51 +01:00

Bug 2669 - Win: Save As can be used to overwrite the existing project without warning

This commit is contained in:
Leland Lucius
2021-02-18 19:35:11 -06:00
parent db34fabb18
commit 8fce1db1ae
2 changed files with 4 additions and 4 deletions

View File

@@ -220,7 +220,7 @@ bool ProjectFileManager::Save()
// Prompt for file name? // Prompt for file name?
if (projectFileIO.IsTemporary()) if (projectFileIO.IsTemporary())
{ {
return SaveAs(); return SaveAs(true);
} }
return DoSave(projectFileIO.GetFileName(), false); return DoSave(projectFileIO.GetFileName(), false);
@@ -409,7 +409,7 @@ bool ProjectFileManager::SaveAs(const FilePath &newFileName, bool addToHistory /
return(success); return(success);
} }
bool ProjectFileManager::SaveAs() bool ProjectFileManager::SaveAs(bool allowOverwrite /* = false */)
{ {
auto &project = mProject; auto &project = mProject;
auto &projectFileIO = ProjectFileIO::Get( project ); auto &projectFileIO = ProjectFileIO::Get( project );
@@ -466,7 +466,7 @@ For an audio file that will open in other apps, use 'Export'.\n");
filename.SetExt(wxT("aup3")); filename.SetExt(wxT("aup3"));
if (!bPrompt && filename.FileExists()) { if ((!bPrompt || !allowOverwrite) && filename.FileExists()) {
// Saving a copy of the project should never overwrite an existing project. // Saving a copy of the project should never overwrite an existing project.
AudacityMessageDialog m( AudacityMessageDialog m(
nullptr, nullptr,

View File

@@ -59,7 +59,7 @@ public:
void CompactProjectOnClose(); void CompactProjectOnClose();
bool Save(); bool Save();
bool SaveAs(); bool SaveAs(bool allowOverwrite = false);
bool SaveAs(const FilePath &newFileName, bool addToHistory = true); bool SaveAs(const FilePath &newFileName, bool addToHistory = true);
// strProjectPathName is full path for aup except extension // strProjectPathName is full path for aup except extension
bool SaveFromTimerRecording( wxFileName fnFile ); bool SaveFromTimerRecording( wxFileName fnFile );