mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-17 09:07:41 +02:00
Fix bug 1513
The error message is still a bit strange if trying to overwrite a different project when the current project has been saved, (why would you do that?), but probably not worth complicating the message for such a fringe case.
This commit is contained in:
parent
2ec12d2ffd
commit
341e3e1207
@ -301,19 +301,24 @@ void TimerRecordDialog::OnAutoSavePathButton_Click(wxCommandEvent& WXUNUSED(even
|
|||||||
if (fName == wxT(""))
|
if (fName == wxT(""))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// MY: If project already exits then abort - we do not allow users to overwrite an existing project
|
AudacityProject* pProject = GetActiveProject();
|
||||||
if (wxFileExists(fName)) {
|
|
||||||
|
// If project already exits then abort - we do not allow users to overwrite an existing project
|
||||||
|
// unless it is the current project.
|
||||||
|
if (wxFileExists(fName) && (pProject->GetFileName() != fName)) {
|
||||||
wxMessageDialog m(
|
wxMessageDialog m(
|
||||||
NULL,
|
NULL,
|
||||||
_("The selected file name could not be used\nfor Timer Recording because it would overwrite another project.\nPlease try again and select an original name."),
|
_("The selected file name could not be used\nfor Timer Recording because it \
|
||||||
|
would overwrite another project.\nPlease try again and select an original name."),
|
||||||
_("Error Saving Timer Recording Project"),
|
_("Error Saving Timer Recording Project"),
|
||||||
wxOK|wxICON_ERROR);
|
wxOK|wxICON_ERROR);
|
||||||
m.ShowModal();
|
m.ShowModal();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// MY: Set this boolean to false so we now do a SaveAs at the end of the recording
|
// Set this boolean to false so we now do a SaveAs at the end of the recording
|
||||||
m_bProjectAlreadySaved = false;
|
// unless we're saving the current project.
|
||||||
|
m_bProjectAlreadySaved = pProject->GetFileName() == fName? true : false;
|
||||||
|
|
||||||
m_fnAutoSaveFile = fName;
|
m_fnAutoSaveFile = fName;
|
||||||
m_fnAutoSaveFile.SetExt(wxT("aup"));
|
m_fnAutoSaveFile.SetExt(wxT("aup"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user