Bug 2609 - Save Project when disk is full gives a second disk-full message

This commit is contained in:
Leland Lucius 2021-01-03 19:22:22 -06:00
parent 84c60beab6
commit 56c8bdcd24
2 changed files with 10 additions and 3 deletions

View File

@ -2060,6 +2060,8 @@ bool ProjectFileIO::SaveProject(
reopened = true;
else {
MoveProject(fileName, savedName);
moved = false; // No longer moved
reopened = OpenConnection(savedName);
}
}
@ -2069,7 +2071,12 @@ bool ProjectFileIO::SaveProject(
reopened = OpenConnection(savedName);
}
if (!reopened)
// Warning issued in MoveProject()
if (reopened && !moved) {
return false;
}
if (!reopened) {
wxTheApp->CallAfter([this]{
ShowErrorDialog(nullptr,
XO("Warning"),
@ -2082,8 +2089,8 @@ bool ProjectFileIO::SaveProject(
mProject.ProcessEvent(evt);
});
if (!moved)
return false;
}
}
}

View File

@ -317,7 +317,7 @@ bool ProjectFileManager::DoSave(const FilePath & fileName, const bool fromSaveAs
if (!success)
{
// Show this error only if we didn't fail reconnection in SaveProject
if (projectFileIO.HasConnection())
if (!projectFileIO.HasConnection())
ShowErrorDialog(
&window,
XO("Error Saving Project"),