mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-21 06:58:02 +02:00
Restore safety files (.bak) sooner. The aim is to be back in a good state before we show the error dialog.
This commit is contained in:
parent
6bdfb13b45
commit
31c10bd86a
@ -3051,6 +3051,8 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
|
|||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
||||||
if( !wxDir::Exists( projPath ) ){
|
if( !wxDir::Exists( projPath ) ){
|
||||||
|
if (safetyFileName != wxT(""))
|
||||||
|
wxRename(safetyFileName, mFileName);
|
||||||
wxMessageBox(wxString::Format(
|
wxMessageBox(wxString::Format(
|
||||||
_("Could not save project. Path not found. Try creating \ndirectory \"%s\" before saving project with this name."),
|
_("Could not save project. Path not found. Try creating \ndirectory \"%s\" before saving project with this name."),
|
||||||
projPath.c_str()),
|
projPath.c_str()),
|
||||||
@ -3087,13 +3089,12 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
if (safetyFileName != wxT(""))
|
||||||
|
wxRename(safetyFileName, mFileName);
|
||||||
wxMessageBox(wxString::Format(_("Could not save project. Perhaps %s \nis not writable or the disk is full."),
|
wxMessageBox(wxString::Format(_("Could not save project. Perhaps %s \nis not writable or the disk is full."),
|
||||||
project.c_str()),
|
project.c_str()),
|
||||||
_("Error saving project"),
|
_("Error saving project"),
|
||||||
wxICON_ERROR, this);
|
wxICON_ERROR, this);
|
||||||
if (safetyFileName != wxT(""))
|
|
||||||
wxRename(safetyFileName, mFileName);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user