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:
@@ -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,
|
||||||
|
|||||||
@@ -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 );
|
||||||
|
|||||||
Reference in New Issue
Block a user