1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

(bug 20, P2) Log some summary messages as well, for auto-recovery mode, so the log indicates the "safe" choice that was taken for each of the four types of errors.

This commit is contained in:
v.audacity 2010-09-18 00:32:59 +00:00
parent a26652acfd
commit 7e1db64bc2
2 changed files with 26 additions and 11 deletions

View File

@ -1474,6 +1474,8 @@ _("Project check detected %d missing external audio \
} }
iter++; iter++;
} }
if ((action == 2) && bAutoRecoverMode)
wxLogWarning(_(" Project check replaced missing aliased file(s) with silence."));
} }
} }
@ -1524,6 +1526,8 @@ _("Project check detected %d missing alias (.auf) \
} }
iter++; iter++;
} }
if ((action == 0) && bAutoRecoverMode)
wxLogWarning(_(" Project check regenerated missing alias summary file(s)."));
} }
} }
@ -1579,6 +1583,8 @@ _("Project check detected %d missing audio data \
b->SilenceLog(); b->SilenceLog();
iter++; iter++;
} }
if ((action == 2) && bAutoRecoverMode)
wxLogWarning(_(" Project check replaced missing audio data blockfile(s) with silence."));
} }
} }
@ -1588,23 +1594,31 @@ _("Project check detected %d missing audio data \
wxArrayString orphanFilePathArray; // orphan .au and .auf files wxArrayString orphanFilePathArray; // orphan .au and .auf files
this->FindOrphanBlockFiles(filePathArray, orphanFilePathArray); this->FindOrphanBlockFiles(filePathArray, orphanFilePathArray);
// In auto-recover mode, leave orphan blockfiles alone. if ((nResult != FSCKstatus_CLOSE_REQ) && !orphanFilePathArray.IsEmpty())
// They will be deleted when project is saved the first time.
if ((nResult != FSCKstatus_CLOSE_REQ) && !bAutoRecoverMode && !orphanFilePathArray.IsEmpty())
{ {
wxString msgA = // In auto-recover mode, leave orphan blockfiles alone.
// They will be deleted when project is saved the first time.
if (bAutoRecoverMode)
{
wxLogWarning(_(" Project check ignored orphan blockfile(s). They will be deleted when project is saved."));
action = 1;
}
else
{
wxString msgA =
_("Project check found %d orphan blockfile(s). These files are \ _("Project check found %d orphan blockfile(s). These files are \
\nunused and probably left over from a crash or some other bug. \ \nunused and probably left over from a crash or some other bug. \
\n\nThey should be deleted to avoid disk contention."); \n\nThey should be deleted to avoid disk contention.");
wxString msg; wxString msg;
msg.Printf(msgA, (int)orphanFilePathArray.GetCount()); msg.Printf(msgA, (int)orphanFilePathArray.GetCount());
const wxChar *buttons[] = {_("Close project immediately with no further changes"), const wxChar *buttons[] = {_("Close project immediately with no further changes"),
_("Continue without deleting; ignore the extra files this session"), _("Continue without deleting; ignore the extra files this session"),
_("Delete orphan files immediately"), _("Delete orphan files immediately"),
NULL}; NULL};
wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current. wxLog::FlushActive(); // MultiDialog has "Show Log..." button, so make sure log is current.
action = ShowMultiDialog(msg, _("Warning - Orphan Blockfile(s)"), buttons); action = ShowMultiDialog(msg, _("Warning - Orphan Blockfile(s)"), buttons);
}
if (action == 0) if (action == 0)
nResult = FSCKstatus_CLOSE_REQ; nResult = FSCKstatus_CLOSE_REQ;

View File

@ -2895,6 +2895,7 @@ void AudacityProject::WriteXML(XMLWriter &xmlFile)
while (t) { while (t) {
if ((t->GetKind() == Track::Wave) && mWantSaveCompressed) if ((t->GetKind() == Track::Wave) && mWantSaveCompressed)
{ {
//vvv This should probably be a method, WaveTrack::WriteCompressedTrackXML().
xmlFile.StartTag(wxT("import")); xmlFile.StartTag(wxT("import"));
xmlFile.WriteAttr(wxT("filename"), mStrOtherNamesArray[ndx]); // Assumes mTracks order hasn't changed! xmlFile.WriteAttr(wxT("filename"), mStrOtherNamesArray[ndx]); // Assumes mTracks order hasn't changed!